-
lacuna
Updated the patches:
Fixed 2 bugs:
Whole array size as default output.
Now also works if array-size changed.And cleaned up messy counter.
Added array-sort example to helpfile, changed thread title.
@ddw_music This was also my second try, giving up the first. And my thoughts where similar, especially if LUA would be handy here? I did not care too much about speed as I don't need this for realtime. Anyway an object written in C would be faster.
(This array-sort is much faster than [list-abs/list-sort], did not try [text]sort.)
Still I don't understand your idea of building a list without rescanning the array or list for each peak? But don't worry if you are done with it ... If I only had known how much time I spend with this .... -
lacuna
@ddw_music Oh! Thank you! Yes, a minimal change in loading the 4th argument caused the bug! Moses! I might not have tested before uploading... blushing!!! Now I reuploaded it. Thank you
And this is quite slow... it is actually very slow. Wondering about a different approach. -
lacuna
Vanilla abstraction, made with [array-max] and [array-min] by nulling found peak and run again.
array-maxx.pd
array-maxx-help.pd
array-minn.pd -
lacuna
@porres read the first 3 or 5 posts of this thread and you will understand.
vsnapshot~ seems to return some arbitary? value.(And we are trying to restore the 'internal double precision state of phasor~' from the outside in single precision. It turned out that this thread is not about block-boundaries, sample-accuracy ect. )
-
lacuna
@jameslo said:
count the number of blocks from when dsp gets turned on, and then run a fresh phasor in fast forward that same amount of time to get back to that state.
This might be the closest we can get.
The patch may not exeed the total running time (all fast-forwards added up) of 32 bit space .And ugly ....
(For DAW <> Pd I will open another thread some day when I am at it again. )
(forget ppphasor~ ...)
@porres vsnapshot~ is off
vsnapshot~isoff.pd
-
lacuna
Thinking about [text sequence]... timing would not be double-accurate, so this might not work. Only rec/play the phaser as signal~ should work.
@FFW stop=frequency=0Hz State saving with cloned phasors~ running in parallel
-
lacuna
And single precision is not enough for you?
Do you know what is not working in Pd64?
Did you think about other ways, like rec/playback?Repeatability and linear recording/playback is the missing piece in Pd for me. I'd like to add a full blown time-line: Seamlessly connect Pd with a DAW.
You could record all patch-inputs/interaction (GUIs, ADC, HIDs) and skip to the time where you want to repeat.
I once tested this quickly with [text sequence] and sth. I don't remember now, (must have been some (IEM guts????) (send/receive canvas?????) external that sends/receives everything happening in a patch or canvas (might have been everything happening in the parent patch, as I have build a rec/playback external))... and that worked, but don't know about the precision of this. I think we can not get more than single precision in standard-pd. Here time would be single precision. But yes, everything is spooled (maybe not accurately): You can use [;pd fast-forward(. Recordings have not been editable ... so I'd prefer a DAW. But for what you are trying to do, it might be a work-around?
-
lacuna
@jameslo Also maybe this helps? https://forum.pdpatchrepo.info/topic/10192/vphasor-and-vphasor2-subsample-accurate-phasors @Maelstorm
-
lacuna
@jameslo I think all your assumptions are correct.
I'm just using it as an oscillator/LFO. Are you suggesting that there's a way to build an oscillator with [rpole~] that is as frequency-accurate as [phasor~] but without the single vs double precision issue?
No, as far as I understood:
Phasor~ is frequency-accurate, while compromising on the absolute y-value: Jitter in amplitude as little trade-off (which multiplied can become big).On the contrary to a rpole~ramp, which is accurate in amplitude and accurately reproduces 'one-shots' sample-by-sample, but therefor must jitter in frequency when oscillating.
And I assumed wrong, maybe the correct amplitude would be most important for your application.
(The term phase of a ramp can be seen as amplitude or time.)
So I mentioned rpole~ solution.the best it can do (without having to predict the future) is to return the last sample of the previous audio block.
Yes, you are right. Not a bug.
But it is not [phasor~] being slow (that is what I have been reading in your first post), it is [snapshot~] being one sample late.Anyway, this thread is helpful for me, as I am slowly working on a state-saving-thing, and have not been aware of the 1-sample difference. Thank you.