Need a library that generates WAVE from Midi

你离开我真会死。 提交于 2019-11-29 07:33:25

This is what's called a Soft Synth, you will also need a set of instrument samples if you want them the sound the same on all machines.

You may find that you will save memory if you just convert them all to wave files once and ship the wave files. A high quality instrument set can be quite large, and most of them are copyrighted as well.

I've used Timidity to do this, but that's been many years ago, and on Linux.

Quick answer - have a look at FluidSynth. It is software synthesizer that uses sound banks in SoundFont format. It has also its library that could be used to "render" the MIDI file.

A bank with General MIDI sound set can be found for example on http://www.hammersound.com, such as http://www.hammersound.com/cgi-bin/soundlink.pl?action=view_download_page;ID=407;SoundFont_Location_Selected=Download;SoundFont_Filename_Selected=http://www.jchyun.com/~sonic/sf2/hubbe/Hubbe64%20GM%20v2.50.zip.

You could do it another way - you can just play them through your device, start sound recording software, set input to "what you hear", record it and then cut it.

A longer answer - The question is, what are your needs and purpose of this procedure?

If you prefer same sound from MIDI files on different computers, you have following options:

  • Use just MIDI. MIDI sounds are standardized, although there can be differences given samples from your sound card. Do you have some special good sounds, that you want to use?
  • Use card that supports SoundFonts - like SoundBlaster AWE 32 and higher, set recording input to "what you hear" and record the sounds.
  • Convert MIDI files to some tracker format. This format saves notes as midi but allows also sound samples to be saved in one file. Although conversion will take some amount of work. Module files contain so-called patterns that can be played in requested order. That would be ideal example for games where you could easily loop one song. Advantage is same sound on each computer and small size. Disadvantage can be a loss of quality, because sample pitches are shifted up and down to create various tones. If you use multisampled instruments, that would not be your concern. If you would prefer this way, I suggest you to look on IT (ImpulseTracker) and mo3 formats. As tracker editor OpenMPT can be used. It also allows import and export of MIDI files. For playing of that files you could use MikMod library or FMOD library (commercial).
  • Use software synthesiyer that uses sound banks. Example of such synthesizer is FluidSynth. If this music should be embedded into some program, that could be good alternative.
  • Use external MIDI sound module, such as Roland SonicCell or any good sounding keyboard as my favourite Korg M50, plug output of this module into your sound card, set playlist in some MIDI player, choose this device, start recording software from connected sound input, record and cut.

P.S. Sorry for no links, as I am new here, only two links can be in my answer.

If they are static midi arrangements you could use a DAW with some soft synth plugins (e.g. http://www.cockos.com/reaper/ Cubase, etc and just supply wavs\mp3s with your app...?

PistonSofts's Direct MIDI to MP3 Converter. I don't think it's a library per se, but it has a command-line interface.

You can use FFMPEG to handle conversions of both Movies and Audio, including I believe MIDI to Wave. http://ffmpeg.arrozcru.org/wiki/index.php?title=Links has some basic information on the process, but basically once installed you can just run the command line process in a background process thread and raise an event once complete.

http://code.google.com/p/ffmpeg-sharp/ is wrapper built for FFMPEG and .net framework. I am sure there are probably more

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!