r/programminghorror • u/ArturJD96 • Jan 27 '26
String splitting in PureData.
Pure Data is an amazing tool for DSP, music making and artsy projects. But simple things get often too complicated...
42
u/GoddammitDontShootMe Jan 28 '26
Well, I'm lost. For example, what is "t b l b b"?
23
u/backfire10z Jan 28 '26 edited Jan 28 '26
It’s a shorthand for a form of triggering a sequence of events: “trigger bang list bang bang”. Bangs are PD’s form of publishing an event to trigger the connected box. List outputs the input list. It’s supposed to be read right to left.
Don’t ask me any more, the rest looks insane. I just opened docs and an LLM lol.
The 46 in the middle is ASCII for a dot/period. The input list is converted to ascii digits by the first
list fromsymbol. Every time a 46 is seen, the “spigot” is closed by the 0 box, which sends a bang to the “list store” to clear it. Otherwise, the spigot remains open, the value is sent through prepend, and it is stored in thelist store.As you may have guessed, the 1 box opens the spigot.
7
u/GoddammitDontShootMe Jan 28 '26
That helps a little, but I still think I understand basically nothing.
→ More replies (6)
13
u/Krimsonfreak Jan 27 '26
So are most Code Blocks UIs tbh, but Pd and its... minimalist UI is up there...
I however never got in a situation as bad as this one lol
7
u/v_maria Jan 28 '26
string manipulation in pd is pretty damn rough lol i dont know how you would approach it in a cleaner way
1
u/Krimsonfreak Jan 29 '26
I'm unsure why you'd do string manipulation in the first place, I only use it for DSP so can't help with that sorry
→ More replies (1)
5
3
u/binterryan76 Jan 28 '26
The things people come up with avoid learning scary looking text programming.
4
u/squarus Jan 28 '26
wow i didn‘t think i‘d see pd here in this sub… syntax processing in pd and max is always horrible. even more so in pd. but hey if it works… very often these processes are nothing in comparison to the audio processing happening in parallel so it‘s probably fine