MusicSequenceSetSequenceType

Function MusicSequenceSetSequenceType 

Source
pub unsafe extern "C-unwind" fn MusicSequenceSetSequenceType(
    in_sequence: MusicSequence,
    in_type: MusicSequenceType,
) -> i32
Available on crate feature MusicPlayer only.
Expand description

Set the sequence type (the default is beats)

These two calls allow you to get and set a MusicSequence type; specifying kMusicSequenceType_Beats = ‘beat’, kMusicSequenceType_Seconds = ‘secs’, kMusicSequenceType_Samples = ‘samp’

The sequence type can be set to beats at any time. The sequence type can only be set to seconds or samples if there are NO tempo events already in the sequence.

For beats - it can have as many tempo events as you want For Samples and Seconds - you should add a single tempo event after setting the type Samples - the tempo is the desired sample rate - e.g. 44100 and each “beat” in the sequence will be interpreted as a sample count at that sample rate (so beat == 44100 is a second) Seconds - the tempo should be set to 60 - a beat is a second.

Beats is the default (and is the behaviour on pre 10.5 systems)

A meta event of interest for Seconds based MIDI files is the SMPTE Offset meta event - stored in the tempo track. The sequence doesn’t do anything with this event (except store/write it)

Parameter inSequence: the sequence

Parameter inType: the sequence type

§Safety

in_sequence must be a valid pointer.