]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/midi-walker.cc
doc string nits.
[lilypond.git] / lily / midi-walker.cc
index a5fc048aa4341cc521aaa3385999e8b2c99be011..c2aaa085b14d5ee5eab73e2f722524db7f535d2e 100644 (file)
@@ -33,8 +33,10 @@ compare (Midi_note_event const &left, Midi_note_event const &right)
     return 0;
 }
 
-Midi_walker::Midi_walker (Audio_staff *audio_staff, Midi_track *track)
+Midi_walker::Midi_walker (Audio_staff *audio_staff, Midi_track *track,
+                         int channel)
 {
+  channel_ = channel;
   track_ = track;
   index_ = 0;
   items_ = &audio_staff->audio_items_;
@@ -58,10 +60,10 @@ Midi_walker::do_start_note (Midi_note *note)
   Moment stop_mom = note->get_length () + ptr->audio_column_->at_mom ();
 
   bool play_start = true;
-  for (int i = 0; i < stop_note_queue.size (); i++)
+  for (vsize i = 0; i < stop_note_queue.size (); i++)
     {
       /* if this pith already in queue */
-      if (stop_note_queue[i].val->get_pitch () == note->get_pitch ())
+      if (stop_note_queue[i].val->get_semitone_pitch () == note->get_semitone_pitch ())
        {
          if (stop_note_queue[i].key < stop_mom)
            {
@@ -144,7 +146,9 @@ Midi_walker::process ()
 
   if (Midi_item *midi = Midi_item::get_midi (audio))
     {
-      midi->channel_ = track_->channel_;
+      if (Midi_channel_item *mci = dynamic_cast<Midi_channel_item*> (midi))
+       mci->channel_ = channel_;
+      
       //midi->channel_ = track_->number_;
       if (Midi_note *note = dynamic_cast<Midi_note *> (midi))
        {