How does Pd reinitialize blocks that have hardcoded sample rates like filters?
@oid said:
@inari said:
However what's not clear is how these different sample rates get into the filter blocks, which use x_sr for calculating their coefficients.
But they also use c_coef and c_x which take current sample rate into account because they are type _samplerate. From d_ugen.c:
/* ------------------------ samplerate~~ -------------------------- */ static t_class *samplerate_tilde_class; typedef struct _samplerate { t_object x_obj; t_float x_sr; t_canvas *x_canvas; } t_samplerate; static void samplerate_tilde_bang(t_samplerate *x) { outlet_float(x->x_obj.ob_outlet, canvas_getsr(x->x_canvas)); } static void *samplerate_tilde_new(void) { t_samplerate *x = (t_samplerate *)pd_new(samplerate_tilde_class); outlet_new(&x->x_obj, &s_float); x->x_canvas = canvas_getcurrent(); return (x); } static void samplerate_tilde_setup(void) { samplerate_tilde_class = class_new(gensym("samplerate~"), (t_newmethod)samplerate_tilde_new, 0, sizeof(t_samplerate), 0, 0); class_addbang(samplerate_tilde_class, samplerate_tilde_bang); } /* -------------------- setup routine -------------------------- */ void d_ugen_setup(void) { block_tilde_setup(); samplerate_tilde_setup(); }
I think if you do the math it will work out but I could be missing something, OOP in C plus heavy pointer use plus math symbols thrown about with pointer symbols always leaves me a but unsure of what is going on if not completely lost.
The use of globals across multiple files in the PD source as well as the breaking of OOP principles by calling member functions of blocks that aren't used (looking at you osc~, vcf~ and cos~) amounts to a crime against humanity... A shame really. If you don't look at how the sausage is made, PD is a nifty little language, but the moment something breaks or needs to be extended, watch out...
How does Pd reinitialize blocks that have hardcoded sample rates like filters?
@inari said:
However what's not clear is how these different sample rates get into the filter blocks, which use x_sr for calculating their coefficients.
But they also use c_coef and c_x which take current sample rate into account because they are type _samplerate. From d_ugen.c:
/* ------------------------ samplerate~~ -------------------------- */
static t_class *samplerate_tilde_class;
typedef struct _samplerate
{
t_object x_obj;
t_float x_sr;
t_canvas *x_canvas;
} t_samplerate;
static void samplerate_tilde_bang(t_samplerate *x)
{
outlet_float(x->x_obj.ob_outlet, canvas_getsr(x->x_canvas));
}
static void *samplerate_tilde_new(void)
{
t_samplerate *x = (t_samplerate *)pd_new(samplerate_tilde_class);
outlet_new(&x->x_obj, &s_float);
x->x_canvas = canvas_getcurrent();
return (x);
}
static void samplerate_tilde_setup(void)
{
samplerate_tilde_class = class_new(gensym("samplerate~"),
(t_newmethod)samplerate_tilde_new, 0, sizeof(t_samplerate), 0, 0);
class_addbang(samplerate_tilde_class, samplerate_tilde_bang);
}
/* -------------------- setup routine -------------------------- */
void d_ugen_setup(void)
{
block_tilde_setup();
samplerate_tilde_setup();
}
I think if you do the math it will work out but I could be missing something, OOP in C plus heavy pointer use plus math symbols thrown about with pointer symbols always leaves me a but unsure of what is going on if not completely lost.
Note overlap when using poly and clone objects
Hello patchers! I have been watching a tutorial series by Really Useful Plugins where they recreate yamaha dx7 synth and repeated after them. Finishing, i ran into a problem related to polyphony.
So, the problem is when i press a note it plays all 8 voices at the same time, when i play other note, it keeps playing previous ones with the current one. This may happen due to ADSR, but i checked everything several times and still cannot solve it. I admit that the solution may be pretty obvious, but i am new to this sorry. I checked manuals and tutorials, but they weren't very useful.
Here is the zip with the patch.
dx7.zip
- Here are poly and clone themselves
- Here is dx7-poly object, which is cloned
- On previous photo the $0-oscmsgs is sent, here is where it is delivered
- ADSR object which is stolen from pd documentation examples
I hope very much for your help! thx
pd-else + libpd on iOS
Hi, I'm trying to use pd-else with libpd on ios.
I'm make
ing pd-else for PLATFORM=x86-64-apple-ios
, copying over the output (objectsdir
) to my bundle resources, building libpd with ADDITIONAL_LDFLAGS=-ldl
, adding with the output to search path PdBase.add(toSearchPath: Bundle.main.resourcePath)
When I'm trying to open a patch which uses pd-else
Some attempts to find files are successful:
2024-04-16 21:14:27.771002+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.pd and succeeded
2024-04-16 21:14:27.771098+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.pd and succeeded
But most fails
2024-04-16 21:14:27.751266+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.darwin-amd64-32.so and failed
2024-04-16 21:14:27.751597+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.darwin-amd64-0.so and failed
2024-04-16 21:14:27.751739+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.darwin-fat-32.so and failed
2024-04-16 21:14:27.751876+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.darwin-fat-0.so and failed
2024-04-16 21:14:27.752090+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.d_amd64 and failed
2024-04-16 21:14:27.752374+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.d_fat and failed
2024-04-16 21:14:27.752664+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.pd_darwin and failed
2024-04-16 21:14:27.752902+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.darwin-amd64-32.so and failed
2024-04-16 21:14:27.753208+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.darwin-amd64-0.so and failed
2024-04-16 21:14:27.753470+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.darwin-fat-32.so and failed
2024-04-16 21:14:27.770480+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.darwin-fat-0.so and failed
2024-04-16 21:14:27.770636+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.d_amd64 and failed
2024-04-16 21:14:27.770790+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.d_fat and failed
2024-04-16 21:14:27.770900+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~/out~.pd_darwin and failed
2024-04-16 21:14:27.771002+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.pd and succeeded
2024-04-16 21:14:27.771098+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/out~.pd and succeeded
2024-04-16 21:14:27.771192+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.771485+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.771726+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-32.so and failed
2024-04-16 21:14:27.771987+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-0.so and failed
2024-04-16 21:14:27.772286+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_amd64 and failed
2024-04-16 21:14:27.772645+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_fat and failed
2024-04-16 21:14:27.773142+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pd_darwin and failed
2024-04-16 21:14:27.773783+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.774359+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.774935+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-fat-32.so and failed
2024-04-16 21:14:27.775535+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-fat-0.so and failed
2024-04-16 21:14:27.776348+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.d_amd64 and failed
2024-04-16 21:14:27.776992+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.d_fat and failed
2024-04-16 21:14:27.777360+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.pd_darwin and failed
2024-04-16 21:14:27.777810+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pd and failed
2024-04-16 21:14:27.778584+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pat and failed
2024-04-16 21:14:27.779417+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/else/lb.pd and failed
2024-04-16 21:14:27.780202+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.781051+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.781778+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-32.so and failed
2024-04-16 21:14:27.782005+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-0.so and failed
2024-04-16 21:14:27.782436+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_amd64 and failed
2024-04-16 21:14:27.782651+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_fat and failed
2024-04-16 21:14:27.788387+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pd_darwin and failed
2024-04-16 21:14:27.788947+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.789356+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.789586+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-fat-32.so and failed
2024-04-16 21:14:27.789874+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-fat-0.so and failed
2024-04-16 21:14:27.790175+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.d_amd64 and failed
2024-04-16 21:14:27.790421+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.d_fat and failed
2024-04-16 21:14:27.790769+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.pd_darwin and failed
2024-04-16 21:14:27.791501+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pd and failed
2024-04-16 21:14:27.792396+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pat and failed
2024-04-16 21:14:27.793014+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/else/lb.pd and failed
2024-04-16 21:14:27.793494+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.795343+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.795655+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-32.so and failed
2024-04-16 21:14:27.796345+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.darwin-fat-0.so and failed
2024-04-16 21:14:27.797063+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_amd64 and failed
2024-04-16 21:14:27.797921+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.d_fat and failed
2024-04-16 21:14:27.798883+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb.pd_darwin and failed
2024-04-16 21:14:27.802219+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-32.so and failed
2024-04-16 21:14:27.802831+0300 YoganOme[72363:460962] Pd: verbose(4): tried /Users/anvlkv/Library/Developer/CoreSimulator/Devices/19822801-5565-453D-802D-5533CB03027B/data/Containers/Bundle/Application/B61B55C5-FEE9-4A99-964E-D45932D58CE1/YoganOme.app/else/else/lb/lb.darwin-amd64-0.so and failed
2024-04-16 21:14:27.803686+0300 YoganOme[72363:460962] Pd: verbose(0): else/lb
2024-04-16 21:14:27.804195+0300 YoganOme[72363:460962] Pd: error: ... couldn't create
And indeed there're no such files in the output, there're some with _darwin
but not with specific architecture. Also there's no else/else
subdirectory
Could anyone give a hint?
[text] object help file could be a lot more helpful
Hi, I'm just trying to figure out how to work with this object and the help file is really confusing to me
Firstly- can any kind soul point me toward a better resource for understanding how to use this object?
Secondly, I'm going to point out a few of my confusions with the help file, specifically in [text define]:
- "text define" maintains a text object and can name it so that other objects can find it (and later should have some, alternative, anonymous way to be found)."
-
- What does that second half mean? An "anonymous way to be found" sounds like an oxymoron to me.
- When i click the message box [write text-object-help.txt] that is connected to [text define -k text-help-1], I get an error in the console that reads "text-object-help.txt: write failed"
-
- Why should something in a help file fail like this? There's nothing apparent in the help file to explain the error. I'm running realtime Purr-Data on Manjaro's latest realtime kernel, everything is updated.
- Next to the message box [sort], there's just a comment that reads "comment"
-
- lol what?
- It seems like [text define] creates the text file with its third argument (e.g., [text define -k file-name-here]" However, the help patch is reading from a file called "text-object-help.txt" and when the file is opened, "text-help-1" is on the top of the window.
-
- Dear god, what is going on?
If anyone feels like helping me out here, I would gladly help put together a better help patch. Or maybe I'm just reading this totally incorrectly.
Thanks continually for all of your support, everyone!
Some patches won't open. (was: Why Vanilla fails at reading some Purr Data patches?)
Why is that?
For example:
This helpfile of PDjs appears blank in Vanilla:
js-help.pd
#N canvas 2802 562 675 300 12;
#X obj 312 53 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 314 74 compile;
#X obj 240 253 print js;
#X text 412 204 Load JavaScript file js-help.js;
#X text 412 225 args are available through;
#X text 413 244 property jsarguments in JS;
#X obj 244 202 js js-help.js arg1 arg2;
#X text 371 73 recompile source;
#X text 11 9 js: Execute JavaScript;
#X floatatom 314 102 5 0 0 0 - - -;
#X msg 320 129 1 2 3;
#X text 331 51 call function bang;
#X text 357 99 call function msg_float;
#X text 373 129 call function list;
#X msg 142 61 setprop name test;
#X msg 143 87 getprop name;
#X text 25 59 set JS property;
#X text 26 88 get JS property;
#X msg 322 167 test x y z;
#X text 409 165 call function test;
#X text 41 28 https://github.com/mganss/pdjs;
#X connect 0 0 6 0;
#X connect 1 0 6 0;
#X connect 6 0 2 0;
#X connect 9 0 6 0;
#X connect 10 0 6 0;
#X connect 14 0 6 0;
#X connect 15 0 6 0;
#X connect 18 0 6 0;
That one is made in Vanilla and opens:
js-help-vanilla.pd
#N canvas 80 229 1014 606 12;
#X obj 142 191 js js-help.js arg1 arg2;
#X msg 127 59 setprop name test;
#X msg 127 85 getprop name;
#X obj 290 45 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 293 65 compile;
#X floatatom 293 93 5 0 0 0 - - -;
#X msg 304 118 1 2 3;
#X msg 308 149 test x y z;
#X obj 142 215 print js;
#X text 13 58 set JS property;
#X text 13 85 get JS property;
#X text 14 10 js: Execute JavaScript;
#X text 63 26 https://github.com/mganss/pdjs;
#X text 312 41 call function bang;
#X text 354 63 recompile source;
#X text 345 93 call function msg_float;
#X text 358 119 call function list;
#X text 394 149 call function test;
#X text 309 191 Load JavaScript file js-help.js;
#X text 309 212 args are available through;
#X text 309 234 property jsarguments in JS;
#X connect 0 0 8 0;
#X connect 1 0 0 0;
#X connect 2 0 0 0;
#X connect 3 0 0 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 0 0;
#X connect 7 0 0 0;
One more example:
A patch from the pd-list, does not open in Vanilla:
lock-in-amplifier.pd
Audiolab is now available on deken!
@solipp I was wondering if fft-split~ could be used as an upsampled anti-aliasing filter but I'm not getting the results I expected. Things seem to change radically depending on the oversampling factor. What am I misunderstanding?
fft-split~ as antialias filter.pd
EDIT: NEVERMIND
It appears that Pd doesn't perform the 4X overlapped FFT windowing as expected if the FFT's block size is smaller than 4X the block size of the enclosing patch. When I change fft-split~'s block size to 4096, things are fine. But let me know if I've given the wrong reason.
Having lots of switches into Pd
@alexandros
This code sort of works with wip_multiple_PWM.pd
// merging works but pwm leds are choppy.
// number of elements in arrays need to
// match for() cycles in void setup and void loop
int pinsIn[2] = {2, 4};
int pinsAnalog[8] = {0, 1, 2, 3, 4, 5, 6, 7};
int pin = 0;
int val = 0;
int pinsOut[2] = {7, 12};
//TMP setup pwm:
// variables to hold pin numbers
int pwmLED1 = 3;
int pwmLED2 = 5;
int pwmLED3 = 6;
int pwmLED4 = 9;
int pwmLED5 = 10;
int pwmLED6 = 11;
// variables to hold pin states
int pwmLEDvalue1;
int pwmLEDvalue2;
int pwmLEDvalue3;
int pwmLEDvalue4;
int pwmLEDvalue5;
int pwmLEDvalue6;
//should this be omitted and use the a
// variable to hold and assemble incoming data
int temporary;
//END TMP pwm setup
void setup()
{
//set up a total of pins for digital input (has to match number of elements in array)
for(int i = 0; i < 2; i++)
pinMode(pinsIn[i], INPUT);
for (int i = 0; i < 2; i++) {
pinMode(pinsOut[i], OUTPUT);
digitalWrite(pinsOut[i], LOW);
}
//DEFAULT works with thermistors,
//INTERNAL with transitor thermostats
analogReference(DEFAULT);
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(A2, INPUT_PULLUP);
pinMode(A3, INPUT_PULLUP);
pinMode(A4, INPUT_PULLUP);
pinMode(A5, INPUT_PULLUP);
pinMode(A6, INPUT);
pinMode(A7, INPUT);
//TMP test pwm setup:
pinMode(pwmLED1, OUTPUT);
pinMode(pwmLED2, OUTPUT);
pinMode(pwmLED3, OUTPUT);
pinMode(pwmLED4, OUTPUT);
pinMode(pwmLED5, OUTPUT);
pinMode(pwmLED6, OUTPUT);
Serial.begin(115200); // perhaps use a faster baud rate
}
void loop()
{
Serial.print("knobs"); // use "knobs" as a keyword so you can receive
// the knob values as a list with a [r knobs] in Pd
for(int i = 0; i < 8; i++){
unsigned int knob = analogRead (pinsAnalog[i]);
Serial.print(" "); // first print a white space to separate the "knob" keyword from the values
// and the values from each other
Serial.print(knob); // then print the actual knob value
}
Serial.println(); // finally print a newline character to denote end of data for keyword "knobs"
// the same technique applies to the switches too
// receive the switch values as a list with [r switches]
Serial.print("switches");
for(int i = 0; i < 2; i++) {
int switchVal = digitalRead(pinsIn[i]);
Serial.print(" ");
Serial.print(switchVal);
}
Serial.println();
//handle digital outputs
if (Serial.available()) {
static int temp;
byte in = Serial.read();
if (isDigit(in)) {
temp = temp * 10 + in - '0';
}
else if (in == 'p') {
pin = temp;
temp = 0;
}
else if (in == 'v') {
val = temp;
temp = 0;
digitalWrite(pinsOut[pin], val);
}
}
//TMP merge test PWMs:
while(Serial.available()){
byte inByte = Serial.read();
if((inByte >= '0') && (inByte <= '9'))
temporary = 10 * temporary + inByte - '0';
else{
if(inByte == 'p'){
pwmLEDvalue1 = temporary;
temporary = 0;
}
else if(inByte == 'q'){
pwmLEDvalue2 = temporary;
temporary = 0;
}
else if(inByte == 'r'){
pwmLEDvalue3 = temporary;
temporary = 0;
}
else if(inByte == 's'){
pwmLEDvalue4 = temporary;
temporary = 0;
}
else if(inByte == 't'){
pwmLEDvalue5 = temporary;
temporary = 0;
}
else if(inByte == 'u'){
pwmLEDvalue6 = temporary;
temporary = 0;
}
}
analogWrite(pwmLED1, pwmLEDvalue1);
analogWrite(pwmLED2, pwmLEDvalue2);
analogWrite(pwmLED3, pwmLEDvalue3);
analogWrite(pwmLED4, pwmLEDvalue4);
analogWrite(pwmLED5, pwmLEDvalue5);
analogWrite(pwmLED6, pwmLEDvalue6);
//digitalWrite(dspLED, dspLEDstate);
}
}
This is the code without PWM control. It works fine.
//number of elements in arrays need to match for() cycles in void setup
int pinsIn[4] = {6, 7, 8, 9};
int pinsAnalog[8] = {0, 1, 2, 3, 4, 5, 6, 7};
int pin = 0;
int val = 0;
int pinsOut[4] = {2, 3, 4, 5};
void setup()
{
//set up a total of pins for digital input (has to match number of elements in array)
for(int i = 0; i < 4; i++)
pinMode(pinsIn[i], INPUT);
for (int i = 0; i < 4; i++) {
pinMode(pinsOut[i], OUTPUT);
digitalWrite(pinsOut[i], LOW);
}
//DEFAULT works with thermistors,
//INTERNAL with transitor thermostats
// ELLER var det tvartom???
analogReference(DEFAULT);
pinMode(A0, INPUT_PULLUP);
pinMode(A1, INPUT_PULLUP);
pinMode(A2, INPUT_PULLUP);
pinMode(A3, INPUT_PULLUP);
pinMode(A4, INPUT_PULLUP);
pinMode(A5, INPUT_PULLUP);
pinMode(A6, INPUT);
pinMode(A7, INPUT);
Serial.begin(115200); // perhaps use a faster baud rate
}
void loop()
{
Serial.print("knobs"); // use "knobs" as a keyword so you can receive
// the knob values as a list with a [r knobs] in Pd
for(int i = 0; i < 8; i++){
unsigned int knob = analogRead (pinsAnalog[i]);
Serial.print(" "); // first print a white space to separate the "knob" keyword from the values
// and the values from each other
Serial.print(knob); // then print the actual knob value
}
Serial.println(); // finally print a newline character to denote end of data for keyword "knobs"
// the same technique applies to the switches too
// receive the switch values as a list with [r switches]
Serial.print("switches");
for(int i = 0; i < 4; i++) {
int switchVal = digitalRead(pinsIn[i]);
Serial.print(" ");
Serial.print(switchVal);
}
Serial.println();
//handle digital outputs
if (Serial.available()) {
static int temp;
byte in = Serial.read();
if (isDigit(in)) {
temp = temp * 10 + in - '0';
}
else if (in == 'p') {
pin = temp;
temp = 0;
}
else if (in == 'v') {
val = temp;
temp = 0;
digitalWrite(pinsOut[pin], val);
}
}
}
and here is the code from tutorial5 from Arduino for Pd'ers. It goes with arduinoforpdrs_tut5.pd
// variables to hold pin numbers
int pwmLED = 9;
int dspLED = 2;
// variables to hold pin states
int pwmLEDvalue;
int dspLEDstate;
//variable to hold and assemble incoming data
int temporary;
void setup()
{
pinMode(pwmLED, OUTPUT);
pinMode(dspLED, OUTPUT);
Serial.begin(9600);
}
void loop()
{
while(Serial.available()){
byte inByte = Serial.read();
if((inByte >= '0') && (inByte <= '9'))
temporary = 10 * temporary + inByte - '0';
else{
if(inByte == 'p'){
pwmLEDvalue = temporary;
temporary = 0;
}
else if(inByte == 'd'){
dspLEDstate = temporary;
temporary = 0;
}
}
analogWrite(pwmLED, pwmLEDvalue);
digitalWrite(dspLED, dspLEDstate);
}
}
I am aiming at using same type of array handling as for the digital outs.
Thanks a lot
Ofelia - using addons, GL_TEXTURE_3D and binding openGL functions
i think i learned how to integrate addons (not everything is working yet...).
this is what i added to ofxOfeliaPdBindings.h to integrate ofxVolumetrics:
class pdTexture3d
{
public:
pdTexture3d(){};
void allocate(int w, int h, int d, int internalGlDataType)
{
texture3d.allocate(w, h, d, internalGlDataType);
}
void loadData(unsigned char * data, int w, int h, int d, int xOffset, int yOffset, int zOffset, int glFormat)
{
texture3d.loadData(data, w, h, d, xOffset, yOffset, zOffset, glFormat);
}
void loadData(float* data, int w, int h, int d, int xOffset, int yOffset, int zOffset, int glFormat)
{
texture3d.loadData(data, w, h, d, xOffset, yOffset, zOffset, glFormat);
}
void loadData(unsigned short* data, int w, int h, int d, int xOffset, int yOffset, int zOffset, int glFormat)
{
texture3d.loadData(data, w, h, d, xOffset, yOffset, zOffset, glFormat);
}
void loadData(ofPixels & pix, int d, int xOffset, int yOffset, int zOffset)
{
texture3d.loadData(pix, d, xOffset, yOffset, zOffset);
}
void loadData(ofShortPixels & pix, int d, int xOffset, int yOffset, int zOffset)
{
texture3d.loadData(pix, d, xOffset, yOffset, zOffset);
}
void loadData(ofFloatPixels & pix, int d, int xOffset, int yOffset, int zOffset)
{
texture3d.loadData(pix, d, xOffset, yOffset, zOffset);
}
void bind()
{
texture3d.bind();
}
void unbind()
{
texture3d.unbind();
}
void clear()
{
texture3d.clear();
}
ofxTextureData3d getTextureData()
{
return texture3d.getTextureData();
}
private:
ofxTexture3d texture3d;
};
class pdVolumetrics
{
public:
pdVolumetrics(){};
void setup(int w, int h, int d, ofVec3f voxelSize, bool usePowerOfTwoTexSize=false)
{
volumetrics.setup(w, h, d, voxelSize, usePowerOfTwoTexSize);
}
void destroy()
{
volumetrics.destroy();
}
void updateVolumeData(unsigned char * data, int w, int h, int d, int xOffset, int yOffset, int zOffset)
{
volumetrics.updateVolumeData(data, w, h, d, xOffset, yOffset, zOffset);
}
void drawVolume(float x, float y, float z, float size, int zTexOffset)
{
volumetrics.drawVolume(x, y, z, size, zTexOffset);
}
void drawVolume(float x, float y, float z, float w, float h, float d, int zTexOffset)
{
volumetrics.drawVolume(x, y, z, w, h, d, zTexOffset);
}
bool isInitialized()
{
return volumetrics.isInitialized();
}
int getVolumeWidth()
{
return volumetrics.getVolumeWidth();
}
int getVolumeHeight()
{
return volumetrics.getVolumeHeight();
}
int getVolumeDepth()
{
return volumetrics.getVolumeDepth();
}
ofFbo & getFboReference()
{
return volumetrics.getFboReference();
}
int getRenderWidth()
{
return volumetrics.getRenderWidth();
}
int getRenderHeight()
{
return volumetrics.getRenderHeight();
}
float getXyQuality()
{
return volumetrics.getXyQuality();
}
float getZQuality()
{
return volumetrics.getZQuality();
}
float getThreshold()
{
return volumetrics.getThreshold();
}
float getDensity()
{
return volumetrics.getDensity();
}
void setXyQuality(float q)
{
volumetrics.setXyQuality(q);
}
void setZQuality(float q)
{
volumetrics.setZQuality(q);
}
void setThreshold(float t)
{
volumetrics.setThreshold(t);
}
void setDensity(float d)
{
volumetrics.setDensity(d);
}
void setRenderSettings(float xyQuality, float zQuality, float dens, float thresh)
{
volumetrics.setRenderSettings(xyQuality, zQuality, dens, thresh);
}
void setVolumeTextureFilterMode(GLint filterMode)
{
volumetrics.setVolumeTextureFilterMode(filterMode);
}
private:
ofxVolumetrics volumetrics;
};
class pdImageSequencePlayer
{
public:
pdImageSequencePlayer(){};
void init(std::string prefix, int digits, std::string extension, int start)
{
imageSequencePlayer.init(prefix, digits, extension, start);
}
int getWidth()
{
return imageSequencePlayer.getWidth();
}
int getHeight()
{
return imageSequencePlayer.getHeight();
}
ofPixels_<unsigned char> getPixels()
{
return imageSequencePlayer.getPixels();
}
int getSequenceLength()
{
return imageSequencePlayer.getSequenceLength();
}
bool loadNextFrame()
{
return imageSequencePlayer.loadNextFrame();
}
bool loadPreviousFrame()
{
return imageSequencePlayer.loadPreviousFrame();
}
bool loadFrame(int n)
{
return imageSequencePlayer.loadFrame(n);
}
int getCurrentFrameNumber()
{
return imageSequencePlayer.getCurrentFrameNumber();
}
void setCurrentFrameNumber(int i)
{
imageSequencePlayer.setCurrentFrameNumber(i);
}
bool isInitialized()
{
return imageSequencePlayer.isInitialized();
}
private:
ofxImageSequencePlayer imageSequencePlayer;
};
CPU usage of idle patches, tabread4~?
@zigmhount said:
Good advice on the discontinuities. I was kind of hoping that [phasor~] would handle this better than restarting [line~] from 1 to 0, but I suppose that it also just jump from 1 to 0?
Yep. Regardless of whether you're using [line~] or [phasor~] to drive [tabread4~], discontinuities can happen anytime you abruptly jump from one spot to another. This isn't unique to Pd, if you perform edits to a waveform in any DAW without crossfades at the edit points, you will get clicks/pops (unless you get lucky & happen to edit at a zero crossing). So, if the first & last values stored in your array (loop) are not the same & the loop restarts (either beginning a new 0->1 ramp with [line~] or letting [phasor~] wrap around), you'll get a pop unless you use windowing.
In your example, you record the ramp up and ramp down into the array itself, right? Is that not audible when looping the same array over and over? Thanks to this ramp in the array, I guess that [tabread4~] may not click even if started without a volume ramp in, would it?
Yes indeed, that example essentially records the fade in/out into the array, so you wouldn't hear clicks when the loop wraps even without using a window with [tabread4~]. However, note that this is only one of the causes I mentioned... if you're eventually planning to add any playback controls with abrupt changes (such as pause/stop, start from the middle, rewind, jump to a new position, etc), you'll need a fade out before the change and a fade in after the change. FYI, my personal use for recording the fade into the array itself is because I sometimes use a phase vocoder for time stretching of my loops, which seems to misbehave if I have extreme values at the start/end of the array.
And, yes, the windowing can be audible, but it really depends on the nature of the audio that you're recording into the array. I randomly chose a 10ms fade in/out for the example above, but that could be any duration you like (you might want it to be adjustable if you're looping many different types of sounds, to experiment with shorter/longer fade times). There are also ways of shaping the curve of the fades if you really want to minimize their chances of being audible. But even if the fades are obvious, I think you'll still find them to be a million times less strident than a loud speaker pop.