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

Move drum and guitar patterns into modular files #3

Open
cass-dlcm opened this issue Mar 22, 2021 · 1 comment
Open

Move drum and guitar patterns into modular files #3

cass-dlcm opened this issue Mar 22, 2021 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@cass-dlcm
Copy link
Owner

With my midi-gen-py project, I made it so that the patterns are stored in JSON files and are read in. This allows the user to define their own patterns easily. I wish to replicate that feature in this project.

@cass-dlcm cass-dlcm added the enhancement New feature or request label Mar 22, 2021
@cass-dlcm
Copy link
Owner Author

cass-dlcm commented Mar 27, 2021

Decided that they won't be stored in json, but instead in a simplified version of MIDI.

Details:

  • no track or file headers, just a file length indicator stored as a vlq and a ticks per measure stored as a vlq
  • only events are note on, note off, end of track, repeat segment
  • note events stored using the vlq for number of ticks, a byte to tell event type with channel, and pitch
  • velocity is not included as that's set by the program
  • pitches stored in guitar patterns are indices, while pitches stored in drum patterns are actual pitches
  • repeat segment events specify when the repeat starts, how long the repeat is in the file, and how many times to repeat
  • repeat format: TT (TT TT TT) 0C NN (NN NN NN) LL (LL LL LL)
  • TT (TT TT TT) is a vlq for the number of ticks from the previous event
  • 0C is the event indicator, c being the channel
  • NN (NN NN NN) is the number of repeats as a vlq
  • LL (LL LL LL) is the length in bytes as a vlq of the repeat segment
  • repeat segments can be nested

@cass-dlcm cass-dlcm self-assigned this Mar 27, 2021
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

No branches or pull requests

1 participant