I have two questions about midi messages and synthesisers.
I was wondering what concequences sending only noteOn’s via a keyboardstate to a synthesiser has? I am making a step sequencer and it has to play the whole .wav with every trigger. So do I need to send a noteOff for some reason?
The second question is if i send 2 noteOn’s to a synthesiser so that the second noteOn is sent before the first sound stops, does the first sound continue playing, or does it stop to play the second? (I dont hear it when I try it).
Thanks in advance!
This ultimately depends on how the synth is implemented, but I would expect most synths to play two notes overlapped if two note on events arrive for the same note. Without a note off the sound will go on forever.
As fabian says this depends on the synth you send to.
In general sending only note-on to a instrument is a bad idea, it might work in you case.
I would expect it to play the sounds on top of each other unltil it runs out of voices
Maybe you could send a note off right before each note on?
This way any playing sound would stop before you restart it, and the number of noteon vs note off would be fairly similar.
@fabian and nikolai, thanks for the reply.
The synth is just a basic synthesiser from the juce API, nothing changed.
The sounds that are supplied to the synth are SamplerSounds which use a AudioFormatReader from an audiofile (currently a .wav). (SamplerSound has a max length parameter, so maybe this stops sound after a while? But don't know for sure)
I can't send a noteOff before the next noteOn because with a high BPM and high beat division most sounds will be longer than the time between these noteOn and NoteOff, and i would like to play the whole sound.
The sound that it creates sounds like its correct, but i dont know what it does with the performance, CPU performance doesn't rise if i keep sending it noteOn's (checked it with Visual Studio) but I can't test memory usage because Visual Studio says "No data collected" when i run a memory test.
So is there anyone who knows how the juce synthesiser handles this?
Thanks in advance,