simply quantize sfplay start time

brendan mccloskey's icon

Hi
I've looked at the Timing tutorials, various helpfiles etc and cannot find a solution so I'm asking here. I suspect this is quite simple. I am using sfplay to playback several 2sec 120bpm loops, and I am trying to quantize subsequent loops based on a "clock" from loop#1 : I'm using the [position-outlet] -> [%~ 500] -> [delta~] -> [

Thanks

Brendan

askTheTeam.zip
zip
brendan mccloskey's icon

yeah, I might have sussed this; use a global transport and sync ALL triggers (using delay 4n), including loop #1 to the main pulse.

Any more elegant/economical solutions still welcome tho'

Brendan

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

This simple patch (metro, transport and one delay) doesn't work as expected:

What have I missed?

Christopher Dobrian's icon

I'm not sure what the role of the delay object is in your scheme. Given that you already know that your sound files are 2 seconds long at a tempo of 120 bpm, I'd just use transport as the clock, and trigger the sound files when you want 'em. I suggest also to make sure that the metro you're using to trigger things is quantized to the beat or the downbeat or whatever interval you use. [See attached example.]

syncsoundfiles.zip
zip
brendan mccloskey's icon

Thanks for the reply Chris - are those your own boomchix? smileyFace - I omitted to mention that all loops are triggered via user input (noteOn), and that the [delay] is there to quantize 'erroneous' or non-quarter note incoming triggers onto the main pulse (my performers have physical disabilities, hence our preference for Ableton Live-type quantization of user input). I haven't yet dissected your patch so the solution may lie therein; @quantize or something. . .

Best regards
Brendan

Christopher Dobrian's icon

In that case, you probably want something along the lines of "delay 0.0.0 @quantize 1n" (or 4n).

The downside of that, of course, is that if a user triggers an event even so much as a tick late, the event will get delayed until the next downbeat (or beat).

Depending on what you're trying to achieve, it might work better to measure exactly where in the beat the trigger occurred (using the units output of transport), and if it's less than half a beat late (i.e., less than 240 units) you could play the sound immediately but start it that amount of time into the sound (by converting ticks to ms) using the offset message. Or you could increase the rate by the right proportion so that it speeds up just enough to compensate for the lateness of the trigger (but of course that would cause a commensurate change in pitch).

brendan mccloskey's icon

Wow, I don't s'pose you're free for some work Chris jk? I like your explanation of how to extend this into more precise events, but the nature of the piece is such that waiting for the next half or quarter note is ok, metrically (it's a simple Reich-esque layering technique). Thanks a lot. I don't suppose you have time to code a metro/delay object that can see into the future and predict intention ; -)

Brendan

broc's icon

So you can simply use [delay 4n @quantize 4n].

brendan mccloskey's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Thanks guys, that's solved it:

Brendan

Max Gardener's icon

...sorry to come a bit late to the party, Brendan - but yeah - what Chris said. :-)

And may fortune shine upon you for your willingness to turn your talents to the service of the differently abled. Just sayin'.

brendan mccloskey's icon

Thanks for the props and good vibes Max, I've been using Max (and Arduino/Processing) with disabled musicians for about 15 years. Even did a PhD in it :)

All this new-fangled tech needs to be put to *ahem* 'better' use. Just sayin'.

brendan mccloskey's icon

FWIW:

the ensemble I work with has resurrected on old performance piece, which has a strictly loop-based layered structure. Nowadays we try not to rely on 4/4 120bpm here's your cue, hit it NOW. For the obvious reasons. But it's an old favourite. I haven't actually solved this btw. All the answers are here (above), I just need to ensure that each loop can only be triggered on the minim/half beat, maybe using ticks, and [timepoint].

Brendan