Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sustain and release issue #43

Open
acoto87 opened this issue Feb 27, 2020 · 2 comments
Open

Sustain and release issue #43

acoto87 opened this issue Feb 27, 2020 · 2 comments

Comments

@acoto87
Copy link

acoto87 commented Feb 27, 2020

If I call tsf_channel_note_on(soundFont, channel, key, 0); internally the library call tsf_note_off(f, preset_index, key); which causes the notes for the channel to go off, but applying sustain (some kind of fading out I think).

I'm using that first call as a way to mute the music of my game, is there any way the sustain and release doesn't get applied? Or should I approach the muting of the music in another way?

I also have this problem when I change the music, say Music 1 is playing and the I as a player change it to Music 2, you can hear the fading out of Music 1 while the Music 2 starts to play.

Am I doing something wrong, using the library wrong or something?

@tobybear
Copy link

Maybe these make the difference:
TSFDEF void tsf_channel_note_off_all(tsf* f, int channel); //end with sustain and release
TSFDEF void tsf_channel_sounds_off_all(tsf* f, int channel); //end immediatly

@acoto87
Copy link
Author

acoto87 commented Feb 27, 2020

Yeah, tsf_channel_sounds_off_all internally call tsf_voice_endquick which is what I would want in this case when I call tsf_channel_note_on(soundFont, channel, key, 0);. Maybe I'm not suppose to use 0 volume as a mean to mute a sound and instead I need to call some variant of tsf_channel_note_off_all or tsf_channel_sounds_off_all.

Thanks for the response :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants