Simple .wav sample player tutorial?

Hello! Is there a tutorial or sample code for creating a very basic sample playback module? I’m looking to learn how to make something like this: https://www.youtube.com/watch?v=gXuw38r-i6U

Ah… quick update, I found this: https://github.com/cfoulc/cf/blob/v1/src/PLAYER.cpp, which may be helpful. Although any simpler tutorial or demo would be much appreciated.

Thanks, Bret

What part do you need help with? Creating the Rack plugin template? Loading a file? Parsing the WAV format? Sample rate conversion between the WAV sample rate and engine sample rate?

I guess that I see your point. Let me dig in a little bit and see if there’s any particular part that I find difficult. I basically starting from the plugin development tutorial, which I have working perfectly. I’ll give it a go and see if I have any specific questions.

There’s also the PLAY module, a simpler version of the PLAYER, in the same repo by CF.

I used that myself to learn how a wav player is put together.

Just take it in steps: Find out how an item is added to the context menu and get that working. Then how to call a function when the menu is selected, then how to open a file browser, load a file, play the wav data etc. etc. etc. I found it a fun way to learn.

2 Likes

I think most vcv samplers, mine included, do it like the cf sampler. We use a library called drwav to parse the wav file.

Thank you everyone for your replies! I’ve made leaps and bounds since I last posted. I’ve taken the PLAY modules and added some additional interesting functionality to it. I’ll share once I’m more confident with my work. :slight_smile:

1 Like