Exemplo n.º 1
0
    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);
    }
Exemplo n.º 2
0
 void SetInstruments()
 {
     for (int i = 0; i < instruments.Length; i++)
     {
         if (instruments [i] != ProgramEnum.None)
         {
             MidiOut.SetInstrument(instruments [i], (ChannelEnum)i);
         }
     }
 }
Exemplo n.º 3
0
    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);
        }
    }
Exemplo n.º 4
0
    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);
        }
    }
Exemplo n.º 5
0
    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);
        }
    }
Exemplo n.º 6
0
    //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));
        }
    }