Add a MixxxControl (ControlObject) that fires on each beat
Bug #604384 reported by
Sean M. Pappalardo
This bug affects 4 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mixxx |
Fix Released
|
Wishlist
|
vininim |
Bug Description
Some MIDI script authors would like to flash an LED (or do other things) in time with the beat of a particular deck. Please add a "[ChannelN],beat" ControlObject that changes to 1 only while immediately on a beat (and is 0 all other times.)
Bonus points if you can also add a beatClock or similar CO that fires at a rate of 24 (equally-spaced) ticks per beat (quarter-note,) so as to send a MIDI clock signal for synchronization with external instruments.
Related branches
tags: | added: easy weekend |
Changed in mixxx: | |
assignee: | nobody → vininim (vininim) |
Changed in mixxx: | |
milestone: | none → 1.10.0 |
Changed in mixxx: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Here's a workaround for now. Albert said:
"The beat ticks always start right at the start of the track, and you know the BPM, so based on the playback position and the BPM, you should be able to trigger something."
So you have duration in seconds, and doing 60/bpm = seconds per beat. So when (visual_ playposition * duration) modulus (60/bpm[/24 for MIDI clock pulses]) == 0, you're on a beat and should light your LED. Be sure to use engine. connectControl( ) to connect the "[ChannelN],rate" MixxxControl to a script function that stops & restarts the timer with the new BPM value (obtained with "[ChannelN],rate" x "[ChannelN],bpm",) so it's updated when the pitch control is moved.
This functionality should be added to the common script functions file so script writers don't need to worry about these gory details, but there's currently no way for a slot function to find out what group the changed MixxxControl was (it can't find out which deck fired the signal at the moment) so it's impossible to make a generic function set.