How do I render MIDI input (port 0x330-331) to a PCM stream (44KHz) using SF2 specs?

I've read the SoundFont 2.0 specs and written a function to read a .SF2 file using the RIFF file format.

I'm wondering, how exactly do I render MIDI input (note on, note off, pitch wheel etc.) using the loaded SoundFont? I'm working at a constant rate of 44KHz (44100Hz).

What needs to happen when a note On is received?

Same with note off commands. What happens to a running sound (which has note(s) on) during a bank change? (So you send a note on, wait a bit, perform a bank change, wait a bit, finally send a note off command for the note)
Is the note continued on a different bank of stopped at the bank change?

What are the minimum requirements needed to be implemented to render MIDI using a memory-loaded soundfont?
Thats kinda like a book's worth of a reply but if you are looking for ideas, my first stop is sourceforge.net or the debian repository to find what most everyone is using in the way of libraries like fluidsynth.
fluidsynth.sourceforge.net
Most there is open source. The smallest and most simplistic of which in a complete app that I could find is the virtual MIDI piano http://sourceforge.net/projects/vmpk
Not endorsing just passing it along.

If you want to dig in from scratch, keep in mind that rendering tune segments involves blending seamless starts and stops so you don't get clicks, waveform emulation to fill in those missing patches between notes (i.e. stretching a sound without tempo change) and dealing with harmonic noises that get generated from patches that don't mesh well.
Topic archived. No new replies allowed.