Skip to content

Commit

Permalink
Added trigger message.
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Nonis committed May 1, 2019
1 parent 635c964 commit 76a8282
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 65 deletions.
135 changes: 70 additions & 65 deletions brds/brds~-help.pd
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
#N canvas 474 24 691 517 10;
#X obj 142 446 dac~;
#X obj 336 45 vsl 15 128 0 1 0 1 empty empty vol 0 -9 0 10 -262144
-1 -1 900 1;
#X obj 142 416 *~;
#X obj 141 340 brds~;
#X obj 141 45 vsl 15 128 36 88 0 0 empty empty pitch 0 -9 0 10 -262144
#X obj 160 446 dac~;
#X obj 354 45 vsl 15 128 0 1 0 1 empty empty vol 0 -9 0 10 -262144
-1 -1 0 1;
#X msg 141 247 pitch \$1;
#X obj 72 45 vsl 15 128 0 1 0 0 empty empty shape 0 -9 0 10 -262144
-1 -1 0 1;
#X msg 72 182 shape \$1;
#X obj 212 45 vsl 15 128 0 1 0 0 empty empty timbre 0 -9 0 10 -262144
-1 -1 5800 1;
#X msg 212 182 timbre \$1;
#X obj 141 203 * 128;
#X obj 141 181 - 63;
#X obj 141 225 + 8252;
#X obj 280 45 vsl 15 128 0 1 0 0 empty empty colour 0 -9 0 10 -262144
-1 -1 9000 1;
#X msg 280 182 colour \$1;
#X obj 160 416 *~;
#X obj 159 340 brds~;
#X obj 159 45 vsl 15 128 36 88 0 0 empty empty pitch 0 -9 0 10 -262144
-1 -1 7200 1;
#X msg 159 247 pitch \$1;
#X obj 90 45 vsl 15 128 0 1 0 0 empty empty shape 0 -9 0 10 -262144
-1 -1 9700 1;
#X msg 90 182 shape \$1;
#X obj 230 45 vsl 15 128 0 1 0 0 empty empty timbre 0 -9 0 10 -262144
-1 -1 5500 1;
#X msg 230 182 timbre \$1;
#X obj 159 203 * 128;
#X obj 159 181 - 63;
#X obj 159 225 + 8252;
#X obj 298 45 vsl 15 128 0 1 0 0 empty empty colour 0 -9 0 10 -262144
-1 -1 5500 1;
#X msg 298 182 colour \$1;
#N canvas 0 22 450 278 (subpatch) 0;
#X array scope 256 float 1;
#A 0 0.0172577 0.0173035 0.017395 0.0174561 0.0175476 0.0175934 0.0177002
0.0177917 0.0178528 0.0179443 0.0179901 0.0180969 0.0181427 0.0182495
0.0182953 0.0183868 0.0184479 0.0185394 0.0185852 0.018692 0.0187378
0.0188446 0.0188904 0.0189819 0.019043 0.0191345 0.0191803 0.0192871
0.0193329 0.0194397 0.0194855 0.019577 0.0196838 0.0197296 0.0198364
0.0198822 0.0199738 0.0200348 0.0201263 0.0201721 0.0202789 0.0203247
0.0204315 0.0204773 0.0205688 0.0206299 0.0207214 0.0207672 0.020874
0.0209198 0.0210266 0.0210724 0.0211639 0.021225 0.0213165 0.0213623
0.0214691 0.0215149 0.0216217 0.0217133 0.021759 0.0218658 0.0219116
0.0220184 0.0220642 0.0221558 0.0222168 0.0223083 0.0223541 0.0224609
0.0225067 0.0226135 0.0226593 0.0227509 0.0228119 0.0229034 0.0229492
0.023056 0.0231018 0.0232086 0.0232544 0.0233459 0.023407 0.0234985
0.0235443 0.0236511 0.0237427 0.0238037 0.0238953 0.023941 0.0240479
0.0240936 0.0242004 0.0242462 0.0243378 0.0243988 0.0244904 0.0245361
0.0246429 0.0246887 0.0247955 0.0248413 0.0249329 0.0249939 0.0250854
0.0251312 0.025238 0.0252838 0.0253906 0.0254364 0.025528 0.025589
0.0256805 0.0257874 0.0258331 0.0259247 0.0259857 0.0260773 0.026123
0.0262299 0.0262756 0.0263824 0.0264282 0.0265198 0.0265808 0.0266724
0.0267181 0.026825 0.0268707 0.0269775 0.0270233 0.0271149 0.0271759
0.0272675 0.0273132 0.02742 0.0274658 0.0275726 0.0276642 0.02771 0.0278168
0.0278625 0.0279694 0.0280151 0.0281067 0.0281677 0.0282593 0.0283051
0.0284119 0.0284576 0.0285645 0.0286102 0.0287018 0.0287628 0.0288544
0.0289001 0.029007 0.0290527 0.0291595 0.0292053 0.0292969 0.0293579
0.0294495 0.0294952 0.0296021 0.0296936 0.0297546 0.0298462 0.029892
0.0299988 0.0300446 0.0301514 0.0301971 0.0302887 0.0303497 0.0304413
0.0304871 0.0305939 0.0306396 0.0307465 0.0307922 0.0308838 0.0309448
0.0310364 0.0310822 0.031189 0.0312347 0.0313416 0.0313873 0.0314789
0.0315399 0.0316315 0.0317383 0.0317841 0.0318756 0.0319366 0.0320282
0.032074 0.0321808 0.0322266 0.0323334 0.0323792 0.0324707 0.0325317
0.0326233 0.0326691 0.0327759 0.0328217 0.0329285 0.0329742 0.0330658
0.0331268 0.0332184 0.0332642 0.033371 0.0334167 0.0335236 0.0335693
0.0336609 0.0337677 0.0338135 0.0339203 0.0339661 0.0340576 0.0341187
0.0342102 0.034256 0.0343628 0.0344086 0.0345154 0.0345612 0.0346527
0.0347137 0.0348053 0.0348511 0.0349579 0.0350037 0.0351105 0.0351562
0.0352478 0.0353088 0.0354004 0.0354462 0.035553 0.0356445 0.0357056
0.0357971 0.0358429 0.0359497 0.0359955 0.0361023 0.0361481 0.0362396
0.0363007 0.0363922 0.036438;
#A 0 0.0144348 0.0164032 0.0183411 0.0202789 0.0222015 -0.0693054 -0.0661621
-0.0630341 -0.0605316 -0.0580597 -0.0555878 -0.0531311 -0.0498657 -0.0480804
-0.0462952 -0.0445404 -0.0427856 -0.0410309 -0.0393066 -0.0434723 -0.0416718
-0.0399017 -0.0381317 -0.036377 -0.0346527 -0.0329132 -0.0312042 0.0915833
0.0916595 0.0917053 0.0917358 0.0917664 0.0917816 0.0917816 0.103165
0.102356 0.101547 0.100739 0.0999146 0.0990906 0.0982666 0.0675354
0.0664673 0.0647888 0.0630798 0.0613861 0.0596924 0.0579987 0.0290985
0.027771 0.0264587 0.0251465 0.0238342 0.022522 0.0212097 -0.059494
-0.0591125 -0.0587311 -0.0583344 -0.0579529 -0.0575714 -0.0571899 0.115112
0.11319 0.111267 0.109955 0.108658 0.107346 0.106033 -0.0333405 -0.0327911
-0.0322723 -0.0317383 -0.0312042 -0.0306702 -0.0301361 0.055954 0.0553284
0.0547028 0.0540771 0.0534363 0.0528107 0.0521698 0.0636749 0.0628662
0.0620728 0.061264 0.0604401 0.059021 0.0576019 0.00895691 0.00817871
0.00738525 0.00662231 0.00584412 0.00509644 0.0043335 0.10791 0.105759
0.102982 0.10022 0.0974731 0.0947266 0.0919952 0.0164795 0.0153809
0.0142822 0.0131836 0.0121002 0.0110168 0.0105743 -0.0174103 -0.0175018
-0.0175781 -0.0176392 -0.0177002 -0.017746 -0.0177917 0.0379486 0.0371552
0.036377 0.0355835 0.0341797 0.0327911 0.0314178 -0.0452271 -0.0449677
-0.044693 -0.0444031 -0.0441284 -0.0438385 -0.0435486 -0.105301 -0.104172
-0.103043 -0.101898 -0.100754 -0.0996094 -0.0984802 0.0369415 0.0362854
0.0356445 0.035614 0.0355835 0.0355682 0.0355377 -0.11586 -0.113846
-0.111862 -0.109848 -0.107849 -0.105865 -0.103882 -0.107269 -0.105209
-0.103165 -0.101105 -0.0990753 -0.0970306 -0.0950012 0.0617371 0.0616913
0.061615 0.061554 0.0614777 0.0614014 0.0606995 0.053421 0.0528107
0.0521851 0.0515747 0.0509644 0.0503387 0.0497131 -0.0987854 -0.0974121
-0.0960388 -0.0946808 -0.0926971 -0.0907135 -0.0887604 -0.0389862 -0.037674
-0.0363617 -0.0350647 -0.0343933 -0.0343475 -0.0342865 0.117981 0.115997
0.114014 0.11203 0.110046 0.108063 0.106094 0.0653534 0.0639038 0.0624542
0.0616302 0.0608215 0.0599976 0.0591888 -0.0790558 -0.0780334 -0.0769958
-0.0759735 -0.0749359 -0.0739136 -0.0728912 0.0765381 0.0749512 0.0733643
0.0717621 0.0701904 0.0685883 0.0670166 -0.0986328 -0.0980072 -0.0973511
-0.0967102 -0.0960541 -0.0953979 -0.0947418 0.0207214 0.0198517 0.0189819
0.0181122 0.0172577 0.0170288 0.0174103 0.0750427 0.074646 0.0742645
0.0738678 0.0734711 0.072464 0.0714417 -0.100082 -0.0988007 -0.0975189
-0.0962372 -0.0949554 -0.093689 -0.0924225 0.00750732 0.00746155 0.00740051
0.00735474 0.00730896 0.00726318 0.00721741 -0.000671387 -0.000610352
-0.000549316 -0.000488281 -0.000427246;
#X coords 0 1 255 -1 200 140 1 0 0;
#X restore 389 241 graph;
#X obj 188 394 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
#X restore 407 241 graph;
#X obj 206 394 tgl 15 1 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 188 416 metro 100;
#X symbolatom 321 242 10 0 0 0 - - -, f 10;
#X obj 189 448 tabwrite~ scope;
#X obj 206 416 metro 100;
#X symbolatom 339 242 10 0 0 0 - - -, f 10;
#X obj 207 448 tabwrite~ scope;
#N canvas 225 104 482 368 sequencer 0;
#X obj 34 85 tgl 15 0 empty empty start 17 7 0 10 -262144 -1 -1 0 1
;
Expand All @@ -82,15 +82,15 @@
#X obj 225 257 f;
#X obj 297 174 select 0 1 2 3 4 5 6 7;
#X obj 35 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 5000 1;
-1 -1 0 1;
#X obj 65 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 6300 1;
-1 -1 0 1;
#X obj 95 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 123 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 151 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 7600 1;
-1 -1 0 1;
#X obj 180 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
-1 -1 0 1;
#X obj 211 114 vsl 15 128 0 127 0 0 empty empty empty 0 -9 0 10 -262144
Expand Down Expand Up @@ -143,7 +143,10 @@
#X connect 27 0 1 1;
#X connect 28 0 24 1;
#X coords 0 -1 1 1 250 180 2 20 70;
#X restore 390 35 pd sequencer;
#X restore 408 35 pd sequencer;
#X obj 16 140 bng 35 250 50 0 empty empty trigger 0 -8 0 10 -262144
-1 -1;
#X msg 16 182 trigger 1;
#X connect 1 0 2 1;
#X connect 2 0 0 0;
#X connect 2 0 0 1;
Expand All @@ -164,3 +167,5 @@
#X connect 16 0 17 0;
#X connect 17 0 19 0;
#X connect 20 0 4 0;
#X connect 21 0 22 0;
#X connect 22 0 3 0;
8 changes: 8 additions & 0 deletions brds/brds~.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ extern "C" {
void brds_tilde_shape(t_brds_tilde *x, t_floatarg f);
void brds_tilde_colour(t_brds_tilde *x, t_floatarg f);
void brds_tilde_timbre(t_brds_tilde *x, t_floatarg f);
void brds_tilde_trigger(t_brds_tilde *x, t_floatarg f);
}

static const char *algo_values[] = {
Expand Down Expand Up @@ -372,6 +373,10 @@ void brds_tilde_timbre(t_brds_tilde *x, t_floatarg f)
{
x->f_timbre = f;
}
void brds_tilde_trigger(t_brds_tilde *x, t_floatarg f)
{
x->trigger_flag = f >= 1;
}

void brds_tilde_setup(void) {
brds_tilde_class = class_new(gensym("brds~"),
Expand Down Expand Up @@ -399,6 +404,9 @@ void brds_tilde_setup(void) {
class_addmethod(brds_tilde_class,
(t_method) brds_tilde_timbre, gensym("timbre"),
A_DEFFLOAT, A_NULL);
class_addmethod(brds_tilde_class,
(t_method) brds_tilde_trigger, gensym("trigger"),
A_DEFFLOAT, A_NULL);
}
// puredata methods implementation - end

0 comments on commit 76a8282

Please sign in to comment.