default pan command for InstrumentCore
parent
b1449ebcf6
commit
1b8eeffbcf
2
notes
2
notes
|
@ -36,7 +36,7 @@ TODO {
|
|||
distortion effect
|
||||
single-selection sampler
|
||||
|
||||
global (default) pan (PXX) for InstrumentCore
|
||||
- global (default) pan (PXX) for InstrumentCore
|
||||
|
||||
add ,XX support to global tempo
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ void InstrumentCore::reset() {
|
|||
time = 0;
|
||||
|
||||
volume = 1.0;
|
||||
pan = 0.0;
|
||||
}
|
||||
|
||||
void InstrumentCore::process(Node* n) {
|
||||
|
@ -102,6 +103,7 @@ void InstrumentCore::process(CommandPort* i, AudioPort* o) {
|
|||
forceRetrigger:
|
||||
note.note = n;
|
||||
note.time = note.adsrTime = -smpTime; // compensate for first-advance
|
||||
note.pan = pan;
|
||||
if (onNoteOn) onNoteOn(note);
|
||||
}
|
||||
} else { // existing note
|
||||
|
@ -194,6 +196,10 @@ void InstrumentCore::process(CommandPort* i, AudioPort* o) {
|
|||
volume = (1.0*v) / 255.0;
|
||||
continue;
|
||||
}
|
||||
case 'P': {
|
||||
pan = std::clamp((1.0*static_cast<int8_t>(v)) / 127.0, -1.0, 1.0);
|
||||
continue;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -78,6 +78,7 @@ namespace Xybrid::NodeLib {
|
|||
};
|
||||
|
||||
double volume = 1.0;
|
||||
double pan = 0.0;
|
||||
|
||||
std::unordered_map<uint16_t, Note> activeNotes;
|
||||
std::unordered_multimap<uint16_t, Tween> activeTweens;
|
||||
|
|
Loading…
Reference in New Issue