prepare to implement sample map
This commit is contained in:
parent
be0cbfa1f7
commit
77481f23cb
|
@ -311,6 +311,32 @@ struct DivInstrumentAmiga {
|
||||||
int noteFreq[120];
|
int noteFreq[120];
|
||||||
short noteMap[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():
|
DivInstrumentAmiga():
|
||||||
initSample(0),
|
initSample(0),
|
||||||
useNoteMap(false),
|
useNoteMap(false),
|
||||||
|
|
Loading…
Reference in New Issue