Skip to content

Commit

Permalink
dust
Browse files Browse the repository at this point in the history
  • Loading branch information
porres committed Aug 4, 2023
1 parent b5e2dad commit fd54de4
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Code_source/Compiled/signal/dust2~.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void dust2_seed(t_dust2 *x, t_symbol *s, int ac, t_atom *av){
}

static void dust2_ch(t_dust2 *x, t_floatarg f){
x->x_nchans = f < 1 ? 1 : (int)f;
x->x_ch = f < 1 ? 1 : (int)f;
canvas_update_dsp();
}

Expand Down
2 changes: 1 addition & 1 deletion Code_source/Compiled/signal/dust~.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static void dust_seed(t_dust *x, t_symbol *s, int ac, t_atom *av){
}

static void dust_ch(t_dust *x, t_floatarg f){
x->x_nchans = f < 1 ? 1 : (int)f;
x->x_ch = f < 1 ? 1 : (int)f;
canvas_update_dsp();
}

Expand Down
38 changes: 22 additions & 16 deletions Documentation/Help-files/dust2~-help.pd
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,6 @@
#X connect 12 0 4 0;
#X connect 13 0 5 0;
#X restore 478 253 pd seed;
#N canvas 777 84 346 340 multichannel 0;
#X obj 109 77 hsl 128 15 1 5000 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 106 106 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 190 107 density;
#X obj 106 231 else/out.mc~;
#X msg 170 161 ch 2;
#X msg 125 160 ch 1;
#X text 68 41 An example with multichannel support.;
#X obj 106 197 else/dust2~ -ch 2 50;
#X connect 0 0 1 0;
#X connect 1 0 7 0;
#X connect 4 0 7 0;
#X connect 5 0 7 0;
#X connect 7 0 3 0;
#X restore 430 277 pd multichannel;
#X obj 4 506 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 4 317 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 4 386 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
Expand All @@ -74,11 +59,32 @@
#X obj 6 422 cnv 3 550 3 empty empty flags 8 12 0 13 #dcdcdc #000000 0;
#X text 135 431 -seed <float>: seed value (default: unique internal);
#X text 217 343 - a float sets seed \, no float sets a unique internal;
#X text 145 360 mc <float>;
#X text 217 360 - set number of output channels;
#X text 147 447 -ch <float>: number of output channels (default 1);
#X text 218 396 - random impulses;
#X text 53 87 [dust~] is based on SuperCollider's "Dust2" UGEN and outputs random impulse values (from -1 to 1) at random times according to a density parameter. The difference to SuperCollider's is that it only produces actual impulses (one non zero value in between 0 valued samples). It has support for multichannel output., f 71;
#N canvas 494 125 607 338 multichannel 0;
#X obj 100 87 hsl 128 15 1 5000 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 97 116 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 181 117 density;
#X obj 97 241 else/out.mc~;
#X msg 161 161 ch 2;
#X msg 116 160 ch 1;
#X obj 405 217 else/out.mc~;
#X obj 405 134 else/sigs~ 1 11;
#X text 29 25 The -ch flag or message sets the number of output channels. This is only meaningful if you have a single channel input., f 42;
#X obj 405 179 else/dust2~ -ch 2 50;
#X obj 97 207 else/dust2~ -ch 2 50;
#X text 316 28 If you have a multichannel connection in the trigger inlet \, [dust2~] generates a signal with the same number of channels and the 'ch' message or flag is meaningless. The multichannel input is the density for each output., f 44;
#X connect 0 0 1 0;
#X connect 1 0 10 0;
#X connect 4 0 10 0;
#X connect 5 0 10 0;
#X connect 7 0 9 0;
#X connect 9 0 6 0;
#X connect 10 0 3 0;
#X restore 430 277 pd multichannel;
#X text 145 360 ch <float>;
#X connect 10 0 12 0;
#X connect 12 0 14 0;
#X connect 14 0 11 0;
65 changes: 33 additions & 32 deletions Documentation/Help-files/dust~-help.pd
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#N canvas 439 23 561 540 10;
#N canvas 481 51 560 535 10;
#X obj 218 173 hsl 128 15 1 5000 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 215 255 else/out~;
#X obj 3 4 cnv 15 301 42 empty empty dust~ 20 20 2 37 #e0e0e0 #000000 0;
Expand All @@ -15,25 +15,25 @@
#X obj 479 12 cnv 10 10 10 empty empty Locus 0 6 2 13 #7c7c7c #e0e4dc 0;
#X obj 465 27 cnv 10 10 10 empty empty ELSE 0 6 2 13 #7c7c7c #e0e4dc 0;
#X obj 93 41 cnv 4 4 4 empty empty impulses 0 28 2 18 #e0e0e0 #000000 0;
#X obj 4 510 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 4 508 cnv 15 552 21 empty empty empty 20 12 0 14 #e0e0e0 #202020 0;
#X obj 4 321 cnv 3 550 3 empty empty inlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 4 390 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 4 477 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 107 399 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 4 388 cnv 3 550 3 empty empty outlets 8 12 0 13 #dcdcdc #000000 0;
#X obj 4 475 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0;
#X obj 107 397 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X obj 106 330 cnv 17 3 50 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0;
#X text 169 399 signal;
#X text 177 486 1) float;
#X text 169 397 signal;
#X text 177 484 1) float;
#X obj 215 202 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 299 203 density;
#X text 218 330 - density (rate) of random impulses;
#X text 238 485 - density (default 0);
#X text 238 483 - density (default 0);
#X obj 215 228 else/dust~ 1;
#X text 133 331 float/signal;
#X text 133 347 seed <float>;
#X text 40 247 see also:;
#X obj 37 269 else/dust2~;
#X obj 6 426 cnv 3 550 3 empty empty flags 8 12 0 13 #dcdcdc #000000 0;
#X text 135 435 -seed <float>: seed value (default: unique internal);
#X obj 6 424 cnv 3 550 3 empty empty flags 8 12 0 13 #dcdcdc #000000 0;
#X text 135 433 -seed <float>: seed value (default: unique internal);
#X text 217 347 - a float sets seed \, no float sets a unique internal;
#N canvas 777 84 466 384 seed 0;
#X text 64 15 Pseudo random number generators aren't true random number generators. Instead \, an algorithm is used to provide a sequence of numbers that seems random. The same sequence can be reproduced if you set a "seed" value \, which can be any integer number., f 57;
Expand All @@ -59,31 +59,32 @@
#X connect 11 0 4 0;
#X connect 12 0 5 0;
#X restore 481 254 pd seed;
#X text 218 400 - random positive impulses;
#N canvas 668 95 516 377 multichannel 0;
#X obj 78 77 hsl 128 15 1 5000 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 75 106 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 159 107 density;
#X obj 75 231 else/out.mc~;
#X msg 139 161 ch 2;
#X msg 94 160 ch 1;
#X obj 75 197 else/dust~ -ch 2 50;
#X text 37 41 An example with multichannel support.;
#X obj 303 208 else/out.mc~;
#X obj 303 170 else/dust~ -ch 2 50;
#X obj 303 125 else/sigs~ 1 11;
#X text 218 398 - random positive impulses;
#N canvas 494 125 607 338 multichannel 0;
#X obj 100 87 hsl 128 15 1 5000 1 0 empty empty empty -2 -8 0 10 #dcdcdc #000000 #000000 0 1;
#X obj 97 116 nbx 8 14 -1e+37 1e+37 0 0 empty empty empty 0 -8 0 10 #dcdcdc #000000 #000000 0 256;
#X text 181 117 density;
#X obj 97 241 else/out.mc~;
#X msg 161 161 ch 2;
#X msg 116 160 ch 1;
#X obj 405 217 else/out.mc~;
#X obj 405 179 else/dust~ -ch 2 50;
#X obj 405 134 else/sigs~ 1 11;
#X obj 97 207 else/dust~ -ch 2 50;
#X text 29 25 The -ch flag or message sets the number of output channels. This is only meaningful if you have a single channel input., f 42;
#X text 316 28 If you have a multichannel connection in the trigger inlet \, [dust~] generates a signal with the same number of channels and the 'ch' message or flag is meaningless. The multichannel input is the density for each output., f 44;
#X connect 0 0 1 0;
#X connect 1 0 6 0;
#X connect 4 0 6 0;
#X connect 5 0 6 0;
#X connect 6 0 3 0;
#X connect 9 0 8 0;
#X connect 10 0 9 0;
#X connect 1 0 9 0;
#X connect 4 0 9 0;
#X connect 5 0 9 0;
#X connect 7 0 6 0;
#X connect 8 0 7 0;
#X connect 9 0 3 0;
#X restore 433 280 pd multichannel;
#X text 145 364 mc <float>;
#X text 217 364 - set number of output channels;
#X text 53 95 [dust~] is based on SuperCollider's "Dust" UGEN and outputs random impulse values (only positive values up to 1) at random times according to a density parameter. The difference to SuperCollider's is that it only produces actual impulses (one non zero value in between 0 valued samples). It has support for multichannel output., f 71;
#X text 147 451 -ch <float>: number of output channels (default 1);
#X text 147 449 -ch <float>: number of output channels (default 1);
#X text 145 363 ch <float>;
#X text 217 362 - set number of output channels;
#X connect 0 0 20 0;
#X connect 20 0 24 0;
#X connect 24 0 1 0;

0 comments on commit fd54de4

Please sign in to comment.