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

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

ChucK初步(1)

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

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
欧美人与性动交a欧美精品| 国产在线98福利播放视频| 国产精品扒开腿做爽爽爽视频| 亚洲成人a级网| 国内精品久久影院| 国产最新精品视频| 清纯唯美日韩制服另类| 欧美成人免费全部| 亚洲色在线视频| 国产女精品视频网站免费| 久久久噜久噜久久综合| 91国产美女在线观看| 久久久视频精品| 久久久久久久久久亚洲| 亚洲欧美成人一区二区在线电影| 91在线观看免费观看| 国产精品高清网站| 国产精品美女免费看| 亚洲最大的网站| 亚洲综合在线中文字幕| 黑人精品xxx一区一二区| 欧美电影免费观看| 亚洲免费av电影| 欧美在线观看www| 欧美日韩美女视频| 亚洲欧美在线磁力| 成人激情春色网| 亚洲欧洲日韩国产| 91香蕉国产在线观看| 国产精品9999| 久久国产视频网站| 亚洲激情第一页| 国产999精品久久久影片官网| xxav国产精品美女主播| 91精品国产乱码久久久久久久久| 青青草国产精品一区二区| 2019亚洲日韩新视频| 91av在线国产| 正在播放欧美一区| 国产成人精品一区二区三区| 国产成人精品免高潮费视频| 国产不卡av在线| 日韩欧美精品网站| 日韩一区视频在线| 久久亚洲一区二区三区四区五区高| 午夜精品一区二区三区视频免费看| 日韩一级裸体免费视频| 精品国产91久久久久久| 91高潮精品免费porn| 国产欧美中文字幕| 国产欧美精品在线播放| 亚洲福利视频网| 狠狠色狠狠色综合日日小说| 亚洲国产小视频在线观看| 亚洲人成网在线播放| 中文字幕av一区| 亚洲欧美精品一区| 国产+成+人+亚洲欧洲| 亚洲国产免费av| 亚洲美腿欧美激情另类| 亚洲第一网站免费视频| 亚洲视频日韩精品| 久久精品亚洲94久久精品| 欧美人在线观看| 国产一区二区三区18| 在线国产精品播放| 精品国产依人香蕉在线精品| 欧美精品日韩www.p站| 久久久亚洲福利精品午夜| 久久在线免费观看视频| 久久精品国产91精品亚洲| 在线播放日韩精品| 久久久久久久久久久网站| 日韩欧美一区二区在线| 91在线直播亚洲| 国产精品视频免费观看www| 青青在线视频一区二区三区| 7777精品久久久久久| 色婷婷av一区二区三区久久| 欧美激情视频网址| 亚洲最新在线视频| 久久视频在线视频| 中文字幕精品www乱入免费视频| 91av在线免费观看视频| 亚洲奶大毛多的老太婆| 色综合老司机第九色激情| 日韩精品免费综合视频在线播放| 国产精品吹潮在线观看| 日本高清久久天堂| 国产精品1区2区在线观看| 欧美激情乱人伦| 亚洲最大福利网站| 国产精品视频永久免费播放| 曰本色欧美视频在线| 九九久久久久久久久激情| 91成人在线观看国产| 欧洲日本亚洲国产区| 青青草一区二区| 亚洲人成电影在线观看天堂色| xvideos亚洲人网站| 国产精品99久久久久久www| 久久精品美女视频网站| 亚洲天堂网在线观看| 亚洲精品国产精品自产a区红杏吧| 国产成人精品亚洲精品| 中文字幕亚洲一区| 中文字幕久热精品在线视频| 亚洲欧美日韩中文视频| 亚洲精品美女在线观看| 国产精品久久久久久久久粉嫩av| 国产精品入口福利| 全球成人中文在线| 欧美日韩国产麻豆| 亚洲第一综合天堂另类专| 欧美成人剧情片在线观看| 欧美人交a欧美精品| 亚洲一区二区三区乱码aⅴ蜜桃女| 国产精品www色诱视频| 亚洲va欧美va国产综合剧情| 久久久久99精品久久久久| 色婷婷综合成人| 77777亚洲午夜久久多人| 亚洲护士老师的毛茸茸最新章节| 国产成人精品久久久| 国产精品久久久av| 欧美成人午夜剧场免费观看| 日韩欧美精品网址| 国产精品影片在线观看| 欧美成人精品不卡视频在线观看| 欧美性猛交xxxx乱大交极品| 日韩毛片在线看| 欧美成年人在线观看| 久久综合88中文色鬼| 91免费电影网站| 日韩欧美国产高清91| 国产精品视频白浆免费视频| 日韩在线视频导航| 国产成人亚洲综合青青| 欧美精品少妇videofree| 91免费看片网站| 欧美有码在线视频| 国产精品久久久久久网站| 亚洲电影成人av99爱色| 欧美第一页在线| 久久精品99久久久香蕉| 精品久久国产精品| 日韩欧美在线视频| 欧美成在线观看| 操日韩av在线电影| 欧美成人精品在线观看| 精品久久久久久中文字幕一区奶水| 国产一区二区三区网站| 久久亚洲影音av资源网| 国产精品日韩专区| 成人中心免费视频| 亚洲精品91美女久久久久久久| 精品视频在线播放免| 日韩在线观看网址| 97精品国产97久久久久久| 国产成人精品一区二区三区| 成人午夜激情免费视频| 国产精品人成电影| 久久影视三级福利片| 2024亚洲男人天堂|