schellingb / TinySoundFont

SoundFont2 synthesizer library in a single C/C++ file
MIT License
608 stars 71 forks source link

Would be possible to sustain a note? #70

Closed dortamiguel closed 2 years ago

dortamiguel commented 2 years ago

When I play a note it will fade over time, but sometimes I want a note to be sustained more than what it does by default.

I looked at the source and I saw some references to sustain, though I could not find out how to tweak this parameter when I play sonud.

Could you help me to find a way to tell to tsf for how long I want to sustain a note?

ghost commented 2 years ago

You can probably use a control change. https://nickfever.com/music/midi-cc-list

dortamiguel commented 2 years ago

I remembered this comment https://github.com/schellingb/TinySoundFont/issues/56#issuecomment-817839274

And it worked perfectly