Hi All,
I am new to Juce. I am a musician and computer science student. I built a few midi only plugins with juce thus far and I am attempting to tackle the Audio side. I learnt C at university and know a bit of C++ .
I thought I would start with an ear training application that selects notes randomly and plays them back.
I have created short samples of each note using my DAW.
I figured trying to play samples might be easier than synthesis at my stage …
I was hoping to store the names of all the files in an array and select them somehow randomly … Possibly a 2 dimensional array with notes from different octaves in each column.
I edited the playing sound files tutorial.
I can add a sound file as a binary resource and play it like this :
C5 is an mp3 file C5.mp3 which is 4 second sample of a DX7 playing midi note C5.
AudioFormatReader* reader = formatManager.createReaderFor( new MemoryInputStream(BinaryData::C5_mp3, BinaryData::C5_mp3Size, false));
if (reader != nullptr)
{
ScopedPointer<AudioFormatReaderSource> newSource = new AudioFormatReaderSource (reader, true);
transportSource.setSource (newSource, 0, nullptr, reader->sampleRate);
playButton.setEnabled (true);
readerSource = newSource.release();
transportSource.start();
I am not sure how to go about clearing out those classes from the buffer and reloading and playing a new file …
I also dont know how to add load a filename if it is stored say as a char array ( string array ) … Perhaps I will rename all the samples 60.mp3 etc …
Lets say I randomly select the integers 55, 60 and 65 how would I load the filenames play those 3 mp3 files 55.mp3 60.mp3 and 65.mp3 sequentially ?
I know it’s probably not very kosher to ask for help with your code in a forum like this but it’s a bit like running at a brick wall arriving at all the documentation and nested classes for the first time …
Any advice would be greatly appreciated.
Thanks in advance …
Sean
www.seanwayland.com