Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Advanced Transitions with MIDI files (v0.3.0 milestone) #31

Merged
merged 9 commits into from
May 28, 2024

Conversation

piotrmacha
Copy link
Member

@piotrmacha piotrmacha commented May 26, 2024

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:

  • A4 (69): Marks a period when transition can happen and the duration of volume fade-out for current theme. By default, the next theme is fading-in during the same period.
  • A#4 (70): Optional, marks a different fade-in period for the next song. Must be defined with start time <= A4 end time.

Done

  • MidiFile class with a parser of node ranges
  • MidiFile parser supports tempo changes within single audio theme
  • Refactor to move the music scheduling code directly to the MusicTheme, 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. The Channel object became just a command processor exposing an API for the MusicTheme to control playback and effects.
  • Add new Daedalus classes to define zBassMusic-specific themes with additional fields like the MIDI file.
  • Implement a transitions based on data from MIDI
  • Add Daedalus externals to set up transitions programmatically
  • Update docs to include how to create a theme using new Daedalus classes
  • Update docs and include the specification for expected MIDI files and a guide on how to create them

@piotrmacha piotrmacha added the enhancement New feature or request label May 26, 2024
@piotrmacha piotrmacha added this to the Advanced Transitions milestone May 26, 2024
@piotrmacha piotrmacha changed the title feature: MIDI files for transitions control feature: Advanced Transitions with MIDI files May 28, 2024
@piotrmacha piotrmacha changed the title feature: Advanced Transitions with MIDI files feature: Advanced Transitions with MIDI files (v0.3.0 milestone) May 28, 2024
@piotrmacha piotrmacha marked this pull request as ready for review May 28, 2024 20:22
@piotrmacha piotrmacha merged commit 1d76bdc into main May 28, 2024
3 checks passed
@piotrmacha piotrmacha deleted the feature/midi branch May 29, 2024 13:36
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant