The MusicChpip is a sequencer for playing back ISoundData. It keeps track of playback time and moves through TrackData playing each beat based on the supplied note frequency. Loop = one set of 32 beats in X number of tracks. Stored in SongData class. Song = Collection of loops for continuous playback. Think 'play list".
The active song's data that was loaded into memory.
Total number of Loop stored in the music chip. There is a maximum of 96 loops.
void Configure ( )
This method sets up the sequencer and all of its values.
void LoadSong ( Int id )
Loads a song into memory. This needs to be called before trying to play back a song or it will fail.
void OnBeat ( )
Run when a beat in song occurs: time for more sounds
void PauseSong ( )
Toggles the current playback state of the sequencer. If the song is playing it will pause, if it is paused it will play
void PlaySong ( Boolean loop )
Plays back a song and allows you to pass in a value to loop the song or have it stop when it reaches the end.
void PlaySongs ( Int ids, Boolean loop )
Allows you to string songs together into longer ones. Each ID will be played in order and you can also have the entire set loop.
void RewindSong ( )
Rewinds the sequencer to the beginning of the currently loaded song.
void StopSong ( )
Stops the sequencer.
void Update ( Single timeDelta )
Updates the sequencer if it is in playback mode. This will move the play head to the next beat and play that note.