Opens a folder full of WAV files and gleans information about the files to prep them for parsing and having their sample guts extracted. This object can figure out MIDI unity note numbers from the WAV file names (e.g. Dagga_A#4.wav). This object is used to parse folders of samples to build patches for sample based synths.
More...
#include <pcmsample.h>
|
| WaveFolder (const char *_waveFolderPath, const char *_waveFolderName) |
|
uint32_t | parseFolder (PCMSample **sampleSet, bool pitchlessLoops, bool aubioSlices=false) |
| The main function that opens a folder, creates the WAV information map, and then parses the files in succession after that. This uses some platform independent code for iterating through folders and files. More...
|
|
void | addNextFileToMap (std::string fileFolderPath, std::string fileName, bool aubioSlices, std::map< int, std::string > *wavFilePaths, int &fileCount) |
| Adds information about a WAV file in the folder to a map that is later used to parse the files in succession. More...
|
|
void | eraseSubStr (std::string &mainStr, const std::string &toErase) |
|
|
void | buildNoteTables () |
| Sets up the tables for trying to suss out the MIDI note number from a filename that attempts to include the note name/number in its filename. More...
|
|
int32_t | findNoteNumberInName (const char *filename, bool shiftUpOctave=true) |
| figure out MIDI note number from string More...
|
|
|
const char * | waveFolderPath |
|
const char * | waveFolderName |
|
std::string | noteTableSharps [120] |
| table with characters used to decode filenames with sharps
|
|
std::string | noteTableFlats [120] |
| table with characters used to decode filenames with flats
|
|
Opens a folder full of WAV files and gleans information about the files to prep them for parsing and having their sample guts extracted. This object can figure out MIDI unity note numbers from the WAV file names (e.g. Dagga_A#4.wav). This object is used to parse folders of samples to build patches for sample based synths.
- Author
- Will Pirkle http://www.willpirkle.com
- Version
- Revision : 1.0
- Date
- Date : 2021 / 04 / 26
◆ addNextFileToMap()
void SynthLab::WaveFolder::addNextFileToMap |
( |
std::string |
fileFolderPath, |
|
|
std::string |
fileName, |
|
|
bool |
aubioSlices, |
|
|
std::map< int, std::string > * |
wavFilePaths, |
|
|
int & |
fileCount |
|
) |
| |
Adds information about a WAV file in the folder to a map that is later used to parse the files in succession.
- Parameters
-
fileFolderPath | the WAV folder path |
fileName | the WAV filename |
aubioSlices | set to TRUE if these are aubio slice files |
wavFilePaths | map to add information to |
fileCount | return value of the number of files found |
◆ buildNoteTables()
void SynthLab::WaveFolder::buildNoteTables |
( |
| ) |
|
|
protected |
Sets up the tables for trying to suss out the MIDI note number from a filename that attempts to include the note name/number in its filename.
◆ findNoteNumberInName()
int32_t SynthLab::WaveFolder::findNoteNumberInName |
( |
const char * |
filename, |
|
|
bool |
shiftUpOctave = true |
|
) |
| |
|
protected |
figure out MIDI note number from string
Try to figure out the MIDI note number from the WAV filename.
- Parameters
-
filename | the WAV filename |
shiftUpOctave | set true to offset by one octave; this is due to the two different MIDI note numbering systems still in use that are off by one octave |
- Returns
- the MIDI note number, if found or -1 if not found
◆ parseFolder()
uint32_t SynthLab::WaveFolder::parseFolder |
( |
PCMSample ** |
sampleSet, |
|
|
bool |
pitchlessLoops, |
|
|
bool |
aubioSlices = false |
|
) |
| |
The main function that opens a folder, creates the WAV information map, and then parses the files in succession after that. This uses some platform independent code for iterating through folders and files.
- Parameters
-
sampleSet | the return variable, an array of pointers to loaded PCM samples |
pitchlessLoops | set TRUE if you know the folder has pitchless loops like drum loops |
aubioSlices | set to TRUE if these are aubio slice files |
- Returns
- the number of WAV files successfully opened and parsed
The documentation for this class was generated from the following files: