check_times: check_times

View source: R/tabraux.R

check_timesR Documentation

check_times

Description

For a character string with the timing information for one or more measures the total time is calculated in units of steps. See Details for the timing information that is recognized.

Usage

check_times(times, steps = 8)

Arguments

times

Character string with tabr timing information for one or more measures. The separation of measures is done with the '|' character. Note that this is not recognized by tabr. Use the times element of the result of this function as timing information in tabr

steps

Integer indicating the unit that the total time is reported in. E.g. 4 when the time is measured in quarter notes.

Value

Named list with in the first element times the time information without the '|' character and in the second element counts the number of units in each measure.

Details

The following information is recognized:

  • an integer number like 1, 2, 4, 8, 16, 32

  • such a number with one or two dots

  • such a number with a replication factor like '*2', '*3' etc

Examples

## Not run: 
x= check_times(" 2. | 8*3 16*4 8|8*6| 8*3 16*4 8",8)
identical(x$times,"2. 8*3 16*4 8 8*6 8*3 16*4 8")
# [1] TRUE
identical(x$counts,rep(6,4))
# [1] TRUE

## End(Not run)

HanOostdijk/tabraux documentation built on Nov. 17, 2022, 3:02 a.m.