Update of /cvsroot/pure-data/pd/extra/bonk~ In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2352/bonk~
Modified Files: Tag: branch-v0-39-2-extended bonk~.c Added Files: Tag: branch-v0-39-2-extended bonk~-help.pd Log Message: merged in pd/extra changes from MAIN/HEAD since the help files were missing in 0.39-2
--- NEW FILE: bonk~-help.pd --- #N canvas 193 43 967 599 10; #X obj 370 524 spigot; #X msg 442 397 bang; #X obj 429 488 bonk~; #X msg 442 214 learn 1; #X msg 442 274 learn 0; #X msg 437 456 print; #X obj 390 437 adc~; #X msg 614 538 ; pd dsp 1; #X obj 277 524 spigot; #N canvas 366 126 604 404 synth 0; #X obj 112 24 r bonk-cooked; #X obj 112 49 unpack; #X obj 112 99 * 12; #X obj 112 124 div 7; #X obj 112 74 + 1; #X obj 112 174 mtof; #X obj 112 224 osc~; #X obj 112 249 cos~; #X obj 112 149 + 47; #X obj 209 247 line~; #X obj 209 272 *~; #X obj 209 297 lop~ 500; #X obj 112 274 *~; #X obj 103 361 dac~; #X obj 253 165 dbtorms; #X obj 253 115 * 0.5; #X obj 253 140 + 50; #X obj 211 189 f; #X msg 173 159 bang; #X obj 258 83 inlet; #X obj 111 307 hip~ 5; #X msg 34 24 0 60; #X obj 112 199 sig~; #X msg 209 222 $1 , 0 200; #X connect 0 0 1 0; #X connect 1 0 4 0; #X connect 2 0 3 0; #X connect 3 0 8 0; #X connect 4 0 2 0; #X connect 5 0 18 0; #X connect 5 0 22 0; #X connect 6 0 7 0; #X connect 7 0 12 0; #X connect 8 0 5 0; #X connect 9 0 10 0; #X connect 9 0 10 1; #X connect 10 0 11 0; #X connect 11 0 12 1; #X connect 12 0 20 0; #X connect 14 0 17 1; #X connect 15 0 16 0; #X connect 16 0 14 0; #X connect 17 0 23 0; #X connect 18 0 17 0; #X connect 19 0 15 0; #X connect 20 0 13 1; #X connect 20 0 13 0; #X connect 21 0 1 0; #X connect 22 0 6 0; #X connect 23 0 9 0; #X restore 846 555 pd synth; #X floatatom 846 532 0 0 0 0 - - -; #X msg 846 502 0; #X msg 442 244 learn 10; #X msg 442 304 forget; #X msg 442 334 write templates.txt; #X msg 442 364 read templates.txt; #X msg 877 502 90; #X msg 442 81 thresh 6 50; #X text 8 56 The Bonk object takes an audio signal input and looks for "attacks" defined as sharp changes in the spectral envelope of the incoming sound. Optionally , and less reliably , you can have Bonk check the attack against a collection of stored templates to try to guess which of two or more instruments was hit. Bonk is described theoretically in the 1998 ICMC proceedings , reprinted on http://man104nfs.ucsd.edu/~mpuckett. ; #X text 602 504 click here; #X text 603 517 to start DSP; #X text 8 377 In this patch , after starting DSP , you can print out the raw or cooked output using the two "spigots" or listen to a synthesizer output by raising its volume.; #X text 747 501 output volume; #X text 761 519 (0-100); #X msg 442 150 mask 4 0.7; #X msg 442 184 debounce 0; #X text 8 309 Bonk's analysis is carried out on a 256-point window (6 msec at 44.1 kHz) and by default the analysis period is 128 samples. The analysis period can be specified as Bonk's creation argument but must be a multiple of 64; #X text 532 185 Minimum time (msec) between attacks; #X text 532 140 Describes how energy in each frequency band masks later energy in the band. Here the masking is total for 4 analysis periods and then drops by 0.7 each period.; #X text 530 214 Forget all templates and start learning new ones. The argument gives the number of times you will hit each instrument (10 recommended.) Turn on the output volume above for audible feedback as you train Bonk. "Learn 0" exits learn mode.; #X text 530 298 Forget the last template. In Learn mode , use "forget" to erase and record over a template.; #X text 595 334 Write templates to a file in text-editable format. ; #X text 596 364 Read templates from a file.; #X text 538 453 Print out all settings and templates.; #X msg 442 120 minvel 10; #X text 538 392 Poll the current spectrum via "raw" outlet , You can set a very high threshold if you don't want attacks mixed in.; #X msg 437 426 debug 0; #X text 538 426 turn debugging on or off.; #X obj 326 525 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 419 525 tgl 15 0 empty empty empty 0 -6 0 8 -262144 -1 -1 0 1; #X obj 370 554 print cooked; #X obj 277 554 print raw; #X text 253 490 enable printout:; #X text 533 121 Minimum "velocity" to output (quieter notes are ignored.) ; #X obj 462 513 s bonk-cooked; #X text 218 12 BONK~ - an attack detector for small percussion instruments ; #X text 8 174 Bonk's two outputs are the raw spectrum of the attack (provided as a list of 11 numbers giving the signal "loudness" in the 11 frequency bands used) , and the "cooked" output which gives only an instrument number (counting up from zero) and a "velocity". This "velocity" is the sum of the square roots of the amplitudes of the bands , normalized so that 100 is an attack of amplitude of about 1 The instrument number is significant only if Bonk has a "template set" in memory.; #X text 532 52 Set low and high thresholds. Signal growth must exceed the high one and then fall to the low one to make an attack. The unit is the sum of the proportional growth in the 11 filter bands. Proportional growth is essentially the logarithmic time derivative.; #X connect 0 0 40 0; #X connect 1 0 2 0; #X connect 2 0 8 0; #X connect 2 1 0 0; #X connect 2 1 44 0; #X connect 3 0 2 0; #X connect 4 0 2 0; #X connect 5 0 2 0; #X connect 6 0 2 0; #X connect 8 0 41 0; #X connect 10 0 9 0; #X connect 11 0 10 0; #X connect 12 0 2 0; #X connect 13 0 2 0; #X connect 14 0 2 0; #X connect 15 0 2 0; #X connect 16 0 10 0; #X connect 17 0 2 0; #X connect 24 0 2 0; #X connect 25 0 2 0; #X connect 34 0 2 0; #X connect 36 0 2 0; #X connect 38 0 8 1; #X connect 39 0 0 1;
Index: bonk~.c =================================================================== RCS file: /cvsroot/pure-data/pd/extra/bonk~/bonk~.c,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** bonk~.c 6 Nov 2004 16:07:22 -0000 1.3 --- bonk~.c 20 Apr 2007 03:33:44 -0000 1.3.6.1 *************** *** 951,956 **** void bonk_tilde_setup(void) { ! bonk_class = class_new(gensym("bonk~"), (t_newmethod)bonk_new, 0, ! sizeof(t_bonk), 0, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(bonk_class, nullfn, gensym("signal"), 0); class_addmethod(bonk_class, (t_method)bonk_dsp, gensym("dsp"), 0); --- 951,956 ---- void bonk_tilde_setup(void) { ! bonk_class = class_new(gensym("bonk~"), (t_newmethod)bonk_new, ! (t_method)bonk_free, sizeof(t_bonk), 0, A_DEFFLOAT, A_DEFFLOAT, 0); class_addmethod(bonk_class, nullfn, gensym("signal"), 0); class_addmethod(bonk_class, (t_method)bonk_dsp, gensym("dsp"), 0);