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

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

ChucK初步(1)

2019-11-14 11:40:05
字體:
來源:轉載
供稿:網友

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
久久久久久伊人| 国产精品福利久久久| 91中文精品字幕在线视频| 久久久久久噜噜噜久久久精品| 亚洲人成电影网| 国产亚洲欧美日韩精品| 国产精品久久久久久久天堂| 国产99视频精品免视看7| 黑人极品videos精品欧美裸| 亚洲2020天天堂在线观看| 亚洲第一福利网站| 韩曰欧美视频免费观看| 欧美另类在线观看| 96pao国产成视频永久免费| 久久久91精品国产一区不卡| 91亚洲精品久久久久久久久久久久| 韩国三级日本三级少妇99| 欧美日韩美女在线| 亚洲精品成人久久| 亚洲无亚洲人成网站77777| 欧美又大又硬又粗bbbbb| 亚洲free性xxxx护士白浆| 久久国产精品久久精品| 精品偷拍一区二区三区在线看| 不卡av电影院| 亚洲国产日韩欧美在线图片| 午夜精品一区二区三区在线视频| 九九热精品视频在线播放| 国产91ⅴ在线精品免费观看| 欧美成人精品xxx| 欧美理论电影在线播放| 大荫蒂欧美视频另类xxxx| 国产精品日日摸夜夜添夜夜av| 日本成人在线视频网址| 久久成人国产精品| 国产精品电影久久久久电影网| 国产午夜精品全部视频在线播放| 久久亚洲综合国产精品99麻豆精品福利| 国产中文字幕日韩| 亚洲天堂男人的天堂| 午夜精品99久久免费| 欧美精品videosex极品1| 成人在线小视频| 精品亚洲精品福利线在观看| 中文字幕av一区| **欧美日韩vr在线| 精品国产福利在线| 欧美午夜视频一区二区| 九九热99久久久国产盗摄| 亚洲国产欧美一区二区丝袜黑人| 亚洲欧美国内爽妇网| 久久99久国产精品黄毛片入口| 成人美女av在线直播| 亚洲高清一区二| 国模私拍一区二区三区| 亚洲人成在线播放| 91精品国产免费久久久久久| 国产精品久久久91| 欧美精品情趣视频| 亚洲欧美日韩天堂一区二区| 欧美日韩亚洲一区二| 国产极品精品在线观看| 97久久伊人激情网| 亚洲人成五月天| 国产极品jizzhd欧美| 亚洲精品美女免费| 91色在线视频| 国产精品露脸自拍| 欧美午夜精品久久久久久浪潮| 亚洲第一级黄色片| 欧美乱人伦中文字幕在线| 日韩av在线不卡| 欧美丝袜美女中出在线| 亚洲视频欧洲视频| 久久久久五月天| 日韩视频在线免费| 亚洲精品久久久久久久久久久| 欧美一区第一页| 国产综合在线观看视频| 久久久久久香蕉网| 97视频人免费观看| 中文字幕精品影院| 欧美电影免费在线观看| 日韩在线免费视频观看| 亚洲的天堂在线中文字幕| 精品国产欧美成人夜夜嗨| 日韩在线资源网| 欧美性感美女h网站在线观看免费| 成人激情黄色网| 国产suv精品一区二区三区88区| 精品亚洲永久免费精品| www.亚洲一区| 欧美精品在线第一页| 久久国产精品首页| 成人精品aaaa网站| 亚洲精品视频在线观看视频| 亚洲影院高清在线| 午夜精品一区二区三区在线视| 欧美成人久久久| 国产精品久久久久99| 欧美日韩性生活视频| 国产精品中文在线| 欧美性猛交99久久久久99按摩| 夜夜狂射影院欧美极品| 欧美放荡办公室videos4k| 91精品国产综合久久久久久蜜臀| 久久久久久久成人| 欧美大片免费观看在线观看网站推荐| 亚洲综合日韩中文字幕v在线| 高清一区二区三区四区五区| 精品国内产的精品视频在线观看| 久久精品人人爽| 国产精品自产拍在线观看| 国外视频精品毛片| 亚洲人成伊人成综合网久久久| 欧美黑人巨大精品一区二区| 欧洲成人性视频| 久久99亚洲热视| 亚洲成人a级网| 亚洲精品999| 欧美野外wwwxxx| 国产成人av在线播放| 国产丝袜一区二区三区| 91在线视频一区| 北条麻妃99精品青青久久| 久久精品91久久香蕉加勒比| 668精品在线视频| 国产99久久精品一区二区 夜夜躁日日躁| 国产成人精彩在线视频九色| 伊人久久久久久久久久| 午夜精品美女自拍福到在线| 91免费福利视频| 色偷偷av一区二区三区| 在线日韩欧美视频| 亚洲成年人影院在线| 欧洲午夜精品久久久| 日本一区二区在线播放| 国产精品第1页| 亚洲曰本av电影| 97免费视频在线播放| 久久久久久亚洲精品不卡| 日本精品久久久| 国产成人鲁鲁免费视频a| 色妞色视频一区二区三区四区| 久久久精品一区二区三区| 国产精品尤物福利片在线观看| 亚洲高清色综合| 美女福利精品视频| 欧美在线视频一区二区| 黄网站色欧美视频| 国产精品视频26uuu| 久久久国产视频| 欧美福利视频在线观看| 欧美性一区二区三区| 日韩国产精品视频| 国产精品嫩草影院久久久| 国产精品福利无圣光在线一区| 在线看国产精品| 久久精品久久久久久国产 免费| 欧美国产精品日韩| 原创国产精品91| 久久深夜福利免费观看| 欧美日本精品在线| 亚洲成人精品久久|