Commit 28e171df authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'dac-send-method'

parents c6e1d3a6 67d570f6
Pipeline #2197 passed with stage
in 248 minutes and 44 seconds
#N canvas 428 35 558 622 10;
#N canvas 87 66 558 622 10;
#X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header adc~ 3 12 0 18 -204280
-1 0;
#X obj 0 292 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
#X obj 0 252 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
-228856 -1 0;
#N canvas 581 390 397 242 META 0;
#X text 12 105 LIBRARY internal;
......@@ -19,13 +19,13 @@ Wilkes revised the patch to conform to the PDDP template for Pd version
#X text 12 85 OUTLET_N signal;
#X text 12 165 RELEASE_DATE 1997;
#X restore 501 597 pd META;
#X obj 0 329 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
#X obj 0 324 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
13 -228856 -1 0;
#X obj 0 421 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
0 13 -228856 -1 0;
#X obj 0 508 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
0 13 -228856 -1 0;
#X obj 79 301 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
#X obj 79 261 cnv 17 3 17 empty \$0-pddp.cnv.let.0 0 5 9 0 16 -228856
-162280 0;
#N canvas 216 458 428 173 Related_objects 0;
#X obj 22 43 dac~;
......@@ -41,20 +41,20 @@ Wilkes revised the patch to conform to the PDDP template for Pd version
#X obj 19 102 pddp/helplink pdogg/oggcast~;
#X obj 19 122 pddp/helplink unauthorized/mp3cast~;
#X text 18 143 [shoutcast~] (What library is this object in?);
#X text 18 55;
#X text 18 55 comment;
#X obj 119 43 block~;
#X restore 102 597 pd Related_objects;
#X obj 510 11 adc~;
#X text 99 338 signal;
#X obj 79 338 cnv 17 3 70 empty \$0-pddp.cnv.let.n n 5 9 0 16 -228856
#X text 99 333 signal;
#X obj 79 333 cnv 17 3 80 empty \$0-pddp.cnv.let.n n 5 9 0 16 -228856
-162280 0;
#X obj 86 59 adc~;
#X obj 86 191 adc~ 5;
#X text 144 192 a mono signal from channel 5;
#X obj 86 222 adc~ 1 3 8 6 11 15 19 22 23 24 36;
#X text 360 223 11 channels of audio;
#X obj 86 252 adc~ 1 2 3 4 5 6 7 8;
#X text 257 253 all channels on an 8-channel device;
#X obj 86 171 adc~ 5;
#X text 144 172 a mono signal from channel 5;
#X obj 86 197 adc~ 1 3 8 6 11 15 19 22 23 24 36;
#X text 360 198 11 channels of audio;
#X obj 86 222 adc~ 1 2 3 4 5 6 7 8;
#X text 257 223 all channels on an 8-channel device;
#X text 130 59 default stereo signals: same as:;
#X obj 332 60 adc~ 1 2;
#X text 168 438 - the object defaults to 2 incoming audio channels
......@@ -62,20 +62,18 @@ Wilkes revised the patch to conform to the PDDP template for Pd version
can be used to define one or multiple input channels - each integer
corresponds to an input channel on your audio hardware.;
#X text 80 438 n) float;
#X text 169 338 - the number of outlets corresponds with the number
#X text 169 333 - the number of outlets corresponds with the number
of arguments - each outlet represents an input channel on your audio
hardware which corresponds to the argument you provide. If no arguments
are provided \, then there are two outlets which represent audio channels
1 and 2 on your computers sound card.;
#X obj 87 103 env~;
#X floatatom 87 151 5 0 0 0 - - -, f 5;
#X obj 87 127 spigot;
#X obj 150 104 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
#X obj 86 88 env~;
#X floatatom 86 136 5 0 0 0 - - -, f 5;
#X obj 86 112 spigot;
#X obj 149 89 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0
1;
#X text 180 104 <- Click to get amplitude of channel 1;
#X text 130 151 RMS amplitude (dB);
#X text 169 300 - the inlet to [adc~] is not used.;
#X text 99 300 (inactive);
#X text 179 89 <- Click to get amplitude of channel 1;
#X text 129 136 RMS amplitude (dB);
#X obj 5 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide
;
#X obj 455 51 pddp/dsp;
......@@ -140,7 +138,15 @@ switch \, or disable both using the "-nosound" switch.;
#X text 7 2 [dac~] -nodac and -noadc;
#X restore 102 567 pd defeating_audio_computation;
#X text 12 23 audio input;
#X text 99 262 set;
#X text 169 262 - the set message to the left inlet will reset the
channel or channels to the ones specified in the arguments. This requires
DSP to restart and should only be done at setup time \, not while the
audio is being computed.;
#X obj 421 152 adc~ 1;
#X msg 421 128 set 2;
#X connect 12 0 24 0;
#X connect 24 0 26 0;
#X connect 26 0 25 0;
#X connect 27 0 26 1;
#X connect 39 0 38 0;
#N canvas 429 36 555 619 10;
#N canvas 67 66 555 619 10;
#X obj 0 595 cnv 15 552 21 empty \$0-pddp.cnv.footer empty 20 12 0
14 -228856 -66577 0;
#X obj 0 0 cnv 15 552 40 empty \$0-pddp.cnv.header dac~ 3 12 0 18 -204280
-1 0;
#X obj 0 259 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
#X obj 0 226 cnv 3 550 3 empty \$0-pddp.cnv.inlets inlets 8 12 0 13
-228856 -1 0;
#N canvas 482 289 494 344 META 0;
#X text 12 85 LIBRARY internal;
......@@ -18,13 +18,13 @@ Wilkes revised the patch to conform to the PDDP template for Pd version
#X text 12 65 INLET_n signal;
#X text 12 145 RELEASE_DATE 1997;
#X restore 500 597 pd META;
#X obj 0 355 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
#X obj 0 381 cnv 3 550 3 empty \$0-pddp.cnv.outlets outlets 8 12 0
13 -228856 -1 0;
#X obj 0 383 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
#X obj 0 403 cnv 3 550 3 empty \$0-pddp.cnv.argument arguments 8 12
0 13 -228856 -1 0;
#X obj 0 471 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
#X obj 0 499 cnv 3 550 3 empty \$0-pddp.cnv.more_info more_info 8 12
0 13 -228856 -1 0;
#X obj 78 268 cnv 17 3 17 empty \$0-pddp.cnv.let.n n 5 9 0 16 -228856
#X obj 78 235 cnv 17 3 17 empty \$0-pddp.cnv.let.n n 5 9 0 16 -228856
-162280 0;
#N canvas 220 454 428 171 Related_objects 0;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
......@@ -43,27 +43,27 @@ Wilkes revised the patch to conform to the PDDP template for Pd version
#X obj 183 100 mp3cast~;
#X restore 101 597 pd Related_objects;
#X obj 508 10 dac~;
#X text 109 133 default stereo signals: same as;
#X text 198 221 all channels on an 8-channel device;
#X obj 65 133 dac~;
#X obj 367 135 dac~ 1 2;
#X obj 65 160 dac~ 5;
#X text 123 159 a mono signal to channel 5;
#X obj 65 191 dac~ 1 3 8 6 11 15 19 22 23 24 36;
#X text 280 191 11 channels of output;
#X obj 65 221 dac~ 1 2 3 4 5 6 7 8;
#X text 98 359 (none);
#X text 98 267 signal;
#X text 168 401 - the object defaults to 2 outgoing audio channels
#X text 110 127 default stereo signals: same as;
#X text 199 202 all channels on an 8-channel device;
#X obj 66 127 dac~;
#X obj 318 127 dac~ 1 2;
#X obj 66 151 dac~ 5;
#X text 124 150 a mono signal to channel 5;
#X obj 66 177 dac~ 1 3 8 6 11 15 19 22 23 24 36;
#X text 281 177 11 channels of output;
#X obj 66 202 dac~ 1 2 3 4 5 6 7 8;
#X text 98 385 (none);
#X text 98 234 signal;
#X text 168 421 - the object defaults to 2 outgoing audio channels
(usually a left and right stereo pair). Any number of arguments (integers)
can be used to define multiple output channels - each integer corresponds
to an output channel on your audio hardware.;
#X text 168 267 - the number of inlets correspond with the number of
#X text 168 234 - the number of inlets correspond with the number of
arguments - each inlet represents an output channel on your audio hardware
which corresponds to the argument you provide. If no arguments are
provided \, then there are two inlets which represent audio channels
1 and 2 on your computer's sound card.;
#X text 98 475 [dac~] is an acronym meaning "Digital/Analog Converter
#X text 98 503 [dac~] is an acronym meaning "Digital/Analog Converter
Signal" and is Pd's interface to send audio information to the audio
channels of your soundcard(s).;
#N canvas 37 90 428 471 Multi-channel_audio 0;
......@@ -92,14 +92,14 @@ and output with lower than 10 milliseconds of latency.;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 7 2 [dac~] Multi-channel Audio;
#X restore 101 545 pd Multi-channel_audio;
#X text 80 401 n) float;
#X restore 201 548 pd Multi-channel_audio;
#X text 80 421 n) float;
#X obj 4 597 pddp/pddplink all_about_help_patches.pd -text Usage Guide
;
#X obj 66 51 osc~ 880;
#X obj 66 80 *~;
#X obj 66 106 *~ 0.1;
#X obj 96 80 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
#X obj 66 77 *~;
#X obj 66 103 *~ 0.1;
#X obj 96 77 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 477 53 pddp/dsp;
#N canvas 84 189 428 347 sample_rate 0;
......@@ -125,7 +125,7 @@ rates:;
#X obj 1 1 cnv 15 425 20 empty \$0-pddp.cnv.subheading empty 3 12 0
14 -204280 -1 0;
#X text 7 2 [dac~] Sample Rate;
#X restore 101 520 pd sample_rate;
#X restore 101 548 pd sample_rate;
#N canvas 99 375 428 211 defeating_audio_computation 0;
#X text 19 37 There may be cases when you do not want Pd to send or
receive audio signal with your soundcard. You can manually disable
......@@ -135,9 +135,17 @@ switch \, or disable both using the "-nosound" switch.;
14 -204280 -1 0;
#X text 7 2 [dac~] -nodac and -noadc;
#X restore 101 570 pd defeating_audio_computation;
#X text 117 79 <- Click to test;
#X text 117 76 <- Click to test;
#X text 11 23 audio output;
#X msg 455 109 set 2;
#X obj 455 134 dac~ 1;
#X text 98 324 set;
#X text 168 324 the set message to the left inlet will reset the channel
or channels to the ones specified in the arguments. This requires DSP
to restart and should only be done at setup time \, not while audio
is being computed.;
#X connect 27 0 28 0;
#X connect 28 0 29 0;
#X connect 29 0 12 0;
#X connect 30 0 28 1;
#X connect 36 0 37 0;
......@@ -57,6 +57,14 @@ static void dac_dsp(t_dac *x, t_signal **sp)
}
}
static void dac_set(t_dac *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
for (i = 0; i < argc && i < x->x_n; i++)
x->x_vec[i] = atom_getfloatarg(i, argc, argv);
canvas_update_dsp();
}
static void dac_free(t_dac *x)
{
freebytes(x->x_vec, x->x_n * sizeof(*x->x_vec));
......@@ -68,6 +76,7 @@ static void dac_setup(void)
(t_method)dac_free, sizeof(t_dac), 0, A_GIMME, 0);
CLASS_MAINSIGNALIN(dac_class, t_dac, x_f);
class_addmethod(dac_class, (t_method)dac_dsp, gensym("dsp"), A_CANT, 0);
class_addmethod(dac_class, (t_method)dac_set, gensym("set"), A_GIMME, 0);
class_sethelpsymbol(dac_class, gensym("adc~_dac~"));
}
......@@ -164,6 +173,14 @@ static void adc_dsp(t_adc *x, t_signal **sp)
}
}
static void adc_set(t_adc *x, t_symbol *s, int argc, t_atom *argv)
{
int i;
for (i = 0; i < argc && i < x->x_n; i++)
x->x_vec[i] = atom_getfloatarg(i, argc, argv);
canvas_update_dsp();
}
static void adc_free(t_adc *x)
{
freebytes(x->x_vec, x->x_n * sizeof(*x->x_vec));
......@@ -174,6 +191,7 @@ static void adc_setup(void)
adc_class = class_new(gensym("adc~"), (t_newmethod)adc_new,
(t_method)adc_free, sizeof(t_adc), 0, A_GIMME, 0);
class_addmethod(adc_class, (t_method)adc_dsp, gensym("dsp"), A_CANT, 0);
class_addmethod(adc_class, (t_method)adc_set, gensym("set"), A_GIMME, 0);
class_sethelpsymbol(adc_class, gensym("adc~_dac~"));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment