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); }
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); } }); }
public void Dispose() { Stop(); channel = null; }