How to play a single note (sound) using Tracktion Engine's SamplerPlugin?


I’m building Sequencer app with drums pad. I load sounds using SamplerPlugin and play them as sequence using StepClip. Same way as in StepSequencerDemo example. I’m trying to get single note to play once button on my drumpad is clicked. But so far I cannot figure out how to do it. I tried to call void SamplerPlugin::playNotes (const juce::BigInteger& keysDown) with passing noteNumber for particular channel or keyNote (int SamplerPlugin::getKeyNote) but no sound is being produced.

Is anybody know what I’m doing wrong or is it a right approach for achieving this goal?

Thanks for help in advance!

Probably easiest to grab the track that the sampler is on and use injectLiveMidiMessage(). This way it’s not tied to the sampler, and if in future if you replace the sampler with a drum synth, it’ll still work.

1 Like

Awesome! I’ll give it a shot. Thanks!