File: concat.ck

package info (click to toggle)
chuck 1.5.5.7-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 41,260 kB
  • sloc: cpp: 124,539; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 457; python: 174; perl: 86
file content (24 lines) | stat: -rw-r--r-- 657 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// name: concat.ck
// desc: FeatureCollector is really meant to be used for recording data for machine
// learning analysis (see https://chuck.cs.princeton.edu/doc/language/uana.html),
// but this example shows bare-bones usage of the UAana for something silly.
//
// author: Curtis Ullerich

FeatureCollector fc =^ UnFlip unflip => dac;
SinOsc one => Flip f1 =^ fc;
TriOsc two => Flip f2 =^ fc;
.5 => one.gain => two.gain;

300 => int freq;
freq => one.freq;
2*freq => two.freq;
second/freq => dur period;
(period/samp)$int => int size; // number of samples in a period
size => f1.size => f2.size;

while(true)
{
    period => now;
    unflip.upchuck();
}