jazz-soft / JZZ-midi-SMF

Standard MIDI Files: read / write / play
MIT License
40 stars 5 forks source link

Need a way to detect beats #19

Open kjetilge opened 2 years ago

kjetilge commented 2 years ago

I'm trying to make a pattern player (a drum machine) and need a way to switch between patterns in a synchronized manner.

So It would be nice if there was an easy way to detect and act on beats while the player is playing. Something like:

player.on('quarterNote', () => {})

would probably do.

Something like player.on('tick', () => {}) might also be usefull, but perhaps to demanding ?

jazz-soft commented 2 years ago

Sounds like a great idea! Let me think how to do it...

jazz-soft commented 2 years ago

If you create the MIDI files yourself, you can insert some special MIDI message or a pseudo-event at the required timestamps, and then watch for that message while playing it back. If it is a generic MIDI file from an unknown source, the task would be more complicated and may require some AI methods.

kjetilge commented 2 years ago

You need quite a lot of og patterns to implement a drum machine for practical uses, and I know of no way to automate insertion of timestamps.

I'm planning on implementing in software the BeatBuddy drum machine for which all midi files (drum patterns) and samples needed for a full fledged version is available on their site in the form of Beatbuddy Manager found here: BeatBuddy Manager v 1.6.4.1.

Nothing like this exists as software anywhere which is VERY strange. Time to change this. 😃🚀