[Advanced] Dynamic Patching in Pure Data Vanilla

  Рет қаралды 10,843

MegalonPureData

MegalonPureData

6 жыл бұрын

UPDATE: I've found a way to delete specific objects. You can use the internal message "pd-name-of-subpatch mouse x y 0 0" to click on parts of the patch, then use "pd-name-of-subpatch cut" to delete the object. This is ever better than "click" because it doesn't focus the window while it's happening.
Download the patches in this video: github.com/megalon/DynamicPat...
PD Internal Messages list: puredata.info/docs/tutorials/...

Пікірлер: 19
@matthieupernaudmusic
@matthieupernaudmusic 2 жыл бұрын
this is GOLD 😍. thanks ! that's more than useful
@patrickmanion8736
@patrickmanion8736 4 жыл бұрын
Thank you for this. I wanted to be able to break a connection between two objects dynamically. After a bit of experimentation I started pd up on the command line (Mac OS X) with a high debug value such as "./pd -d 10". This displays all the mouse coordinates as you move around. I hovered over the connection I wanted to delete and got the coordinates. In my case x and y were 13 and 39 respectively. In the parent patch I executed the following commands: 1) [editmode 1( 2) [mouse 13 39 0 0( 3) [cut( 4) [editmode 0( Oh, btw, this was done using vanilla 0.50-2 Here is my simple patch "dynamic_patching_with_connection_deletion.pd #N canvas 868 182 622 648 12; #N canvas 1542 274 433 300 test 1; #X msg 10 10 hello; #X obj 10 50 print; #X restore 27 152 pd test; #X obj 26 602 s pd-test; #X msg 26 183 msg 10 10 hello; #X msg 41 210 obj 10 50 print; #X msg 56 240 connect 0 0 1 0; #X msg 68 266 clear; #X msg 122 447 cut; #X msg 78 291 selectall; #X msg 92 314 tidy; #X text 15 25 This shows how to dynamically add and delete objects ; #X text 138 182 do these first; #X msg 122 425 mouse 13 39 0 0; #X text 16 50 In order to break a connection run pd from the command line with a high debug number "pd -d 10" worked for me. Hover over the exact connection you want to break and get the mouse coordinates. Put these in a mouse command(see below). Then \, send a cut command. ; #X msg 122 403 editmode 1; #X msg 122 469 editmode 0; #X text 205 402 turn on editmode; #X text 200 469 turn off editmode; #X connect 2 0 1 0; #X connect 3 0 1 0; #X connect 4 0 1 0; #X connect 5 0 1 0; #X connect 6 0 1 0; #X connect 7 0 1 0; #X connect 8 0 1 0; #X connect 11 0 1 0; #X connect 13 0 1 0; #X connect 14 0 1 0;
@plasticdub1477
@plasticdub1477 2 жыл бұрын
thank you for this - and particularly for making it clear how "connect" objects work - the only thing i would add is that the indices for "connect" seem to restart from zero inside each sub-patch - i have been trying to dynamically create an array of float atoms (number boxes) plus a couple toggles - dynamically setting "send" and "receive" works for the float atoms but not for the toggles - so i need to use "connect" messages to get around this - so long as i create the the toggles first inside an empty sub-patch then i can rely on them being indexed 0, 1, etc. and it's easy to connect them - btw the other method i found for doing a dynamic "receive" is to use a parallel "value" object - e.g. if i have [send foo] and [value foo] then whatever goes into my "send" ends up in the "value" object and i can get it by banging the left input - the reason this solves the problem is that you can use the right input of the "value" object to tell it what to output (just like we wish we could do with "receive") - i actually prefer this to using "receive" because it requires that you bang the left input of the "value" object so everything inherently stays in sync...
@thulsadum
@thulsadum 4 ай бұрын
For deleting a specific object or atom, you could use the [ delete ( message of the pointer object, if you manage to get hold of an pointer to that object (which is not that apparent to me atm, tbh).
@harmonoman7642
@harmonoman7642 6 жыл бұрын
great work!!!
@sinewave440hertz
@sinewave440hertz 6 жыл бұрын
Thanks very much for this! Just getting into dynamic patching and this helps me no end. I'm curious to know if you've used dynamic patching to help in building abstractions. Currently experimenting as it seems to be a good way to create (sub)patches on the fly based on the arguments of an abstraction.
@megalonpuredata3204
@megalonpuredata3204 6 жыл бұрын
Thanks! I haven't used it for that purpose, but I am using it regularly to dynamically create receive objects, since you can't normally redefine their names once they have been placed
@uoailewa
@uoailewa 5 ай бұрын
Cool
@MarioMey
@MarioMey 3 жыл бұрын
Hi, man. How should I create objects in the same patch, not subpatch?
@harmonoman7642
@harmonoman7642 6 жыл бұрын
I ran into some very helpful links here: forum.pdpatchrepo.info/topic/10813/collection-of-pd-internal-messages-dynamic-patching
@gabrieldecarvalhoeoliveira5618
@gabrieldecarvalhoeoliveira5618 Жыл бұрын
great video! is there a way to click with "Command"?
@gabrieldecarvalhoeoliveira5618
@gabrieldecarvalhoeoliveira5618 Жыл бұрын
pd-name-of-subpatch mouse x y 0 2 clicks with command
@joshuanewton1016
@joshuanewton1016 4 жыл бұрын
Can you elaborate on how you managed to delete specific objects?
@megalonpuredata3204
@megalonpuredata3204 4 жыл бұрын
Sure. I made this video several years ago, but I just made a quick test patch and it still works. pastebin.com/raw/RbhGRHWf The "mouse" event simulates a fake mouse click on the canvas (without actually focusing the window or taking mouse control from the user). You then "cut" the object that you want to delete. I didn't include in the description, but you can also give a "mouseup" message to release the mouse at a different position, and thus simulate clicking and dragging. I think it'd be best to just look at the source and see how these work. I'm not too familiar with the source, but it looks like this is the relevant line github.com/pure-data/pure-data/blob/c180bc44ab722cee728174847cf30730e44f245b/src/g_editor.c#L4834
@wurnotantmlb
@wurnotantmlb 6 жыл бұрын
common!!
Pure Data vs SuperCollider race to the finish
12:48
James Harkins
Рет қаралды 8 М.
Каха и суп
00:39
К-Media
Рет қаралды 6 МЛН
БОЛЬШОЙ ПЕТУШОК #shorts
00:21
Паша Осадчий
Рет қаралды 12 МЛН
Pure Data Tutorial: Aliasing and bandlimited waveforms
7:04
Sound Codex
Рет қаралды 1,2 М.
PD Sigmund - Pitch Tracking
15:12
Kenneth Harte
Рет қаралды 7 М.
Ryoji Ikeda Pure Data Tutorial
8:51
Sound Simulator
Рет қаралды 57 М.
Pure Data [plot] sequencer
8:56
MegalonPureData
Рет қаралды 1,2 М.
Ableton Clip Launcher Recreated in Pure Data
10:05
MegalonPureData
Рет қаралды 1,4 М.
Pure Data Guitar Pedal
10:20
Alex Miller
Рет қаралды 43 М.
(008) Pure Data - making a simple oscilloscope utility
11:42
Interactive Sonification | Pure Data
3:51
tibbakoi
Рет қаралды 7 М.
Pure Data Guitar Synth/Sampler
2:30
Jack Rooney
Рет қаралды 27 М.
Каха и суп
00:39
К-Media
Рет қаралды 6 МЛН