亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

ChucK初步(1)

2019-11-14 10:45:36
字體:
來源:轉載
供稿:網友

Build/Install Instructions 如是直接安裝(win)可以忽略上面的。

The ChucK Tutorial

This tutorial was written for the command line version of ChucK (currently the most stable(穩定的) and widely supported). Other methods of running ChucK includes the miniAudicle (now on all major platforms) and the Audicle (in PRe-pre-alpha). The code is the same, but the way to run them differs, depending the ChucK system.

…generate a sine wave and send to the speaker…

…connecting audio processing modules (unit generators) and having them work together to compute the sound.

// connect sine oscillator to D/A convertor (sound card) SinOsc s => dac;

The above does several things:

(1) it creates a new unit generator of type 'SinOsc' (sine oscillator(振蕩器)), and store its reference(引用) in variable(變量的) 's'. (2) 'dac' (D/A convertor) is a special *unit generator* (created by the system) which is our abstraction(抽象) for the underlying(潛在的) audio interface(界面). (3) we are using the ChucK Operator (=>) to ChucK 's' to 'dac'.

In ChucK, when one unit generator is ChucKed to another, we connect them. We can think of this line as setting up a data flow from ‘s’, a signal generator, to ‘dac’, the sound card/speaker. Collectively(集體的), we will call this a ‘patch’.

…we simply have to “allow time to pass” for data to be computed…time and audio data are both inextricably(密不可分) related in ChucK (as in reality), and separated in the way they are manipulated(操縱).

let’s generate our sine wave and hear it by adding one more line:

// connect sine oscillator to D/A convertor (sound card)SinOsc s => dac;// allow 2 seconds to pass2::second => now;

Let’s now run this (assuming(假設) you saved the file as ‘foo.ck’):

chuck foo.ck

For now, we can just take the second line of code to mean “let time pass for 2 seconds (and let audio compute during that time)”. If you want to play it indefinitely(無限制地), we could write a loop:

//////////////example1//////////////// connect sine oscillator to D/A convertor (sound card)SinOsc s => dac;// loop in timewhile( true ) { 2::second => now; //(we used 2::second here, but we could have used any number of //'ms', 'second', 'minute', 'hour', 'day', and even 'week') }

In ChucK, this is called a ‘time-loop’ (in fact this is an ‘infinite time loop’). To stop a ongoing ChucK program from the command line, hit (ctrl - c).

Now, let’s try changing the frequency randomly every 100ms:

// make our patchSinOsc s => dac;// time-loop, in which the osc's frequency is changed every 100 mswhile( true ) { 100::ms => now; Std.rand2f(30.0, 1000.0) => s.freq; }

Two more things to note here.

(1) We are advancing time inside the loop by 100::ms durations. (2) A random value between 30.0 and 1000.0 is generated and 'assigned' to the oscillator's frequency, every 100::ms.

目前運行的結果是有并不規律的聲音產生,這就是那個時刻變形的聲波


Now let’s write another (slightly longer) program: (these files can be found in the examples/ directory, so you don’t have to type them in)

//////////////example2//////////////// impulse(脈沖信號) to filter to dac//Biquad filter(雙二階濾波器)Impulse i => BiQuad f => dac;// set the filter's pole radius( = prad).99 => f.prad;// set equal gain zero's1 => f.eqzs;//不理解// initialize float variable0.0 => float v;// infinite time-loopwhile( true ){ // set the current sample/impulse 1.0 => i.next; // sweep the filter resonant frequency(共振頻率) Std.fabs(Math.sin(v)) * 4000.0 => f.pfreq; // increment(增量) v v + .1 => v; // advance time 100::ms => now;}

Name this moe.ck, and run it:

chuck moe.ck

Now, make two copies of moe.ck - larry.ck and curly.ck. Make the following modifications(修改).

1) change larry.ck to advance time by 99::ms (instead of 100::ms). 2) change curly.ck to advance time by 101::ms (instead of 100::ms). 3) optionally, change the 4000.0 to something else (like 400.0 for curly).

Run all three in parallel:

chuck moe.ck larry.ck curly.ck

What you hear (if all goes well) should be ‘phasing’ between moe, larry, and curly, with curly emitting(發出) the lower-frequency pulses(脈沖).

ChucK supports sample-synchronous concurrency(并發性), via the ChucK timing mechanism(機制). Given any number of source files that uses the timing mechanism above, the ChucK VM can use the timing information to automatically(自動地) synchronize(合拍) all of them… Note that each process do not need to know about each other - it only has to deal with time locally. The VM will make sure things happen correctly and globally.

A large collection of pre-made examples have been arranged and provided with this distribution in the /doc/examples directory, and are mirrored here


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
精品国产一区二区三区久久| 精品无人国产偷自产在线| 一区国产精品视频| 国产精品久久久久999| 91亚洲国产精品| 中文字幕欧美专区| 在线日韩精品视频| 久久国产精品网站| 日韩视频在线免费观看| 亚洲人成伊人成综合网久久久| 欧美性猛交xxxx黑人猛交| 国产成人精品优优av| 欧美日韩一区二区在线播放| 日本中文字幕不卡免费| 亚洲视频在线免费看| 亚洲色图35p| 亚洲成人黄色在线观看| 最近2019中文字幕第三页视频| 欧美日本中文字幕| 免费成人高清视频| 欧美精品激情blacked18| 中文字幕精品网| 欧美电影免费观看大全| 成人高清视频观看www| 欧美大片免费看| 国产美女精品视频免费观看| 国产福利视频一区二区| 日韩av一区二区在线观看| www欧美xxxx| 性色av香蕉一区二区| 国产丝袜一区二区三区免费视频| 精品久久久一区二区| 免费91麻豆精品国产自产在线观看| 91av在线免费观看视频| 欧美成人性色生活仑片| 中文字幕日韩电影| 久久欧美在线电影| 青草热久免费精品视频| 国产成人亚洲综合青青| www国产精品视频| 最近2019年中文视频免费在线观看| 久久免费视频在线观看| 亚洲欧洲日产国码av系列天堂| 欧美在线免费观看| 久久精品一区中文字幕| 精品日韩视频在线观看| 国产成人拍精品视频午夜网站| 国产精品国模在线| 尤物yw午夜国产精品视频明星| 国产色婷婷国产综合在线理论片a| 欧美成人精品xxx| 亚洲tv在线观看| 欧美性猛交xxxxx水多| 欧美麻豆久久久久久中文| 日韩av免费观影| 欧美国产一区二区三区| 日韩中文字幕国产| 亚洲福利视频二区| 日韩在线观看你懂的| 九九精品视频在线| 国产丝袜精品第一页| 久久久国产在线视频| 欧美一级bbbbb性bbbb喷潮片| 国产91在线播放精品91| 久久99精品久久久久久青青91| 大胆欧美人体视频| 国产精品热视频| 在线播放精品一区二区三区| 综合激情国产一区| 国产精品美女999| 中文字幕亚洲图片| 国产精品第七影院| 欧美大肥婆大肥bbbbb| 国产脚交av在线一区二区| 91精品国产综合久久香蕉| 国产精品吊钟奶在线| 久久久久99精品久久久久| 国产高清在线不卡| 欧美视频一区二区三区…| 国产精品网红直播| 久久国产精品视频| 中文字幕亚洲欧美| 亚洲人成电影网站色www| 国产精品久久久久久久久久久新郎| 7777精品久久久久久| 俺去啦;欧美日韩| 欧美激情亚洲精品| 国产精品v片在线观看不卡| 国产精品v片在线观看不卡| 国产日韩换脸av一区在线观看| 91精品久久久久久久久久久| 国产va免费精品高清在线| 国产精品免费电影| 91精品在线观看视频| 国模gogo一区二区大胆私拍| 成人中文字幕+乱码+中文字幕| 亚洲精品wwwww| 欧美性猛交xxxx黑人猛交| 亚洲理论电影网| 在线性视频日韩欧美| 欧美高清视频在线| 国产精品第100页| 亚洲精品中文字幕有码专区| 久久免费视频在线观看| 91精品久久久久久综合乱菊| 欧美日韩中文字幕在线| 欧美老妇交乱视频| 国产精品欧美日韩久久| 欧美成人免费va影院高清| 久久av红桃一区二区小说| 欧美亚洲另类激情另类| 69视频在线免费观看| 欧美在线免费看| 欧美亚洲伦理www| 欧美视频专区一二在线观看| 色黄久久久久久| 91po在线观看91精品国产性色| 欧美一级片久久久久久久| 日韩久久免费电影| 亚洲精品资源在线| 亚洲毛片在线免费观看| 久久久精品久久| 欧美丰满老妇厨房牲生活| 成人黄在线观看| 亚洲理论在线a中文字幕| 亚洲欧美国产一区二区三区| 久久精品亚洲精品| 成人福利视频在线观看| 亚洲天堂久久av| 久久露脸国产精品| 久久免费少妇高潮久久精品99| 国产在线a不卡| 91久久久久久久| 欧美性色xo影院| 狠狠躁夜夜躁人人躁婷婷91| 国产九九精品视频| 亚洲石原莉奈一区二区在线观看| 欧美性猛交xxxx偷拍洗澡| 日韩影视在线观看| 国产一区二区av| 俺也去精品视频在线观看| 日韩视频永久免费观看| 欧美日韩国产页| 国产亚洲视频中文字幕视频| 亚洲最大的成人网| 不卡毛片在线看| 久久男人av资源网站| 日韩av电影手机在线观看| 在线视频日韩精品| 日韩人在线观看| 国产精品视频资源| 国产亚洲精品久久久久久777| 国产一区二区成人| 美女性感视频久久久| 热99在线视频| 亚洲免费一在线| 69国产精品成人在线播放| 日韩在线视频免费观看高清中文| 欧美激情视频在线| 91午夜在线播放| 国产亚洲欧美日韩一区二区| 亚洲福利影片在线| 国产精品视频久| 人人做人人澡人人爽欧美|