Make current BPM a flash accesible variable...
Posted: Sat Mar 19, 2011 07:56
**Update:
I was able to (sort of) remedy this with some clever programming and the BPM sync function in the clips in resolume. I'm able to detect the amount of milliseconds for one quarter note at the current BPM with about a +/- 10ms differential. However this works about 99% of the time (not enough in my book), and unfortunately only updates every 4 bars, which causes issues when drastic bpm switches occur (ie, moving from 10bpm to 120bpm)...
It's also inefficient to waste computing power recalculating a variable that most certainly already exists in resolume... I've got a couple other ideas for the flash API, but I'm going to make them in a new post rather than bumping this one. Anyhow, read on:
**
So I've been bending my PHP knowledge into actionscript and I'm starting to get the hang of it, I've found the Resolume-Flash API very handy and easy to use, but one thing is grinding me...
I want the ability to sync to midi clock in actionscript, I know i can make an animation of a set duration and then use resolume's sync to bpm feature, but that is not the same and not nearly as dynamic...
I've made a swf that is straight actionscript (completely dynamic) and the only way i can sort of sync it to bpm is to input the bpm manually as dynamic text into a variable. I cannot begin to express how many degrees of lame this method touches upon when compared to my request.
If the current BPM was available to me as a variable i could do things like find how many milliseconds occur in a quarter note of the current bpm:
and have events in the swf occur in sync with a quarter or sixteenth note etc... If you guys were really intuitive, you would make the milliseconds of a whole note available as a separate variable...
I can't imagine this being too difficult given the current setup, please make this happen, I have so many ideas that could benefit from this (if not, I kindly demand a reason why).
I could beg some more, or further explain to you why this needs to occur, but you get the idea.
Puh-lease.
I was able to (sort of) remedy this with some clever programming and the BPM sync function in the clips in resolume. I'm able to detect the amount of milliseconds for one quarter note at the current BPM with about a +/- 10ms differential. However this works about 99% of the time (not enough in my book), and unfortunately only updates every 4 bars, which causes issues when drastic bpm switches occur (ie, moving from 10bpm to 120bpm)...
It's also inefficient to waste computing power recalculating a variable that most certainly already exists in resolume... I've got a couple other ideas for the flash API, but I'm going to make them in a new post rather than bumping this one. Anyhow, read on:
**
So I've been bending my PHP knowledge into actionscript and I'm starting to get the hang of it, I've found the Resolume-Flash API very handy and easy to use, but one thing is grinding me...
I want the ability to sync to midi clock in actionscript, I know i can make an animation of a set duration and then use resolume's sync to bpm feature, but that is not the same and not nearly as dynamic...
I've made a swf that is straight actionscript (completely dynamic) and the only way i can sort of sync it to bpm is to input the bpm manually as dynamic text into a variable. I cannot begin to express how many degrees of lame this method touches upon when compared to my request.
If the current BPM was available to me as a variable i could do things like find how many milliseconds occur in a quarter note of the current bpm:
Code: Select all
var bpm = 128; //this is where you come in!!!
var scan_interval = 4; //1 = whole note, 2 = half note, etc...
/*-----------------------------------------------------------------------
milliseconds = (240,000 * (delay / time)) / bpm
so to calculate 3/16ths of a bar for a 120bpm song, the calculation is
(240,000 * (3 / 16)) / 120)
-----------------------------------------------------------------------*/
var scan_time = (240000 * (1/scan_interval) / bpm);
I can't imagine this being too difficult given the current setup, please make this happen, I have so many ideas that could benefit from this (if not, I kindly demand a reason why).
I could beg some more, or further explain to you why this needs to occur, but you get the idea.
Puh-lease.