static void CleanUp() { MidiOut.AllPedalsOff(); MidiOut.AllSoundOff(); MidiOut.ResetAllControllers(); MidiINPlugin.DisconnectDevices(); MidiOUTPlugin.DisconnectDevices(); Synth.Stop(); }
static void InitMIDIUnfied() { Debug.Log("Initializing MIDIUnified"); MidiOut.channelMask = channelMask; MidiOut.channelMask = PlayerPrefs.GetInt("MIDIOUT_MIDI_MASK", settings.channelMask); Debug.Log("Channel Mask : " + MidiOut.channelMask); MidiOut.synthChannelMask = synthChannelMask; MidiOut.synthChannelMask = PlayerPrefs.GetInt("SYNTH_MIDI_MASK", settings.synthChannelMask); Debug.Log("SynthChannel Mask : " + MidiOut.synthChannelMask); for (int i = 0; i < settings.instruments.Length; i++) { if (settings.instruments[i] != ProgramEnum.None) { MidiOut.SetInstrument(settings.instruments[i], (ChannelEnum)i); } } MidiOut.ignoreProgramMessages = settings.ignoreProgramMessages; }
void OnApplicationPause() { MidiOut.AllSoundOff(); }