void FLUIDGui::processEvent(const MusECore::MidiPlayEvent& ev) { // p4.0.27 if (ev.type() == MusECore::ME_SYSEX) { const unsigned char* data = ev.data(); switch (*data) { case FS_SEND_SOUNDFONT_NAME: { //const char* filename = data+1; //pathEntry->setText(QString(filename)); pathEntry->setText((const char*)(data+1)); break; } default: #ifdef FS_DEBUG printf("FLUIDGui::processEvent() : Unknown Sysex received: %d\n", ev.type()); #endif break; } } else { #ifdef FS_DEBUG printf("FLUIDGui::processEvent - unknown event of type %dreceived from synth.\n", ev.type()); #endif } }
void MidiInstrument::reset(int portNo) { MusECore::MidiPort* port = &MusEGlobal::midiPorts[portNo]; if(port->device() == 0) return; MusECore::MidiPlayEvent ev; ev.setType(0x90); ev.setPort(portNo); ev.setTime(0); for (int chan = 0; chan < MIDI_CHANNELS; ++chan) { ev.setChannel(chan); for (int pitch = 0; pitch < 128; ++pitch) { ev.setA(pitch); ev.setB(0); port->sendEvent(ev); } } }
//--------------------------------------------------------- // processEvent // All events from the sequencer go here //--------------------------------------------------------- bool ISynth::processEvent(const MusECore::MidiPlayEvent& ev) { switch(ev.type()) { case MusECore::ME_CONTROLLER: setController(ev.channel(), ev.dataA(), ev.dataB()); //return true; // ?? break; case MusECore::ME_NOTEON: return playNote(ev.channel(), ev.dataA(), ev.dataB()); case MusECore::ME_NOTEOFF: return playNote(ev.channel(), ev.dataA(), 0); case MusECore::ME_SYSEX: return sysex(ev.len(), ev.data()); case MusECore::ME_PITCHBEND: setController(ev.channel(), MusECore::CTRL_PITCH, ev.dataA()); break; // Synths are not allowed to receive ME_PROGRAM, CTRL_HBANK, or CTRL_LBANK alone anymore - only CTRL_PROGRAM. //case MusECore::ME_PROGRAM: // setController(ev.channel(), MusECore::CTRL_PROGRAM, ev.dataA()); // break; default: break; } return false; }
//--------------------------------------------------------- // processEvent // All events from the sequencer go here //--------------------------------------------------------- bool ISynth::processEvent(const MusECore::MidiPlayEvent& ev) { switch(ev.type()) { case MusECore::ME_CONTROLLER: setController(ev.channel(), ev.dataA(), ev.dataB()); //return true; // ?? break; case MusECore::ME_NOTEON: return playNote(ev.channel(), ev.dataA(), ev.dataB()); case MusECore::ME_NOTEOFF: return playNote(ev.channel(), ev.dataA(), 0); case MusECore::ME_SYSEX: return sysex(ev.len(), ev.data()); case MusECore::ME_PITCHBEND: setController(ev.channel(), MusECore::CTRL_PITCH, ev.dataA()); break; case MusECore::ME_PROGRAM: setController(ev.channel(), MusECore::CTRL_PROGRAM, ev.dataA()); break; default: break; } return false; }