[chuck-users] Set adc sampling rate

Spencer Salazar spencer at ccrma.stanford.edu
Sun May 15 17:16:37 EDT 2016


Hi Guille,

Yes, customarily Chuck's internal timing is clocked from the dac, and it
doesn't support multi-rate audio conversion (yet) so, to my knowledge, the
adc and dac must be synced whether you want the dac or not. This is an
interesting use case though.

In my testing it seems that RtAudio, ChucK's audio backend, upsamples an
input source to match the output source, so if you can rework your code
from 8kHz to your dac's rate, that might be easier than finding an 8k dac.

spencer


On Sat, May 14, 2016 at 1:59 PM, Guille Elias Alonso <
guille_elias_alonso at hotmail.com> wrote:

> I had already tried --srate8000 on the terminal but my dac doesn't support
> 8000 Hz so it doesn't work. But I don't use dac so I thought there should
> be a way to set the sampling rate of just adc in code or any other way. Or
> if maybe there is some kind of sampler unit. If not, I'll have to do what
> you say about plugging another dac device or changing the code D:
> Le 14 mai 2016 8:50 PM, Perry Cook <prc at CS.Princeton.EDU> a écrit :
>
> In miniAudicle, it’s in the Preferences window.
> In terminal, the --srate switch sets sample rate:
>
> >     chuck --srate8000 MyChucK.ck
>
> But both ADC and DAC must run at same rate.  AND there has to be
> supporting hardware there to run at that sample rate.  So native Mac
> coreaudio won’t allow for 8k.  You could use the —silent switch, but
> then you lose the real timebase because ChucK then just runs as
> fast as it possibly can.  You could plug in an iMic or other USB
> audio device that does support 8k, then it would all work.  Use
> >    chuck --probe
> to find out what sample rates are available.
>
> PRC
>
> > Message: 2
> > Date: Sat, 14 May 2016 17:40:06 +0200
> > From: Guille Elias Alonso <guille_elias_alonso at hotmail.com>
> > To: "chuck-users at lists.cs.princeton.edu"
> >        <chuck-users at lists.cs.princeton.edu>
> > Subject: [chuck-users] Set adc sampling rate
> > Message-ID: <DUB125-W53FA6DD2238309A38920E9B3750 at phx.gbl>
> > Content-Type: text/plain; charset="iso-8859-1"
> >
> > Hi guys!
> > I'm trying to make some analysis of the micro input and to do so I have
> to take my micro input with a sampling rate of 8000 Hz. I've checked my
> micro supports that (with chuck --probe) but in the doc I haven't found how
> to set the sampling rate of adc. Does someone know how to do that? Or does
> someone know where I can find some kind of API doc where everything is
> listed? In the ChucK language specification or in the Unit Generators
> Reference I cannot find much info about it.
> > Thanks!Guille
> > -------------- next part --------------
> > An HTML attachment was scrubbed...
> > URL: <
> http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20160514/4e439f0b/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > chuck-users mailing list
> > chuck-users at lists.cs.princeton.edu
> > https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
> >
> >
> > End of chuck-users Digest, Vol 130, Issue 11
> > ********************************************
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>


-- 
Spencer Salazar
Doctoral Candidate
Center for Computer Research in Music and Acoustics
Stanford University

spencer at ccrma.stanford.edu
+1 831.277.4654
https://ccrma.stanford.edu/~spencer/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20160515/ad4454e2/attachment.html>


More information about the chuck-users mailing list