@ -45,7 +45,24 @@ void ShifterVoice::Trigger(int midi_note) {
|
||||
// Retrigger envelope
|
||||
amplitude_envelope_.Retrigger(false);
|
||||
onoff_ = true;
|
||||
|
||||
float pan_min = 0;
|
||||
float pan_max = 1;
|
||||
if(pan_width < .5f)
|
||||
pan_max = .1 + (pan_width * 2 * .9f);
|
||||
else
|
||||
pan_min = (pan_width - .5f) * 2 * .9f;
|
||||
|
||||
bool pan_left = rand() % 2;
|
||||
|
||||
panning = rand() / (float)RAND_MAX;
|
||||
panning = pan_min + (panning * (pan_max - pan_min));
|
||||
if (pan_left) {
|
||||
panning = .5 - panning * .5f;
|
||||
}
|
||||
else {
|
||||
panning = .5 + panning * .5f;
|
||||
}
|
||||
}
|
||||
|
||||
void ShifterVoice::Release() {
|
||||
|
||||
Reference in New Issue
Block a user