void List_InsertPlaceLen3( struct Blocks *block, void *to, struct ListHeader3 *l, float place, float toplace, void (*Insert_PlaceLen_extra)(struct Blocks *block,void *to,struct ListHeader3 *l,float place,float toplace) ){ while(l!=NULL){ struct ListHeader3 *next = l->next; if(Insert_PlaceLen_extra!=NULL){ (*Insert_PlaceLen_extra)(block,to,l,place,toplace); } if(GetfloatFromPlacement(&l->p)>=place){ if(GetfloatFromPlacement(&l->p)<place-toplace){ ListRemoveElement3(to,l); }else{ PlaceAddfloat(&l->p,toplace); if( ! PlaceLegal(block,&l->p)){ ListRemoveElement3(to,l); } } } l = next; } }
void CutNoteAt(struct Blocks *block, struct Tracks *track,struct Notes *note, Place *place){ R_ASSERT(PLAYER_current_thread_has_lock() || is_playing()==false); if (PlaceGreaterOrEqual(place, ¬e->end)){ RError("Illegal argument for CutNoteAt 1. %f >= %f\n",GetfloatFromPlacement(place),GetfloatFromPlacement(¬e->end)); return; } if (PlaceLessOrEqual(place, ¬e->l.p)){ RError("Illegal argument for CutNoteAt 2. %f <= %f\n",GetfloatFromPlacement(place),GetfloatFromPlacement(¬e->l.p)); return; } CutListAt(¬e->velocities,place); CutListAt(¬e->pitches,place); PlaceCopy(¬e->end,place); }
static void Glissando( struct WBlocks *wblock, struct WTracks *wtrack, struct Notes *note1 ){ // struct Notes *note; struct Notes *note2=NextNote(note1); float f1,f,f2; Place p; int notenote; int notediff; if(note2==NULL) return; notediff=R_ABS(note2->note-note1->note); if(notediff==0 || notediff==1) return; f1=GetfloatFromPlacement(¬e1->l.p); f2=GetfloatFromPlacement(¬e2->l.p); bool up = note2->note > note1->note; for(notenote=note1->note;;){ if (up) notenote++; else notenote--; if (up){ if (notenote>=note2->note) break; } else { if (notenote<=note2->note) break; } f=f1+( R_ABS(note1->note-notenote)*(f2-f1) / notediff ); if (f<0) f=0; if (f>=wblock->block->num_lines) break; Float2Placement(f,&p); InsertNote( wblock, wtrack, &p,NULL, notenote, (int)(note1->velocity+( ((f-f1)*(note2->velocity-note1->velocity))/(f2-f1) )), false ); } }