Contents page

Rules for Tools/timetomeasure()


timetomeasure()
SYNOPSIS
     long timetomeasure(struct Clip *clip,long time)

ARGUMENTS
    `struct Clip  *clip'
          Clip for conversion.

    `long time'
          Time in clock ticks.

DESCRIPTION
     `timetomeasure()' translates from raw clock ticks (time) into a
     measure number.  Because different Tracks can have different time
     signatures, the conversion is dependent on a specific time
     signature, as defined by clip (each Track has a Clip.)  If you'd
     rather use the master Song Parameters time signature, set clip to
     0.

     Using `timetomeasure()' and its partner, `measuretotime', to
     perform time operations based on measures, rather than clocks.  For
     example, to move a Note Event to the start of the next measure:

              struct NoteEvent  *note;
    int measure;
    measure = (*functions->timetomeasure)(0,note->time);
    measure++;
    note->time = (*functions->measuretotime)(0,measure);

SEE
     See measuretotime().