private static void PlayChannelSetup() { if (PlayChannelInstrument == "Mute") { return; } MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), PlayChannelInstrument), (ChannelEnum)1); Debug.Log("Set PlayChannelSetup " + 1 + " to " + PlayChannelInstrument); }
void SetInstruments() { for (int i = 0; i < instruments.Length; i++) { if (instruments [i] != ProgramEnum.None) { MidiOut.SetInstrument(instruments [i], (ChannelEnum)i); } } }
private static void VoiceChannelSetup() { if (VoiceChannelInstrument == "Mute") { return; } for (int i = 7; i <= 8; i++) { MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), VoiceChannelInstrument), (ChannelEnum)i); //Debug.Log("Set VoiceChannelSetup " + i + " to " + VoiceChannelInstrument); } }
private static void RightChannelSetup() { if (RightChannelInstrument == "Mute") { return; } for (int i = 5; i <= 6; i++) { MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), RightChannelInstrument), (ChannelEnum)i); //Debug.Log("Set RightChannelSetup " + i + " to " + RightChannelInstrument); } }
private static void LeftChannelSetup() { if (LeftChannelInstrument == "Mute") { return; } for (int i = 3; i <= 4; i++) { MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), LeftChannelInstrument), (ChannelEnum)i); //Debug.Log("Set LeftChannelSetup " + i + " to " + LeftChannelInstrument); } }
//private static bool ChannelSetupInit = true; public static void ChannelSetup() { //if (ChannelSetupInit) { PlayChannelSetup(); LeftChannelSetup(); RightChannelSetup(); VoiceChannelSetup(); MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), "AcousticGrandPiano"), (ChannelEnum)InputChannel.ExternalKeyboard); MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), "AcousticGrandPiano"), (ChannelEnum)InputChannel.InGamePiano); //ChannelSetupInit = false; } }
public void OnInstrumentChange() { Debug.Log(instrumentDropdown.value); string channel = channelDropdown.options [channelDropdown.value].text; string instrument = instrumentDropdown.options [instrumentDropdown.value].text; if (channel == "All") { for (int i = 0; i < 16; i++) { MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), instrument), (ChannelEnum)i); } } else { MidiOut.SetInstrument((ProgramEnum)Enum.Parse(typeof(ProgramEnum), instrument), (ChannelEnum)(int.Parse(channel) - 1)); } }