• jameslo

    @Blaine24 Look into @alexandros's library for Arduino-Pd com examples (which I think is https://github.com/alexdrymonitis/Arduino_Pd but I'm hoping @alexandros will correct me if I'm wrong), or you could try my way https://forum.pdpatchrepo.info/topic/13086/arduino-to-pd-vanilla/8. In that example I send "list <float> <float>;" but in your case you want to send "list PAD# <float>;" Observe the space separators--they're significant!

    That first select is looking for the end-of-line (EOL) character (the thing appended by Serial.println()), otherwise it's queueing up the characters in the order that the Arduino sends them. When EOL is seen, it parses the list of characters into a Pd list, e.g. "PAD4 42", which you can then route as you did in your example code, although I don't understand what you're doing with the output of [route]. In my way, each of the [route] outputs (except the last one) should just pass the value for each pad.

    Edit: I ran a test and it looks like you don't need the list prefix.

    posted in technical issues read more
  • jameslo

    @oid said:

    Calculating the value of the resistor is simple

    Yes, but you neglected to give the OP the formula, which is a little harder to figure out :). It's approx 0.13 of the value of the potentiometer. So for a 10k audio taper pot you want a 1.3k resistor. And for the record, it increases the load that the pot presents to the power rails by a factor of 10 when it's fully counter-clockwise.

    To me, both solutions are just linear-ish, You can find a discussion of it here: https://www.modwiggler.com/forum/viewtopic.php?t=56318. You can see that they discuss 0.12 so 0.13 is not exact, even more so since the audio taper pot isn't exactly log. I'm not claiming that linear pots are perfect, but if it were me I'd just go buy the right pots and chalk up the extra expense as tuition. Unless there was a show breathing down my neck.

    posted in technical issues read more
  • jameslo

    @callummalcolm In my experience, "audio taper" pots and faders aren't mathematically logarithmic like Pd's are, which is why you can't make Pd's log sliders go to 0 without extra effort. So here's a solution that works in Pd, but what I'm saying is that it probably won't linearize a physical audio taper pot well. I made a table-driven transfer function to linearize the CC messages coming from the faders on my Yamaha 01V96i and the line is somewhat arbitrary, especially at the bottom of the travel. Let me know if you want to try that route and I'll tell you more. Capturing the physical curve is kinda messy.
    log2lin.pd
    Screenshot 2025-04-28 100557.png

    posted in technical issues read more
  • jameslo

    @kyro I don't understand your previous comment, so consider this an alternative answer to your original post :)

    If you can tolerate the latency, I wonder if an FFT filter would work for you? You can test with audiolab's pp.fft-split~. Set the frequency to 20 and take the middle output.

    Screenshot 2025-04-18 134942.png
    Oh wait! I think I just understood your previous post! So this probably won't work for you because I think you're objecting to the latency.

    posted in technical issues read more
  • jameslo

    @bklindgren Maybe "expected I/O latency" or "realtime processing budget"? I say that because if the actual latency is greater, you'll hear clicks as blocks are dropped or corrupted. But the expected latency can be set much greater than the actual latency without problems. Look at the following test:

    Screenshot 2025-04-17 113542.png
    REAPER sends the test tone on track 1 out its audio loopback driver to Pd, and Pd returns it on the next 2 channels in the loopback driver. I recorded the return signal on tracks 2 through 5 using Pd delay settings of 50, 20, 10, and 100 ms, respectively. The delays on the return tracks are 52, 21, 11, and 101 ms respectively.

    posted in technical issues read more
  • jameslo

    @bklindgren From the manual:
    The "delay" is the nominal amount of time, in milliseconds, that a sound coming into the audio input will be delayed if it is copied through Pd straight to the output.
    I've always assumed this includes the time it takes for the audio interface to fill Pd's input buffer, the time it takes for Pd to process a straight-through connection, the time it takes for Pd to fill the output buffer, and any OS-specific/driver-specific/audio-framework-specific overhead. I suspect that some of these categories overlap. So I wouldn't say "it's the buffer" exclusively, but in as much as a larger buffer takes a longer time to process, then yes, buffer size is probably a factor. For example, with a 64 sample buffer, I'm able to set delay much lower if I select an ASIO driver than if I select one of the Windows built-in drivers.

    posted in technical issues read more
  • jameslo

    @ddw_music said:

    Gotos have been discouraged for a long time because they're messy.

    Hmm, that's interesting, have you considered Java's use of gotos? :) They're structured, provide a convenient way for exiting deeply nested loops, and feel similar to Java's exception framework.

    Never mind, I just couldn't resist. Carry on.

    posted in technical issues read more
  • jameslo

    FWIW, I interpreted "spray everywhere" to mean that Pd "functions" spray their return values to every place that could potentially need it, depending on the control flow. That's a common way of dealing with Pd's lack of intrisic "return to caller" when there are just a few callers.

    posted in technical issues read more
  • jameslo

    @ddw_music said:

    (and is basically identical to the approach in my example patch above).

    Oh sorry, I missed that. TBH I've been barely hanging on :) I'll go back and read why you were hesitant about endorsing this approach. But don't you think that in the end, all languages have things that are convenient and things that are inconvenient, and so....so what? Before I retired I was studying functional programming languages like Haskell, and I didn't get far enough along to understand how the hell you could program without state! I understood that it was great for multiprocessing, but wow.

    posted in technical issues read more
  • jameslo

    @ddw_music Does this behave like a shared stateful function that returns to the caller? returnToCaller.pdScreenshot 2025-04-11 212225.png

    posted in technical issues read more

Internal error.

Oops! Looks like something went wrong!