Пример #1
0
 public MidiEventsTimeline(string eventName, MidiTimeSignature ts)
 {
     this.eventName = eventName;
     this.time      = ts.time.midi;
     this.note      = null;
     this.pb        = null;
     this.ts        = ts;
     this.midiTime  = ts.time;
 }
Пример #2
0
 public MidiEventsTimeline(string eventName, MidiNote note)
 {
     this.eventName = eventName;
     this.time      = note.time.midi;
     this.note      = note;
     this.pb        = null;
     this.ts        = null;
     this.midiTime  = note.time;
 }
Пример #3
0
 public MidiEventsTimeline(string eventName, MidiPitchBend pb)
 {
     this.eventName = eventName;
     this.time      = pb.time.midi;
     this.note      = null;
     this.pb        = pb;
     this.ts        = null;
     this.midiTime  = pb.time;
 }
Пример #4
0
 private void parseNotes(IEnumerable <Note> noteList, TempoMap tempoMap)
 {
     foreach (var note in noteList)
     {
         int nr = Int32.Parse(note.Channel.ToString());
         if (nr == instrument.channel)
         {
             string   name        = note.NoteName.ToString();
             int      octave      = note.Octave;
             MidiTime time        = new MidiTime(note.Time, tempoMap);
             MidiTime length      = new MidiTime(note.Length, tempoMap);
             int      velocity    = Int32.Parse(note.Velocity.ToString());
             int      velocityOff = Int32.Parse(note.OffVelocity.ToString());
             int      noteNr      = Int32.Parse(note.NoteNumber.ToString());
             MidiNote midiNote    = new MidiNote(name, octave, time, length, velocity, velocityOff, noteNr);
             this.notes.Add(midiNote);
         }
     }
 }