Exemple #1
0
static void RT_scheduled_hold_pitch_do(struct SeqTrack *seqtrack,
                                       int64_t time,
                                       const struct SeqBlock *seqblock,
                                       const struct Tracks *track,
                                       const struct Notes *note,
                                       const struct Pitches *pitch1,
                                       bool doit
                                       )
{
  struct Patch *patch = track->patch;

  if (patch!=NULL && pitch1!=NULL && doit) {
    
    float val = pitch1->note;

#if DO_DEBUG
    printf("  Sending HOLD pitch %f at %d\n",val,(int)time);
#endif
    
    RT_PATCH_change_pitch(seqtrack,
                          patch,
                          create_note_t2(seqblock,note->id, val),
                          time
                          );
  }

  const struct Pitches *pitch2 = pitch1==NULL ? note->pitches : NextPitch(pitch1);
  if (pitch2 != NULL)
    RT_schedule_pitch(seqtrack, time, seqblock, track, note, pitch2, false);
}
Exemple #2
0
static int64_t RT_scheduled_glide_pitch(struct SeqTrack *seqtrack, int64_t time, union SuperType *args){
  const struct SeqBlock   *seqblock  = args[0].const_pointer;
  const struct Tracks     *track     = args[1].const_pointer;
  const struct Notes      *note      = args[2].pointer;
  const struct Pitches *pitch1 = args[3].pointer;
  int64_t                  time1     = args[4].int_num;
  int64_t                  time2     = args[5].int_num;
  bool                     doit      = args[6].bool_num;

  struct Patch *patch = track->patch;

  if (patch==NULL)
    return DONT_RESCHEDULE;

#if !defined(RELEASE)
  if (time < time1 || time>time2)
    RError("RT_scheduled_glide_pitch: time: %d, time1: %d, time2: %d", time, time1, time2);
#endif
  
  if (time < time1)
    time = time1;
  if (time > time2)
    time = time2;

  const struct Pitches *pitch2 = pitch1==NULL ? note->pitches : NextPitch(pitch1);

  if (doit) {
    float val1 = pitch1==NULL ? note->note      : pitch1->note;
    float val2 = pitch2==NULL ? note->pitch_end : pitch2->note;
    
    float val = time1==time2 ? val2 : scale(time, time1, time2, val1, val2); // We get divide by zero in scale() if time1==time2
    
#if DO_DEBUG
    printf("  Sending pitch %f at %d\n",val,(int)time);
#endif

    if (time==time1 || val1!=val2)
      RT_PATCH_change_pitch(seqtrack,
                            patch,
                            create_note_t2(seqblock,note->id, val),
                            time
                            );
  }
  
  if (time >= time2) {
    
    if (pitch2 != NULL)
      RT_schedule_pitch(seqtrack, time, seqblock, track, note, pitch2, true);
    
    return DONT_RESCHEDULE;
    
  } else {

    return R_MIN(time2, time + RADIUM_BLOCKSIZE);
    
  }
}
Exemple #3
0
static void scheduled_change_pitch(int64_t time, const union SuperType *args){
  const struct Tracks *track = args[0].const_pointer;
  const struct Notes  *note  = args[1].const_pointer;
  float          x     = args[2].float_num;

  RT_PATCH_change_pitch(track->patch,
                        note->note,
                        note->id,
                        x,
                        time
                        );
}
Exemple #4
0
static void scheduled_change_pitch(int64_t time, const union SuperType *args){
  const struct Tracks *track = args[0].const_pointer;
  const struct Notes  *note  = args[1].const_pointer;
  float          x     = args[2].float_num;

  //printf("Sending pitch change %f\n",x);

  RT_PATCH_change_pitch(track->patch,
                        create_note_t2(note->id,
                                       x),
                        time
                        );
}