feature: Advanced Transitions with MIDI files (v0.3.0 milestone) #31
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Development in progress.
Goal
Implement a transition between themes based on a specifically crafted MIDI file. The MIDI file matches the theme's audio duration and tempo, and defines special note ranges (MIDI_EVENT_NOTE, press + release) for periods when a transition should be scheduled. Current scope limits the metadata to a simple cross-fade transition, with 2 possible metadata notes:
Done
MidiFile
class with a parser of node rangesMidiFile
parser supports tempo changes within single audio themeMusicTheme
, which responds to 3 possible events from the outside world (PlayInstant
— when no other music is playing;ScheduleAfter
— when other music is playing,StopInstant
— usually called by the next scheduled song to stop the current), and then submits commands or acquires a channel to execute methods on it. TheChannel
object became just a command processor exposing an API for theMusicTheme
to control playback and effects.