예제 #1
0
        /// <summary>
        /// Initializes a new instance of the MidiChaser class with the 
        /// specified MIDI sender and tick generator.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use for sending MIDI messages.
        /// </param>
        /// <param name="tickGenerator">
        /// The tick generator to use for setting the tempo.
        /// </param>
        public MidiChaser(IMidiSender midiSender, TickGenerator tickGenerator)
        {
            this.midiSender = midiSender;
            this.tickGenerator = tickGenerator;

            controllers = new ChannelMessage[ShortMessage.DataValueMax];

            Initialize();
        }
예제 #2
0
        /// <summary>
        /// Initializes a new instance of the MidiChaser class with the
        /// specified MIDI sender and tick generator.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use for sending MIDI messages.
        /// </param>
        /// <param name="tickGenerator">
        /// The tick generator to use for setting the tempo.
        /// </param>
        public MidiChaser(IMidiSender midiSender, TickGenerator tickGenerator)
        {
            this.midiSender    = midiSender;
            this.tickGenerator = tickGenerator;

            controllers = new ChannelMessage[ShortMessage.DataValueMax];

            Initialize();
        }
예제 #3
0
        /// <summary>
        /// Initializes an instance of the Sequencer class.
        /// </summary>
        public SequencerBase(Midi.IMidiReceiver inDevice, Midi.IMidiSender outDevice)
        {
            this.tickGen      = new Endogine.Midi.TickGenerator();
            this.tickGen.Ppqn = 96;
            //this.tickGen.Tempo = 500000;
            this.tickGen.Tick += new System.EventHandler(this.TickHandler);

            this.xoutDevice = outDevice;
            InitializeSequencer();
        }
예제 #4
0
        /// <summary>
        /// Initializes an instance of the Sequencer class.
        /// </summary>
        public SequencerBase(Midi.IMidiReceiver inDevice, Midi.IMidiSender outDevice)
        {
            this.tickGen = new Endogine.Midi.TickGenerator();
            this.tickGen.Ppqn = 96;
            //this.tickGen.Tempo = 500000;
            this.tickGen.Tick += new System.EventHandler(this.TickHandler);

            this.xoutDevice = outDevice;
            InitializeSequencer();
        }
예제 #5
0
        /// <summary>
        /// Initializes a new instance of the TrackPlayer class with the
        /// specified MIDI sender, tick generator, and track.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use for sending MIDI messages.
        /// </param>
        /// <param name="tickGen">
        /// The tick generator used for timing the playback of MIDI messages.
        /// </param>
        /// <param name="trk">
        /// The track to play back.
        /// </param>
        public TrackPlayer(IMidiSender midiSender, TickGenerator tickGen, Track trk)
        {
            this._midiSender = midiSender;
            this.tickGen     = tickGen;
            this.trk         = trk;

            tickGen.Tick += new EventHandler(TickHandler);

            // Set playback position at the beginning of the track.
            Seek(0);
        }
예제 #6
0
        /// <summary>
        /// Initializes a new instance of the TrackPlayer class with the 
        /// specified MIDI sender, tick generator, and track.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use for sending MIDI messages.
        /// </param>
        /// <param name="tickGen">
        /// The tick generator used for timing the playback of MIDI messages.
        /// </param>
        /// <param name="trk">
        /// The track to play back.
        /// </param>
        public TrackPlayer(IMidiSender midiSender, TickGenerator tickGen, Track trk)
        {
            this._midiSender = midiSender;
            this.tickGen = tickGen;
            this.trk = trk;

            tickGen.Tick += new EventHandler(TickHandler);

            // Set playback position at the beginning of the track.
            Seek(0);
        }
예제 #7
0
        /// <summary>
        /// Initializes a new instance of the SequencePlayer class with the 
        /// specified MIDI sender, tick generator and sequence.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use to send MIDI messages.
        /// </param>
        /// <param name="tickGen">
        /// The tick generator used for timing the playback of MIDI messages.
        /// </param>
        /// <param name="seq">
        /// The sequence to playback.
        /// </param>
        public SequencePlayer(IMidiSender midiSender, TickGenerator tickGen, 
            Sequence seq)
        {
            this.xmidiSender = midiSender;
            // For each track in the sequence.
            foreach(Track t in seq)
            {
                // Create track player for the track.
                TrackPlayer player = new TrackPlayer(this.xmidiSender, tickGen, t);
                trackPlayers.Add(player);

                // Register to be notified when the track player has reached
                // the end of the track.
                player.EndOfTrackReached +=
                    new EventHandler(EndOfTrackReachedHandler);
            }

            activeTrackCount = trackPlayers.Count;
        }
예제 #8
0
        /// <summary>
        /// Initializes a new instance of the SequencePlayer class with the
        /// specified MIDI sender, tick generator and sequence.
        /// </summary>
        /// <param name="midiSender">
        /// The MIDI sender to use to send MIDI messages.
        /// </param>
        /// <param name="tickGen">
        /// The tick generator used for timing the playback of MIDI messages.
        /// </param>
        /// <param name="seq">
        /// The sequence to playback.
        /// </param>
        public SequencePlayer(IMidiSender midiSender, TickGenerator tickGen,
                              Sequence seq)
        {
            this.xmidiSender = midiSender;
            // For each track in the sequence.
            foreach (Track t in seq)
            {
                // Create track player for the track.
                TrackPlayer player = new TrackPlayer(this.xmidiSender, tickGen, t);
                trackPlayers.Add(player);

                // Register to be notified when the track player has reached
                // the end of the track.
                player.EndOfTrackReached +=
                    new EventHandler(EndOfTrackReachedHandler);
            }

            activeTrackCount = trackPlayers.Count;
        }
예제 #9
0
 /// <summary>
 /// Initializes a new instance of the MidiClock class with the 
 /// specified tick generator.
 /// </summary>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public MidiClock(TickGenerator tickGenerator)
 {
     this.tickGenerator = tickGenerator;
 }
예제 #10
0
 /// <summary>
 /// Initializes a new instance of the MidiClock class with the
 /// specified tick generator.
 /// </summary>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public MidiClock(TickGenerator tickGenerator)
 {
     this.tickGenerator = tickGenerator;
 }
예제 #11
0
 /// <summary>
 /// Initializes an instance of the SlaveClock class with the specified
 /// MIDI receiver, MIDI sender, and tick generator.
 /// </summary>
 /// <param name="midiReceiver">
 /// The MIDI receiver used for receiving MIDI messages from a master
 /// device.
 /// </param>
 /// <param name="midiSender">
 /// The MIDI sender used for sending MIDI messages to slave devices.
 /// </param>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public SlaveClock(IMidiReceiver midiReceiver, IMidiSender midiSender,
                   TickGenerator tickGenerator) : base(midiSender, tickGenerator)
 {
     this.midiReceiver = midiReceiver;
 }
예제 #12
0
 /// <summary>
 /// Initializes a new instance of the MasterClock class with the
 /// specified MIDI sender and tick generator.
 /// </summary>
 /// <param name="midiSender">
 /// The MIDI sender used for sending system realtime messages.
 /// </param>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public MasterClock(IMidiSender midiSender,
                    TickGenerator tickGenerator) : base(tickGenerator)
 {
     this.midiSender = midiSender;
 }
예제 #13
0
 /// <summary>
 /// Initializes a new instance of the MasterClock class with the 
 /// specified MIDI sender and tick generator.
 /// </summary>
 /// <param name="midiSender">
 /// The MIDI sender used for sending system realtime messages.
 /// </param>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public MasterClock(IMidiSender midiSender, 
     TickGenerator tickGenerator)
     : base(tickGenerator)
 {
     this.midiSender = midiSender;
 }
예제 #14
0
 /// <summary>
 /// Initializes an instance of the SlaveClock class with the specified
 /// MIDI receiver, MIDI sender, and tick generator.
 /// </summary>
 /// <param name="midiReceiver">
 /// The MIDI receiver used for receiving MIDI messages from a master 
 /// device.
 /// </param>
 /// <param name="midiSender">
 /// The MIDI sender used for sending MIDI messages to slave devices.
 /// </param>
 /// <param name="tickGenerator">
 /// The tick generator the MIDI clock will control.
 /// </param>
 public SlaveClock(IMidiReceiver midiReceiver, IMidiSender midiSender, 
     TickGenerator tickGenerator)
     : base(midiSender, tickGenerator)
 {
     this.midiReceiver = midiReceiver;
 }