14 typedef unsigned int UINT;
15 typedef unsigned long DWORD;
16 typedef unsigned char UCHAR;
17 typedef unsigned char BYTE;
32 UINT loopStartIndex = 0;
33 UINT loopEndIndex = 0;
35 UINT unityMIDINote = 0;
36 UINT unityMIDIPitchFraction = 0;
40 bool sampleLoaded =
false;
41 const float* getSampleBuffer() {
return pcmSampleBuffer; }
42 void setPitchless(
bool _pitchlessSample) { pitchlessSample = _pitchlessSample; }
43 bool isPitchless() {
return pitchlessSample; }
48 float* pcmSampleBuffer =
nullptr;
49 bool pitchlessSample =
false;
53 void operator()(
char& c) { c = toupper((
unsigned char)c); }
65 WaveFolder(
const char* _waveFolderPath,
const char* _waveFolderName) {
66 waveFolderPath = _waveFolderPath;
67 waveFolderName = _waveFolderName;
73 uint32_t
parseFolder(PCMSample** sampleSet,
bool pitchlessLoops,
bool aubioSlices =
false);
76 void eraseSubStr(std::string & mainStr,
const std::string & toErase)
79 size_t pos = mainStr.find(toErase);
80 if (pos != std::string::npos)
83 mainStr.erase(pos, toErase.length());
87 void addNextFileToMap(std::string fileFolderPath, std::string fileName,
bool aubioSlices, std::map<int, std::string>* wavFilePaths,
int& fileCount);
90 const char* waveFolderPath;
91 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 ...
Definition: pcmsample.cpp:815
void buildNoteTables()
Sets up the tables for trying to suss out the MIDI note number from a filename that attempts to inclu...
Definition: pcmsample.cpp:666
Definition: analogegcore.cpp:4
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 suc...
Definition: pcmsample.cpp:743
bool loadPCMSample(const char *filePath)
Opens a WAV file and extracts the audio guts into a buffer of floats. Anytime later, you can use isSampleLoaded( ) to see if the sample data is valid.
Definition: pcmsample.cpp:29
int32_t findNoteNumberInName(const char *filename, bool shiftUpOctave=true)
figure out MIDI note number from string
Definition: pcmsample.cpp:701
void setPitchless(bool _pitchlessSample)
Definition: pcmsample.h:109
std::string noteTableFlats[120]
table with characters used to decode filenames with flats
Definition: pcmsample.h:230
std::string noteTableSharps[120]
table with characters used to decode filenames with sharps
Definition: pcmsample.h:229