• jameslo

    @deframmentazione-geometrica +1 RE line, line~ as per @Jona & @whale-av, but if you're controlling the frequency of an oscillator or phasor with an audio signal, you can also just low pass filter the controlling signal to smooth out the transition.
    Screenshot 2020-10-18 175647.png portamento.pd

    posted in technical issues read more
  • jameslo

    @ingox Good stuff--it's cool when abstractions just take care of the dull bookkeeping for you. In a past life I used to do that kind of thing in Java/c# using static class variables.

    The slow motion instant replay approach turned out to be much easier than I anticipated, but I thought I'd post my code anyway to show why a busy wait, were it as simple as in Arduino, would have taken almost no time at all.

    Screenshot 2020-09-29 084506.png
    Screenshot 2020-09-29 084625.png quicksort hoare.pd

    Had I been able to replace that [send] with a 300 mS busy wait, I would have been done.

    Update: Ha ha, it looks like if the evaluation tree gets too deep you run out of Pd stack. Or I have a bug somewhere. This input data breaks the sort on my machine: quicksort stack overflow input.pd

    Update 2: the answer is here. The way I'm performing the outer loop in [pd partition] is bad. Replace it with [until] and it works. It also means that I should replace the quicksort recursion with iteration too--which in turn moots my entire topic because then the need for busy waits goes away. Never mind! quicksort hoare.pd

    Update 3: BS alert--I don't know why I thought the topic was mooted by having everything as iteration. It's not. [Never mind( -> [pow 2]

    posted in technical issues read more
  • jameslo

    @whale-av Yeah, I was thinking of something similar: snapshot the input data, run the algorithm at full speed, queue up the sequence of states, then play them back. That fits better into the Pd programming model. But it's interesting that it's not immediately obvious how to make a busy wait, if it's even possible at all.

    posted in technical issues read more
  • jameslo

    @whale-av Yeah...I have a recursive algorithm that relies on Pd's evaluation order, and it breaks when I replace [until] with [metro]. I know it's possible to factor that dependency out, but that's a whole redesign when I just wanted to slow things down enough so I could watch it step and get a feel for what it's doing. And yes, "spinning" is the other name for it.

    posted in technical issues read more
  • jameslo

    Is it possible to do a timed busy wait in Pd?

    Screenshot 2020-09-28 080926.png busyWait.pd

    This hangs my machine for a while, then sometimes reports nonsense like what's shown. Seems like [until] blocks everything else from running, including the UI and [delay]. I've tried alternating between some finite number of [until] iterations and the value test, but I get similar behavior.

    posted in technical issues read more
  • jameslo

    @Lou Give a look at [swap], I bet that solves your problem in the first patch. A more general solution for reordering is to use [trigger] and a bunch of variables like [f]. I'm assuming you'd have more fun figuring it out yourself, so that's why I'm being so vague. Post back if you just want the answer.

    posted in technical issues read more
  • jameslo

    @ddw_music I think you and I were posting on another topic when @alexandros suggested using [rzero_rev~ 0] to get the previous sample. Since many programmers seem to want to avoid [fexpr~] at all costs, maybe you could rewrite your [fexpr~] with [expr~ $v1 > $v2] and [rzero_rev~ 0]. But is that better?

    I like your [rpole~] phasor, that's clever. Here's another way to make a slave phasor, again not sure if it's better:
    Screenshot 2020-09-26 095612.png windowed-sync3.pd

    +1 RE the mystifying omissions and irregularities in vanilla. Since I started thinking of it as a scripting language (and stopped comparing it to c, c++, c#, Java...) everything became happy and easy-going. :)

    posted in technical issues read more
  • jameslo

    @60hz Sorry, but all I have for you are questions :(. Do you know beforehand the complete set of possible IDs? I'm assuming from your description and example that each ID may go in and out of range, so when you say you want the closest one, do you mean the closest one that's still in range? And I gather from your example that an ID is in-range when you've received an OSC message from it within the last 100 ms, is that right?

    posted in technical issues read more
  • jameslo

    @raynovich technically, yours is a polynomial function. It would be an exponential function if the input was used as the exponent of some constant, like {mtof].

    I've only used Hann windows in 2 circumstances: as an FFT windowing function, and for granular synthesis. In the FFT case, the Hann window allows you to overlap each window by a factor of 4 so there are no discontinuities in the inverse transform. In granular synthesis, I've noticed that the Hann window injects fewer harmonics of the looping frequency so that the tone of the wavetable comes through more. I think there's a mathematical explanation of how that works in that same Miller Puckette book.

    I'm sure there are other uses I don't know about, maybe someone more knowledgeable can chime in.

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!