I need convert/synthesize MIDI data to audio stream PCM data. What would be an easy way to do so?
-
2is.gd/igp4m -- I've seen so many questions about converting MIDI to audio I had to write this. Please take the time to read it if you are considering writing some software system which needs to do that.– Nik ReimanCommented Dec 6, 2010 at 18:57
-
@Nik: Surely I know all that (and I would think most people do as it is just logical). What do you think would be a better word instead of "convert" here?– AlbertCommented Dec 6, 2010 at 21:23
-
1I'd use the word "synthesize". ;) Sorry, I didn't mean to sound condescending; it just seems that this question gets asked a lot by people who underestimate the difficulty of doing this task.– Nik ReimanCommented Dec 7, 2010 at 1:01
-
1@NikReiman i'd like to read what you wrote about "audio to midi" but the link (is.gd/igp4m) is dead. could you post a permalink?– sam boosalisCommented Nov 13, 2012 at 3:21
-
1@samboosalis yeah, I migrated domains some while back. New link is here: mergeconflict.net/2010/12/just-for-record-you-dont-convert.html– Nik ReimanCommented Nov 13, 2012 at 8:22
4 Answers
Take your pick on what you want to do, there is a MIDI section on the page.
-
It seems that none of the MIDI libs which are listed there can do what I asked for. Or did I miss one?– AlbertCommented Dec 4, 2010 at 18:12
-
1I am not aware of a specific answer to your question, however do glance over the libraries in the link, maybe they do serve your purpose. If you are aware of an external command/ software that can do this for you, then
subprocess
can help. Commented Dec 4, 2010 at 18:28 -
@Albert: Almost all of the MIDI tools in "Playing & creating sound" can handle it. Commented Dec 4, 2010 at 20:26
-
@Ignacio: I don't quite see how they support that. Can you explain?– AlbertCommented Dec 5, 2010 at 0:35
-
2I think my problem was that I didn't realized that the thing I want is called "synthesizer".– AlbertCommented Dec 5, 2010 at 16:06
I decided to code my own (based on timidity and subprocess). The code can be seen here: https://github.com/albertz/learn-midi/blob/master/decode.py
I downloaded a prebuild binary of Timidty for MacOSX here: http://www.merenbach.com/software/ports/timidity
And I installed the Freepats package from here: http://freepats.zenvoid.org/
You can try this:
Project description:
"Easily synthesize MIDI to audio or just play it. It provides a Python and command-line interface to the FluidSynth synthesizer to make it easy to use and suitable for scripting and batch processing. In contrast, most MIDI processing software is GUI-based."
Is using Jython an option ? I think the javax.sound.midi classes would handle this.