delay > 480 ticks
Hello, delay stops working when setting a delaytime greater than 480 ticks. Is this a normal behavior?
Max 8.2.2 on macOS 12.2.1
thanks, Florent
I’ve got delays of up to 10 seconds in my current project and they work fine. Max 8.2.2 Windows 10.
thanks, this is strange I cannot get a delay longer than 500 ms
Am I being stupid and tired or is this a bug? Running Max 64 mac Rosetta
I've tried to reinstall Max, turn off Rosetta, still no delay longer than 480 ticks.
This computer has 64 GB of RAM so can't imagine it's a problem with the memory.
I've also used long delays without issue, but never used `ticks` before.
In testing with your patch, I wonder if it may have to do with the speed of the metro above it where you can't delay something longer than the rate that new bangs are coming in, with each subsequent bang "resetting" the delay. I changed the tempo to 2n as a quantize rate and it happily took longer tick times.
Thanks Rodrigo! you're right, it seems like delay resets itself as soon as a new bang comes in. I've never realized this. A double bang in delay's helpfile only outputs one bang.
on the contrary, pipe keeps a memory of its input, so in this case pipe works great
What I often do if I want to "hard update" a delay is to use [t i clear] so you clear the delayed signal before setting the new value. It won't help if you want to set it to a time larger than what you've set it to, but it will help for updating things and it working the "first time".
thanks! that sounds like good practice!
I have a sequence of irregular bangs (rhythms) that I want to delay by 1900 ticks (almost 4 beats) so my instinct told me to use delay, but in this case it seems like converting bangs into integer numbers and using pipe is the way to go
If that's the case you may want to look at using [rate~] and a global [phasor~] rather than metro as it would be tighter and you don't have to worry about scheduler-based things. It's also worth noting that [pipe] messes with the scheduler priority of the messages too, which in a larger/complex patch may cause other problems down the line.
Hi Florent. I've loaded your patch into my Max and done the following:
1) If I send single bangs into the delay, they come out with the expected delay time - I tested this up to 10 seconds (10000ms).
2) If I send multiple bangs that are spaced further apart than the delay time, they all pass through.
3) If I send multiple bangs that are at intervals shorter than the delay time then only the last one comes through.
4) Using the metro, the bangs stop coming through once the delay time exceeds the tempo of the metro. Once the metro is stopped the last bang comes through with the set delay time.
So this confirms that every bang going into the delay essentially resets its timer back to zero and if bangs arrive faster than the delay time the previous ones get lost. In fairness, it does say this in the reference documentation:
Delay - Output
bang received in the left inlet is delayed by the number of milliseconds specified by the right inlet, then is sent out the outlet. Only one bang at a time can be delayed by delay. If a bang is already in delay when a new bang is received in the left inlet, the first bang is forgotten.
Have you tried using pipe instead? If I replace the delay with pipe then it works as I think you are wanting, with every bang coming through with the required delay, irrespective of how long the delay is:
Pipe - Output
When a value is received in the pipe object's left inlet, it is delayed by the time specified, then sent out the left outlet. If there are middle inlets, the values in those inlets are also delayed and sent out their corresponding outlet, in response to a value is received in the left inlet. Unlike delay, more than one value at a time can be delayed in a pipe. When a new delay time is received in the right inlet, it does not affect when the values already being delayed by pipe will come out.
thanks, I am aware of all the fun stuff with Max's scheduler :) in this case, these are pretty small patches that run in Max For Live (Audio Interrupt) and the timing is pretty tight without fucking things up
@Andy, thanks! yes this confirms what I just noticed too. Yes, pipe works fine in this case!
It's handy to know these things! I'm still on the learning curve.
Hi fellows, you might want to try Scheme for Max for this too. Delay internally uses only one clock, which is why it gets reset on a new bang. While Scheme for Max creates a new clock on each delay call, allowing you to have as many as you want and cancel outstanding delays if you need to by hanging on to a reference to them, without any issues on priority. While theoretically making a new clock has more overhead, in practice it makes no noticeable difference (it's so much smaller than even the most basic of audio processing). I have also added convenience features like delay-tq, which takes a tick time for a delay and a time time for quantizing to.
Also, it is worth noting that the delay clocks and scheduler facilities actually are as accurate as phasor triggered events in current Max versions. It was, at one point, the case that metros were not as tight but that has not been true for some time, so long as you are in Overdrive with Audio in Interrupt. All messages will be quantized in the short term to the nearest temporal boundary of the scheduler run, but this is the case *anytime* you go to messages, whether triggered from audio or metros. You will always be waiting for the next scheduler pass to run any Max message, and if Audio is Interrupt, then this will be every signal vector samples. The metro clocks will stay accurate in the long term (ie, that quantization error does *not* accumulate). I tested this extensively while building Scheme for Max. It's easy to try: set your signal vector low, and record events off a metro. They will stay dead accurate to within one signal vector size jitter, which you will also get if you clock an event off the phasor.
FWIW, I use them in heavy sequencing patches in Live and if you ensure you trigger playback off plugsync (rather than the API, which runs in the low thread) it stays locked in perfectly with Ableton's own sequencers.
thanks Iain! trying Scheme for Max is definitely on my todo list!
Minor point, but whilst you were rapidly engaged in replying to other posts, I went back and edited my last post to include what's in the Max documentation. What you experienced with delay is an expected behaviour, not a bug of any kind.
thanks Andy! yeah I figured it was the expected behavior, I just never experienced this before
Yeah that's the single clock. I can't recall OTOH what pipe does. I *think* there can only be one pipe time argument a time, but I could be misremembering.
In Scheme for Max, I make a new clock attached to an id that becomes a key to hashtable in which the clocks are stored. When clocks fire, they execute their functions and get deleted. If you want to cancel a delay before it happens, that id can be used to cancel it. Details here in case that is of interest: https://iainctduncan.github.io/scheme-for-max-docs/api.html#scheduling-delays-timers
No, pipe can handle multiple timed messages and even tolerates the delay being changed for new events when it's holding older events in the queue. I'd like to take a look at scheme as well though.
@Iain, I've installed the S4M package and it all appears in the package manager, etc. However, when I launch the help file, I get errors to say that the s4m object isn't recognised and all the s4m objects in the help pages are disabled. Have I messed something up?
I'm using Max 8.2.2, Windows 10 and I've put the Scheme-For-Max folder in my Documents/Max 8/Packages folder.
TIA
Hi Andy, can you start a new thread and I can come help you there just to keep support out of this one? (post a link here and I'll pop over)
Thanks Iain
https://cycling74.com/forums/s4m-installation-problems