plugdata latency and REAPER's plugin delay compensation (PDC)
plugdata sets its reported latency to 64 samples by default and appears to tell REAPER about it. REAPER then tries to correct for this latency using its plugin delay compensation scheme. 64 seems reasonable, right? That's what one might expect as overhead just to get signal into plugdata and back out again (e.g. it takes at least one buffer for Pd vanilla to shuttle signal to/from its own [pd~] subprocess).
But that's not what I'm seeing! I made a track that is silent except for a single 1 in the 2nd or 3rd sample, and have inserted a plugdata plugin that connects [adc~] directly to [dac~]. At 64 samples of latency, if I render the track, the output is completely silent. If I change plugdata's reported latency to 0, the output matches the track.
<spooky music/> Um ... wh-wha-what's going on?
What do you see on your DAW? impulse.wav passSignal.pd
Start abstraction in Pd sub-process with $n args set?
@FFW Thanks, your approach is the way I was originally thinking about it, but since I'm new to dynamic patching and my clone has a lot of connections, I started down a slightly different path. Since I know I can set a $n argument from an enclosing patch, I was thinking I could make a wrapper for my clone patch and instantiate the wrapper instance dynamically with the args set to the values I want. But even this is moot because in my prev post I discovered that there are simpler ways to achieve my goal than trying to parameterize the clone start index flag.
Where does latency come from in Pure Data?
@whale-av Thanks, David.
I'm on Linux. Here's a little on apps I mentioned.
JACK is a "low-latency" multiplexing sound server (i.e., audio patch bay for pro apps)
It's sister server, PulseAudio, is the system's generic "multiplexer" - these are needed because the modular driver system ("ALSA") doesn't do multiplexing, but only speaks to hardware.
Both JACK and PulseAudio are on trial overhaul with a new thing called PipeWire, which acts as an in-place substitution multiplexer server.
QSynth (fluidsynth) is a soundfont synthesizer - and yes, it has its own settings for buffers, but as long as audio apps are set to use the JACK multiplexer, they are bound by its hardware buffer size setting overall.
The Delay
The Pd delay I am getting is about 80ms, with the Pd "Delay" set to 40ms, and buffer size set to 1024 samples (at 48 kHz).
The QSynth is quite smaller, in fact, it is about 21ms, which equals 1024 samples.
Pd freezes if the "Delay" amount goes below 21 - but as I've mentioned, the overall Pd delay is 80ms.
(Reaper is a cross-platform DAW used by many)
The soundcard
The soundcard is M-AUDIO M-TRACK DUO.
M-AUDIO doesn't offer support for Linux, but ever since the Delta, I think, the driver is more or less similar and has been incorporated into Linux...
I can normally get recording-playback in the Reaper DAW going with 256 samples at 48 kHz steadily, and down to 128 samples with some underruns (for precision MIDI finger drumming, etc.)
The double buffer
One important thing to note is that along with hardware buffer size, the JACK system offers a config parameter of the number of buffers to use. Normally this is set at 2.
Perhaps that is the problem
Camomile VST3-generated CC messages altered on Mac M2
Hi, I just wanted to report a related discovery. When REAPER loads a Camomile VST3 on an M2 Mac, it runs it via an x86 bridge process because they are compiled for Intel processors (so says the internet). With my plugins, this bridge process almost doubles their CPU overhead and causes REAPER to load quite slowly. Rewriting my plugins for PlugData addressed both issues--PlugData is apparently ARM processor-compatible.
edit: that said, I've seen REAPER crash twice now as I've edited patches in PlugData when it's hosted as a VST3. So be careful.
Camomile VST3-generated CC messages altered on Mac M2
I've written a VST3 plug-in using Camomile+Pd to output groups of control change messages in response to OSC commands. The CC messages are used to turn channels of a Yamaha 01V96i mixer on and off.
On Windows, everything works fine, but on my M2 Mac I'm having strange issues. The plugin receives OSC fine but the MIDI CC it generates is zeroed-out, e.g. when I ask it to send B0 48 7F, the mixer receives B0 00 00. I can run the Pd patch standalone on the Mac and it works fine.
The AU version of my plugin doesn't output MIDI at all and I get an OSC error message in the Camomile console. I tested a different CC generating Pd/Camomile/VST3 plugin on my Mac and its CC messages are also being zeroed out. In contrast, I've written two other plugins that work fine on the Mac: one is a side-chained envelope follower with adjustable release time and the other generates 5 channels of audio in response to OSC messages.
I saw a somewhat old discussion on the Camomile Github site referring to some issues with MIDI CC under VST3 (https://github.com/pierreguillot/Camomile/discussions/260), but I don't recall having issues like this on my old Mac with my CC-generating plugins hosted in REAPER circa late 2020, and I don't see any similar complaints in discussions about PlugData, which I believe uses Camomile under the hood. In case the issue was REAPER, I tried to load the plug-in to Audacity, but Audacity complains that the plugin is incompatible.
I think there's probably a better way to achieve my end goal but wanted to check in with Pd brain trust because I'm sad to think that I've lost this capability. What would you try next?
I'm using REAPER 6.81 as the VST host, Camomile 1.0.7, Pd 0.54.0, and MacOS 12.6.7 on last year's M2 MacBook Pro.
cannot dynamically load position-independant executable
idk that much about c++, but I'm pretty sure there shouldn't be a 'main' function. In pd you compile objects as libraries. You have to look at the 'how to program externals' book. https://github.com/pure-data/externals-howto#definitions-and-prerequisites
Plus I'm pretty sure you have to export stuff correctly (as 'c') so that the object loader knows how to load it
you might try the 'flext' framework or look at the ceammc distribution (I think they might use c++?
https://github.com/grrrr/flext
https://github.com/uliss/pure-data/blob/ceammc/ceammc/ext/class-wrapper/README.md
https://github.com/uliss/pure-data/blob/ceammc/ceammc/ext/src/lib
Also it would be helpful to post the command you're using to compile it
Receiving 14-bit MIDI CC messages.
@alexandros yeah I'm sure* - I send it to reaper and in reaper tell a knob on a VST to be a 14 bit CC. I was testing the Korg MS-20 VST with the resonance cranked doing a filter sweep to try and hear the stepping... for science
*I'm not sure about hardware like a Behringer B-Control Rotary BCR 2000 - 14 bit is esoteric and was never really used, they went off with MPE which is still pretty fun when patched right - if I had something hardware that does 14 bit midi I'd just open up Midi-OX (it runs great in wine btw, I like how you can set it to show decimal) to see what two CCs its sending on.
Receiving 14-bit MIDI CC messages.
first of all just for the person asking the question - this is a polite conversation its just entering very deep kind of esoteric territory (also not sorry about the font jk im just trying out ideas about how to fix the tiny fonts but a lot of pixel fonts actually need to be big and dont read well super small)

14 bit midi is reallly undocumented and rarely used even tho it's awesome - way cooler than MPE and there is also No Good search engine results with actual answers. I've used it from pd into reaper (in reaper you have an option to use 14 bit midi and then you choose the msb value) and I don't even understand why it overrides the VSTs resolution - and my plan is to use it with arduino to get around some limitations about serial data - so I'm happy to keep poking at it and talking about it.
Here's something missing I found with your approach ddw_music - and also I still dont understand about the concurrent messaging - Im happy to have it up my sleve tho I'll probably run into it pretty soon -
so CC messages are individual of each other - it's not sending them both every time as far as I kno - when you are just super finely moving a 14 bit midi knob to increment in tiny values that would mostly be sent over the LSB which is a separate CC until it wraps around with [% ] or [mod ] ([%] is depreciated but they will both work - tho [%] might not work right on some athlon desktop computers) - so when I switch to their sliders to emulate that it looks like the cloned max external in cyclone here actually doesn't work to send information.
I wish I had some 14 bit midi gear to test tho I could be wrong because I dont have the behringer knob dude to check (I could borrow one tho its flashed with a sequencer) - I think a 14 bit midi message is just going to send one message because why would you want to double up all that data, most midi is about removing data (like running status)
MPE support in Pure Data?
@jj37592 You should I think just send one note and then bend it.
There are standard rpn messages for changing the bend range....... recognised in hardware synths as they are General midi standard compatible..... even the Microsoft GS Wavetable synth reads them.
The bend range......
"You can set it with both CC#100&101 (RPN LSB&MSB) first to 0 and then adjust the range with CC#6 (Data Entry MSB) in semitones."
.... from https://forum.cockos.com/showthread.php?t=69372
I know nothing about Reaper, but it probably accepts OSC and user definable NRPN messages as well?
If Reaper will not accept the RPN messages, but the pitch bend range can be set somewhere (or the note can be bent by other means), then OSC messages might be easiest from Pd.
If you need NRPN......... nrpn.pd
NRPN messages are 14-bit..... like [bendin] ..... so the highest resolution in midi...... but OSC can do better!.
David.
MPE support in Pure Data?
Hello, chiming in here quickly. Opposed to jamculture's request my main issue here is to get MPE data out of pd and into a DAW (reaper in my case). I'm especially interested in pitch modulation of several midi notes at once (each one individually). But the way I tried it, Reaper will just receive hundreds of micro MIDI notes, whenever I adjust the pitch of one voice via a number box. (See picture attached (this would be for one voice only)). Do you have any ideas how I could handle this kind of pitch modulation per voice (also beyond the 2 semitones that the normal pitchbend range will be interpreted as in vsts.)? 

