예제 #1
0
        public SpeccyMIDI()
        {
            midiOut = new MidiOut(0);

            instruments = new SpeccyMIDIChannel[15];

            for (int buc = 0; buc < 15; buc++)
            {
                instruments[buc] = new SpeccyMIDIChannel(midiOut, buc > 9 ? buc + 2 : buc + 1);
            }

            percussion = new SpeccyPercussionChannel(midiOut);
        }
예제 #2
0
            public SpeccyMIDIChannelPlayer(SpeccyMIDIChannel Channel, string Tune)
            {
                if (string.IsNullOrWhiteSpace(Tune))
                {
                    throw new InvalidProgramException("Invalid tune");
                }

                tune      = ExpandParentheses(Tune);
                channel   = Channel;
                tickTimer = new Timer((o) =>
                {
                    Tick();

                    if (tickTimer != null)
                    {
                        tickTimer.Change(1, Timeout.Infinite);
                    }
                });
            }
예제 #3
0
 public void Dispose()
 {
     Stop();
     channel = null;
 }