Importing 3 audio files that play when pressing the same MIDI note

As a complete newbie, I’m trying to build a simple sampler by watching these tutorials on YouTube by The Audio Programmer channel. His tutorials are for a sampler that loads only 1 audio file that then can be played across the keyboard.

My goal is to load 3 audio files (so 3 separate “LOAD” buttons) and they will all get triggered when pressing a note on my MIDI controller. Without putting too much on my plate (or anyone’s plate here), the final goal is to have the 3 samples play one after another (without any gaps/silence in between them), so when sample 1 reaches the end of the audio file, it automatically jumps to sample 2 (plays start to finish), then sample 3 (plays start to finish). But for now, all I would like to know is how to load 3 audio files, but I just explained what I need in case that’s relevant and something I should be thinking from the start.

Can someone point me in the right direction on what I should be looking at? The classes and all that. What should I be studying in order to being able to load 3 samples and not just 1 and being able to assign them all to the same MIDI note?
Would this tutorial help me with that, by then somehow duplicating what’s available in the “Opening a File” section?
https://docs.juce.com/master/tutorial_playing_sound_files.html

Thank you.

I would prefer to use a ListBox for instance to manage the sample paths.
But why load 3 audio files and not just make one (glue the 3) with an audio editor?
Does it really need to be dynamically changeable?
Or at least stick them once selected, just before to be played.
As such the DSP part is the same that for a regular simple sampler.

Thanks for the reply and ListBox suggestion. I will do some research on that.

This plugin is a way for people to create a new sample out of 3 samples, by quickly loading new samples on each “Track” (Track 1, Track 2, Track 3).

But at the same time, all of them need to be triggered by just hitting the same MIDI note.

Basically you can think of it as an audio editor that loads 3 samples where you can pick the length for each sample, including volume as well, but if you don’t like sample 1, you can easily and quickly load another sample on that track, while sample 2 and sample 3 are intact.

Hope it makes sense.

I think it might be worth looking into the MPESampler tutorial. Even though MPE is not what you need, but it has the hole MIDI and audio display, changing and editing worked out in a very clever way.
Here is a GitHub link: JUCE/SamplerPluginDemo.h at master · juce-framework/JUCE · GitHub

I have a project laying around (I think) where I cleaned up the code to improve the readability. I can send it to you if you are interested.

Thanks for the feedback and link.
Yes, I’m always interested in seeing other people’s approach and code so I can learn more :wink: I appreciate it!