| 188 | } |
| 189 | |
| 190 | void MidiDevice::SendNote(double time, int pitch, int velocity, bool forceNoteOn, int channel) |
| 191 | { |
| 192 | if (mMidiOut) |
| 193 | { |
| 194 | if (channel == -1) |
| 195 | channel = mOutputChannel; |
| 196 | |
| 197 | int sampleNumber = (time - gTime) * gSampleRateMs; |
| 198 | |
| 199 | juce::MidiBuffer midiBuffer; |
| 200 | |
| 201 | if (velocity > 0 || forceNoteOn) |
| 202 | midiBuffer.addEvent(MidiMessage::noteOn(channel, pitch, (uint8)velocity), sampleNumber); |
| 203 | else |
| 204 | midiBuffer.addEvent(MidiMessage::noteOff(channel, pitch), sampleNumber); |
| 205 | |
| 206 | mMidiOut->sendBlockOfMessages(midiBuffer, Time::getMillisecondCounter(), gSampleRate); |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | void MidiDevice::SendCC(int ctl, int value, int channel /* = -1*/) |
| 211 | { |
no outgoing calls