looking for velvet noise generator
As I was imagining, as a C code, this is all hassle free, very simple, and never misses a period. And the code is pretty simple. And Multichannel capable
So far this is what I have....
// Porres 2024
#include "m_pd.h"
#include <stdlib.h>
#include "random.h"
#define MAXLEN 1024
typedef struct _velvet{
t_object x_obj;
double *x_phase;
double *x_lastphase;
t_random_state x_rstate;
int x_id;
t_float *x_rand;
int x_nchans;
t_float x_hz;
t_int x_n;
t_int x_ch2;
t_int x_ch3;
t_inlet *x_inlet_reg;
t_inlet *x_inlet_bias;
t_outlet *x_outlet;
double x_sr_rec;
}t_velvet;
static t_class *velvet_class;
static void velvet_seed(t_velvet *x, t_symbol *s, int ac, t_atom *av){
random_init(&x->x_rstate, get_seed(s, ac, av, x->x_id));
}
static t_int *velvet_perform(t_int *w){
t_velvet *x = (t_velvet *)(w[1]);
t_float *in1 = (t_float *)(w[2]);
// t_float *in2 = (t_float *)(w[3]); // bias placeholder
// t_float *in3 = (t_float *)(w[4]); // regularity placeholder
t_float *out = (t_float *)(w[5]);
double phase = x->x_phase;
double lastphase = x->x_lastphase;
for(int j = 0; j < x->x_nchans; j++){
for(int i = 0, n = x->x_n; i < n; i++){
double hz = in1[jn + i];
double step = hz * x->x_sr_rec; // phase step
step = step > 1 ? 1 : step < 0 ? 0 : step; // clipped phase_step
out[jn + i] = ((phase[j] + x->x_rand[j]) >= 1.) && ((lastphase[j] + x->x_rand[j]) < 1.);
if(phase[j] >= 1.){
uint32_t *s1 = &x->x_rstate.s1;
uint32_t *s2 = &x->x_rstate.s2;
uint32_t *s3 = &x->x_rstate.s3;
x->x_rand[j] = (t_float)(random_frand(s1, s2, s3)) * 0.5 + 0.5;
post("phase = %f", phase[j]);
post("random = %f", x->x_rand[j]);
phase[j] -= 1; // wrapped phase
}
lastphase[j] = phase[j];
phase[j] += step;
}
}
x->x_phase = phase;
x->x_lastphase = lastphase;
return(w+6);
}
static void velvet_dsp(t_velvet *x, t_signal **sp){
x->x_n = sp[0]->s_n, x->x_sr_rec = 1.0 / (double)sp[0]->s_sr;
int chs = sp[0]->s_nchans;
x->x_ch2 = sp[1]->s_nchans, x->x_ch3 = sp[2]->s_nchans;
if(x->x_nchans != chs){
x->x_lastphase = (double *)resizebytes(x->x_lastphase,
x->x_nchans * sizeof(double), chs * sizeof(double));
x->x_phase = (double *)resizebytes(x->x_phase,
x->x_nchans * sizeof(double), chs * sizeof(double));
x->x_rand = (t_float )resizebytes(x->x_rand,
x->x_nchans * sizeof(t_float), chs * sizeof(t_float));
x->x_nchans = chs;
}
signal_setmultiout(&sp[3], x->x_nchans);
if((x->x_ch2 > 1 && x->x_ch2 != x->x_nchans)
|| (x->x_ch3 > 1 && x->x_ch3 != x->x_nchans)){
dsp_add_zero(sp[3]->s_vec, x->x_nchansx->x_n);
pd_error(x, "[velvet~]: channel sizes mismatch");
return;
}
dsp_add(velvet_perform, 5, x, sp[0]->s_vec,
sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec);
}
static void *velvet_free(t_velvet *x){
inlet_free(x->x_inlet_bias);
inlet_free(x->x_inlet_reg);
outlet_free(x->x_outlet);
freebytes(x->x_phase, x->x_nchans * sizeof(*x->x_phase));
freebytes(x->x_lastphase, x->x_nchans * sizeof(*x->x_lastphase));
freebytes(x->x_rand, x->x_nchans * sizeof(*x->x_rand));
return(void *)x;
}
static void *velvet_new(t_symbol *s, int ac, t_atom *av){
s = NULL;
t_velvet *x = (t_velvet *)pd_new(velvet_class);
x->x_id = random_get_id();
x->x_phase = (double *)getbytes(sizeof(*x->x_phase));
x->x_lastphase = (double *)getbytes(sizeof(*x->x_lastphase));
x->x_rand = (t_float *)getbytes(sizeof(*x->x_rand));
x->x_hz = x->x_phase[0] = x->x_lastphase[0] = x->x_rand[0] = 0;
velvet_seed(x, s, 0, NULL);
if(ac){
while(av->a_type == A_SYMBOL){
if(ac >= 2 && atom_getsymbol(av) == gensym("-seed")){
t_atom at[1];
SETFLOAT(at, atom_getfloat(av+1));
ac-=2, av+=2;
velvet_seed(x, s, 1, at);
}
else
goto errstate;
}
if(ac && av->a_type == A_FLOAT){
x->x_hz = av->a_w.w_float;
ac--, av++;
}
}
x->x_inlet_bias = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
pd_float((t_pd *)x->x_inlet_bias, 0);
x->x_inlet_reg = inlet_new((t_object *)x, (t_pd *)x, &s_signal, &s_signal);
pd_float((t_pd *)x->x_inlet_reg, x->x_phase[0]);
x->x_outlet = outlet_new(&x->x_obj, &s_signal);
return(x);
errstate:
post("[velvet~]: improper args");
return(NULL);
}
void velvet_tilde_setup(void){
velvet_class = class_new(gensym("velvet~"), (t_newmethod)velvet_new, (t_method)velvet_free,
sizeof(t_velvet), CLASS_MULTICHANNEL, A_GIMME, 0);
CLASS_MAINSIGNALIN(velvet_class, t_velvet, x_hz);
class_addmethod(velvet_class, (t_method)velvet_dsp, gensym("dsp"), A_CANT, 0);
class_addmethod(velvet_class, (t_method)velvet_seed, gensym("seed"), A_GIMME, 0);
}
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!
How to loop/reset an audio file to the beginning
@KMETE Requoting myself: "To crossfade properly, it needs to subtract 100 ms from the file's total duration."
Let's say you have 10 seconds of audio.
You want to loop it, with a 100 ms crossfade.
If you just use "all" then it will do this:
- Start at 0 and play to 10 sec.
- Loop back to 0.
- At this point, for a cross fade, the step 2 audio fades in, and the step 1 audio fades out. But step 1 has already run out of audio.
So at that point, you don't get a cross fade. You get an immediate jump to silence (maybe with a click), and then a fade in.
It "seems to work" in that there is no error, nothing crashes, no major audio glitches. But it isn't crossfade looping.
The solution here changes it to:
- Start at 0 and play to 9.9 sec.
- Loop back to 0.
- At this point, the step 2 audio fades in, and the step 1 audio fades out over the range 9.9 - 10 sec = clean crossfade.
But if you're happy without a proper crossfade, then by all means, do what you feel is best.
At this point, with apologies, I need to withdraw from the thread. I've already spent much more time on it than I expected, and the follow-up questions are becoming a bit like... not the best use of time. Like, I'm getting ready to shoot a YouTube tutorial on Pd external sync, and instead of working on those materials, I was explaining crossfading here. I think I need to strike a better balance.
hjh
Ofelia - VideoPlayback
Hello.
I am using Ofelia as videoPlayer.
I need to play my video file whitch is atm uncompresed 2GB, 30 min long art show with 5 channel sound and i am tracking current frame with "getCurrentFrame();.
Video starts playing but when i try to "setPosition(); or any other move to control video flow all PureData Frezzes.
Works fine on examples (short) videos.
Is there any way how to workaround this? I am not sure i can render video again. It is 3 years old and to this moment i was using VVVV to play it. But it stope working for Alohomora reason.
Also VVVV suck.
thank you very much for any help.
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.
Contribute to better Pd Documentation
@porres "but are you counting the help files of dozens of libraries it had?"
No, the extended doc only referenced the vanilla objects.
Help for externals was contained within their folders in the relevant "extra" folders..... hence the problems people sometimes have with missing help files for external single binaries.
But the doc Pd/doc/5.reference had more elaborated help files .
Hava a look...... ext_v_vanilla example-route.zip
With hyperlinks and demonstrative subpatches.... a massive amount of rewriting had been done already...... now lost to anyone without Extended on their computer. It was called the "PDDP Project".
The extended help files were also better formatted and so "prettier"........ although opening the extended help-file in vanilla will not render the patch as "prettily" as extended you will still see the difference.
There was a PDDP style guide and a css style sheet associated in extended...... pddp.zip
In the vanilla help files some essential information about vanilla objects is also missing..... see conversations I have had with @ddw_music recently on this forum.
If I get time this weekend I will search for them and post a summary.
David.
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