Example #1
0
static void Scroll_play_down3(
                      struct WBlocks *wblock,
                      const Place *p1,
                      const Place *p2
){
  struct Tracks *track = wblock->block->tracks;

  while(track != NULL){
    struct Patch *patch=track->patch;
    if (patch != NULL){
      struct Notes *note = track->notes;
      while(note != NULL){
        if (PlaceIsBetween2(&note->l.p, p1, p2))
          PATCH_play_note(patch, note->note, note->id, VELOCITY_get(note->velocity), TRACK_get_pan(track));
        
        if (PlaceIsBetween2(&note->end, p1, p2))
          PATCH_stop_note(patch, note->note, note->id);
        
        note = NextNote(note);
      }
    }
    
    track = NextTrack(track);
  }
}
Example #2
0
static void Scroll_play_down3(
                      struct WBlocks *wblock,
                      const Place *p1,
                      const Place *p2
){
  struct Tracks *track = wblock->block->tracks;

  while(track != NULL){
    
    if (track->onoff==1){
      
      struct Patch *patch=track->patch;
      
      if (patch != NULL){
        
        struct Notes *note = track->notes;
        
        while(note != NULL){
          if (PlaceIsBetween2(&note->l.p, p1, p2))
            PATCH_play_note(patch, 
                            create_note_t(NULL,
                                          note->id,
                                          note->note,
                                          VELOCITY_get(note->velocity),
                                          TRACK_get_pan(track),
                                          ATOMIC_GET(track->midi_channel),
                                          0)
                            );
          
          if (PlaceIsBetween2(&note->end, p1, p2))
            PATCH_stop_note(patch,
                            create_note_t(NULL,
                                          note->id,
                                          note->note,
                                          0,
                                          TRACK_get_pan(track),
                                          ATOMIC_GET(track->midi_channel),
                                          0
                                          )
                            );
          
          note = NextNote(note);
        }
      }
    }
    
    track = NextTrack(track);
  }
}