Posted: 28 Jan 2012, 13:12
im working on a patch that tries to detect audio input tempo. my goal is having seqs, randomizers, lfo ect made in usine.. beat synced to incoming audio, that will trig events to remote resolume via OSC.(ie changing video each bar, randomizing fxs each 2 beats, ect..)
So i worked on first part: exctract a valid tempo from input.
basically it splits in 3 bands, each one having a beat follower, then script computes tempo from detected pulses and choose the one that seems the best from the 3 bands (the more stable over time and within the tempo range). so far so good works nice.
so i pick this detected tempo result that controls for now usine master sync.
The thing is is working great, if i put a beat led out of master sync i see it flashs coherent with audio-in, but a remaining problem is i am not necesserally in phase, as with this technique i only apply tempo, no Resync/restart . I think i can't trigg some restart from audio in as there is no way to get an 'intelligent'/accurate pulse that detect that here or here is a bar/cycle start, and it would certainly restart usine on each beat, wich is something unwanted here, as i dlike to trig videos say from one beat to 8 bars.
So i got the right estimated tempo, but then i need to 'align' the 2 clocks.( the 2 clocks consists of 'beat pulse' out of audio in best band,
and the pulses out of usine master sync). i need to re-align master sync so it match audio in pulses. here it's becoming complex
for my brain. What i do for now is i trigger a counter when pulse1(audio) is coming, and stops when pulse2(usine sync) is coming. it gives me a drift value, and then i add extra tempo to nudge up usine tempo until detected drift is lower a threshold.
it basically works, but if let's say my beat was just slightly after, it will nudge up for quasi 1 beat length and will take a certain amount of time to realign, whereas i could have slighly nudged down in fact.
Not sure im clear enough, the idea would be to detect if the drift if usine beat is in lower part of the beat duration it would nudge down, if up it would nudge up. for now I fail to see how to patch/script that... any ideas? one other solution would be to convert the computed drift to a PPQ offset and directly apply it to usine sync but not sure i can, maybe i got to try a local sync system...
any clues ideas, suggests? in other words to sum-up it simpler: let's say you got 2 local syncs of same tempo but trigged at different time, and you got only the beat pulses out of each sync as info, (no PPq or timing info out of one), what would be the best way to force one to align the other by nudging up/down automatically?
So i worked on first part: exctract a valid tempo from input.
basically it splits in 3 bands, each one having a beat follower, then script computes tempo from detected pulses and choose the one that seems the best from the 3 bands (the more stable over time and within the tempo range). so far so good works nice.
so i pick this detected tempo result that controls for now usine master sync.
The thing is is working great, if i put a beat led out of master sync i see it flashs coherent with audio-in, but a remaining problem is i am not necesserally in phase, as with this technique i only apply tempo, no Resync/restart . I think i can't trigg some restart from audio in as there is no way to get an 'intelligent'/accurate pulse that detect that here or here is a bar/cycle start, and it would certainly restart usine on each beat, wich is something unwanted here, as i dlike to trig videos say from one beat to 8 bars.
So i got the right estimated tempo, but then i need to 'align' the 2 clocks.( the 2 clocks consists of 'beat pulse' out of audio in best band,
and the pulses out of usine master sync). i need to re-align master sync so it match audio in pulses. here it's becoming complex
for my brain. What i do for now is i trigger a counter when pulse1(audio) is coming, and stops when pulse2(usine sync) is coming. it gives me a drift value, and then i add extra tempo to nudge up usine tempo until detected drift is lower a threshold.
it basically works, but if let's say my beat was just slightly after, it will nudge up for quasi 1 beat length and will take a certain amount of time to realign, whereas i could have slighly nudged down in fact.
Not sure im clear enough, the idea would be to detect if the drift if usine beat is in lower part of the beat duration it would nudge down, if up it would nudge up. for now I fail to see how to patch/script that... any ideas? one other solution would be to convert the computed drift to a PPQ offset and directly apply it to usine sync but not sure i can, maybe i got to try a local sync system...
any clues ideas, suggests? in other words to sum-up it simpler: let's say you got 2 local syncs of same tempo but trigged at different time, and you got only the beat pulses out of each sync as info, (no PPq or timing info out of one), what would be the best way to force one to align the other by nudging up/down automatically?