Audio Sample Looper + Sampler Instrument

Hi everyone,

I’m trying to develop a Sampler keyboard instrument in JUCE and have an audio sample (drone) looping in the background.

  1. I have managed to create a sampler instrument using the SynthAudioSource class and the sample player exactly as shown in the tutorial here
    Upon adding the loop section exactly as shown here, the audio sample loops from the get go rather than being controlled by a play button. I was looking to get some advise on the best way of incorporating the two to have a start button that when clicked starts the sample playback and looping.

  2. I’m using a MixerAudioSource object to mix the SynthAudioSource(sampler instrument) and TransportSource(sample player) outputs together. What would be the best way to use the looping mechanism shown in the 2nd link above and loop just the sample player, while the sampler instrument output still works only when triggered?

Any advise would be appreciated!


did you get it done? i wante to create something similar. not a drone but some kind of audio based oscillator.

Yes I did manage to somehow figure it out in the end, however not in a very ‘clean’ manner.

Are you wishing to have an oscillator that can be sampled/pitched? If so, then you’ll be better off using the Synthesiser class. The AudioTransportSource class would be useful if you want to playback a file without any sampling/pitching.