ReceiveMidiEvents() public static method

public static ReceiveMidiEvents ( List events ) : void
events List
return void
Example #1
0
 void LateUpdate()
 {
     if (sequencers != null)
     {
         foreach (MidiTrackSequencer seq in sequencers)
         {
             if (seq.Playing)
             {
                 VJMidiInput.ReceiveMidiEvents(seq.Advance(Time.deltaTime));
             }
         }
         Component[] cs = GetComponents <AudioSource> ();
         if (cs != null)
         {
             foreach (Component c in cs)
             {
                 AudioSource a = c as AudioSource;
                 a.volume   = volume;
                 _isPlaying = a.isPlaying;
             }
         }
     }
 }
Example #2
0
    void ResetAndPlay()
    {
        Component[] cs = GetComponents <AudioSource> ();
        foreach (Component c in cs)
        {
            AudioSource a = c as AudioSource;
            a.time = startTime;
            a.Play();
        }

        foreach (MidiFileContainer song in songs)
        {
            for (int i = 0; i < song.tracks.Count; ++i)
            {
                MidiTrackSequencer s = new MidiTrackSequencer(song.tracks [i], song.division, bpm);
                List <MidiEvent>   e = s.Start(startTime);
                if (receiveStartEvent)
                {
                    VJMidiInput.ReceiveMidiEvents(e);
                }
                sequencers.Add(s);
            }
        }
    }