[Csnd] audio input question
Date | 2020-06-23 17:47 |
From | Dave Seidel |
Subject | [Csnd] audio input question |
Hi all,
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
What is the fastest and least resource-intensive way to test of there is anything coming in on an input channel (ie, opened with "inch")? I figure I could use probably the rms opcode and check for a 0 output value, but maybe there's a better, simpler way. Context: I'm writing more coe for the Nebulae module, this time an effect as opposed to an instrument, so it will be taking audio input, processing it, and sending the result out. I want to be able to use a different code path based on whether both inputs are being used, or just one. The Nebulae is powered by a Raspberry Pi 3, and I'm using pvs opcodes, so I want to be careful to make the code as efficient as possible. Thanks, Dave |
Date | 2020-06-23 17:58 |
From | Justin Smith |
Subject | Re: [Csnd] audio input question |
unless there's a switch on the DSP to turn the input off in software, checking for 0 doesn't suffice, because an ADC still has noise at some level even with no source provided the strictly most optimized solution would be picking a different instrument (or even a different CSD) at startup based on some statically detectable condition (eg. a switch position on the device on boot) - any conditionals in the instrument itself are using cycles that could be used for DSP On Tue, Jun 23, 2020 at 9:47 AM Dave Seidel |
Date | 2020-06-23 18:16 |
From | Dave Seidel |
Subject | Re: [Csnd] audio input question |
Good points, Justin, and I do have latching front panel switches available, On Tue, Jun 23, 2020 at 12:58 PM Justin Smith <noisesmith@gmail.com> wrote: unless there's a switch on the DSP to turn the input off in software, |
Date | 2020-06-23 18:41 |
From | "Jeanette C." |
Subject | Re: [Csnd] audio input question |
Jun 23 2020, Dave Seidel has written: > Good points, Justin, and I do have latching front panel switches available, To keep it a little more flexible, you could use a control instrument that would run two other iinstruments based on a switch position. Using changed2() you could wait for changes and decide whether to turn off one instrument and turn on the other. Best wishes, Jeanette > > On Tue, Jun 23, 2020 at 12:58 PM Justin Smith |
Date | 2020-06-23 19:04 |
From | Dave Seidel |
Subject | Re: [Csnd] audio input question |
Thanks, Jeanette, excellent idea. By the way, I ended up using ftmorf in my Risset Harmonic Oscillator instrument (and I thanked you in the README). The risset.instr is the code, it's really just a Csound ORC. - Dave On Tue, Jun 23, 2020 at 1:41 PM Jeanette C. <julien@mail.upb.de> wrote: Jun 23 2020, Dave Seidel has written: |