Most straightforward way to play musical notes (like a MIDI synth) from Processing?
in
Core Library Questions
•
2 years ago
I'm trying to use Processing to build a simple musical instrument. Long story short, I have a continuous stream of data coming in from the serial port representing the players's input -- right now they're mapped to MIDI notes (eg 0..127) but I could also represent them as frequencies in Hz (eg 220hz - 1720Hz). I want to use these numbers to play a sampled instrument out of Processing, but I haven't found a library that can do that yet.
What is the simplest way to play musical notes out of Processing?
So far I have been able to use Minim and a custom uGen to make a simple sine-wave oscillator that I pitch bend up and down, but this sounds... well, like a sine wave. I'd like nicer sounding instruments. Is there any library that can play MIDI notes through the computer's synthesizer, or that can pitch-bend WAV-sampled instruments up and down to specific frequencies (like the old Amiga .MOD tracks)?
This is for a one-off project, with an extremely short deadline, so I can't use
promidi, which has no documentation and is broken out of the box.
I see that
minim has a notion of instruments, which is promising. Is there a way to make it work with sampled instruments (all the examples I see are simple waveforms)? Also, all its instruments take a duration for their notes, which I haven't got until the player takes his hand off the instrument -- can a Minim instrument be made to play a continuous note until I tell it to stop?
1