SSPData

Superclass:
NSObject
Declared In:

Introduction

The play data information about the score required for playing it

Discussion

This can be used to drive a synthesizer (supplied for OS X and iOS only) or to generate a MIDI file using createMidiFile:



Methods

-clearLoop

clear any loop setup by setLoopStart: loopBackBar: numRepeats:

-createMidiFile:

create a MIDI file from this play data with the given full pathname

+createPlayDataFromScore:

create and return the SSPData play data

+createPlayDataFromScore:tempo:

create and return the SSPData play data

+createPlayDataFromScore:tempo:withTiming:

create and return the SSPData play data for synchronising to a defined array of beat timings

+createSingleBarPlayData:

create and return the SSPData play data for a single bar and single part only

+createSingleBarPlayData:part:bar:tempo:

create and return the SSPData play data for a single bar and single part only

+createSingleChordPlayData:

create and return the SSPData play data for a single note or chord in the score

+createSingleChordPlayData:part:bar:note:

create and return the SSPData play data for a single note or chord in the score

-scaleTempoMidiFile

write a new tempo value to the MIDI file so it will play at a different speed

-scaleTempoMidiFile:scaling:

write a new tempo value to the MIDI file so it will play at a different speed

-seqIndexForBar

from the current sequence index return the sequence index for the nearest instance of a bar with index barIndex If there are no repeats barIndex = seqIndex for all bars so this returns barIndex

-seqIndexForBar:from:

from the current sequence index return the sequence index for the nearest instance of a bar with index barIndex If there are no repeats barIndex = seqIndex for all bars so this returns barIndex

-setLoopStart:loopBackBar:numRepeats:

create a play loop between 2 bar indexes


clearLoop


clear any loop setup by setLoopStart: loopBackBar: numRepeats:

-(void)clearLoop; 

createMidiFile:


create a MIDI file from this play data with the given full pathname

-(enum sscore_error)createMidiFile:(NSString*)filePath; 
Return Value

any error


createPlayDataFromScore:


create and return the SSPData play data

+(SSPData*)createPlayDataFromScore:(SSScore*)score tempo:(id<SSUTempo>)tempo; 
Parameters
score

the SSScore

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

Return Value

the SSPData

See Also


createPlayDataFromScore:tempo:


create and return the SSPData play data

+(SSPData*)createPlayDataFromScore:(SSScore*)score tempo:(id<SSUTempo>)tempo; 
Parameters
score

the SSScore

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

See Also


createPlayDataFromScore:tempo:withTiming:


create and return the SSPData play data for synchronising to a defined array of beat timings

+(SSPData*)createPlayDataFromScore:(SSScore*)score tempo:(id<SSUTempo>)tempo 
        withTiming:(SSPDSyncTiming*)syncTiming; 
Parameters
score

the SSScore

tempo

the tempo controller

syncTiming

must have size = the number of bars to play

Return Value

the SSPData


createSingleBarPlayData:


create and return the SSPData play data for a single bar and single part only

+(SSPData*)createSingleBarPlayData:(SSScore*)score part:(int)partIndex 
        bar:(int)barIndex tempo:(id<SSUTempo>)tempo; 
Parameters
score

the SSScore

partIndex

the part index

barIndex

the bar index

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

Return Value

the SSPData

See Also


createSingleBarPlayData:part:bar:tempo:


create and return the SSPData play data for a single bar and single part only

+(SSPData*)createSingleBarPlayData:(SSScore*)score part:(int)partIndex 
        bar:(int)barIndex tempo:(id<SSUTempo>)tempo; 
Parameters
score

the SSScore

partIndex

the part index

barIndex

the bar index

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

See Also


createSingleChordPlayData:


create and return the SSPData play data for a single note or chord in the score

+(SSPData*)createSingleChordPlayData:(SSScore*)score part:(int)partIndex 
        bar:(int)barIndex note:(sscore_item_handle)noteId; 
Parameters
score

the SSScore

partIndex

the part index

barIndex

the bar index

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

Return Value

the SSPData

See Also


createSingleChordPlayData:part:bar:note:


create and return the SSPData play data for a single note or chord in the score

+(SSPData*)createSingleChordPlayData:(SSScore*)score part:(int)partIndex 
        bar:(int)barIndex note:(sscore_item_handle)noteId; 
Parameters
score

the SSScore

partIndex

the part index

barIndex

the bar index

tempo

an object implementing the SSUTempo protocol allowing the user to set the tempo while playing.

See Also


scaleTempoMidiFile


write a new tempo value to the MIDI file so it will play at a different speed

-(void)scaleTempoMidiFile:(NSString*)filePath scaling:(float)tempoScaling; 

See Also


scaleTempoMidiFile:scaling:


write a new tempo value to the MIDI file so it will play at a different speed

-(void)scaleTempoMidiFile:(NSString*)filePath scaling:(float)tempoScaling; 

See Also


seqIndexForBar


from the current sequence index return the sequence index for the nearest instance of a bar with index barIndex If there are no repeats barIndex = seqIndex for all bars so this returns barIndex

-(int)seqIndexForBar:(int)barIndex from:(int)seqIndex; 
Parameters
barIndex

the bar index

seqIndex

the current sequence index

Return Value

the bar sequence index

See Also


seqIndexForBar:from:


from the current sequence index return the sequence index for the nearest instance of a bar with index barIndex If there are no repeats barIndex = seqIndex for all bars so this returns barIndex

-(int)seqIndexForBar:(int)barIndex from:(int)seqIndex; 
Parameters
barIndex

the bar index

seqIndex

the current sequence index

See Also


setLoopStart:loopBackBar:numRepeats:


create a play loop between 2 bar indexes

-(void)setLoopStart:(int)startLoopBarIndex loopBackBar:(int)loopBackBarIndex 
        numRepeats:(int)numRepeats; 
Parameters
startLoopBarIndex

the index of the first bar in the loop

loopBackBarIndex

the index of the last bar in the loop

numRepeats

the number of repeats (max 10)

Discussion

licence playloop_capable is required to use this function


Properties

bars

an array of SSPDBar

hasFirstBarAnacrusis

true if the first bar does not contain the full number of beats

loopBack

if this is set we play in an infinite loop over the bars array

maxDynamic

the maximum dynamic value on any note in the score

numParts

the number of parts in the score

rawplaydata

the C play data

title

the title of the score


bars


an array of SSPDBar

@property (readonly) NSArray<SSPDBar*> *bars; 

hasFirstBarAnacrusis


true if the first bar does not contain the full number of beats

@property (readonly) bool hasFirstBarAnacrusis; 

loopBack


if this is set we play in an infinite loop over the bars array

@property (readonly) bool loopBack; 

maxDynamic


the maximum dynamic value on any note in the score

@property (readonly) float maxDynamic; 

numParts


the number of parts in the score

@property (readonly) int numParts; 

rawplaydata


the C play data

@property (readonly) const sscore_playdata *rawplaydata; 

title


the title of the score

@property (readonly) NSString *title;