prepare to implement sample map

This commit is contained in:
tildearrow 2022-05-13 18:46:52 -05:00
parent be0cbfa1f7
commit 77481f23cb
1 changed files with 26 additions and 0 deletions

View File

@ -311,6 +311,32 @@ struct DivInstrumentAmiga {
int noteFreq[120];
short noteMap[120];
/**
* get the sample at specified note.
* @return the sample.
*/
inline short getSample(int note) {
if (useNoteMap) {
if (note<0) note=0;
if (note>119) note=119;
return noteMap[note];
}
return initSample;
}
/**
* get the sample frequency at specified note.
* @return the frequency, or -1 if not using note map.
*/
inline int getFreq(int note) {
if (useNoteMap) {
if (note<0) note=0;
if (note>119) note=119;
return noteFreq[note];
}
return -1;
}
DivInstrumentAmiga():
initSample(0),
useNoteMap(false),