2
0
Fork 0

Carrier attenuation set according to MIDI velocity (ie implement keyboard volume).

This commit is contained in:
bruce 2013-09-21 01:44:59 +08:00
parent bfaf7fccc4
commit 542d05d7c8

View file

@ -499,6 +499,7 @@ void JuceOplvstiAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuf
while (ch <= Hiopl::CHANNELS && NO_NOTE != active_notes[ch]) { while (ch <= Hiopl::CHANNELS && NO_NOTE != active_notes[ch]) {
ch += 1; ch += 1;
} }
Opl->SetAttenuation(ch, 2, 63 - (midi_message.getVelocity() / 2));
Opl->KeyOn(ch, noteHz); Opl->KeyOn(ch, noteHz);
active_notes[ch] = n; active_notes[ch] = n;
} }