History

Add files via upload

Added new example for Chorus UGen

Alex Han committed 3 years ago

Commit b4245ff1 parent 3c0df031 file · +43 −0Browse files

Unified · Split

examples/stk/chorus.ck+43−0
@@ -0,0 +1,43 @@
1+//------------------------------------------------------------------------------
2+// Chorus
3+// name: chorus.ck
4+// desc: Basic demo of the Chorus UGen
5+//
6+// details:
7+// The Chorus UGen adds a chorus effect to a signal. Chorus refers to an audio effect
8+// in which multiple sounds occur close together in time, and with similar pitch. The
9+// slight deviations in pitch and time are generally small enough such that the signals
10+// are not perceived as being out-of-tune. The effect is often described as adding "shimmer",
11+// "richness", or "complexity" to the timbre.
12+// When implemented digitally, the chorus effect is acheived by taking a source signal, and
13+// mixing it with delayed copies of itself. The pitch of these copies is usually modulated
14+// using another signal like an LFO. In ChucK, you can adjust the depth and frequency of this
15+// modulation of pitch, as well as the amount of delay and how much of the chorus effect is
16+// present in the mix.
17+//
18+// Alex Han, Spring 2023
19+//------------------------------------------------------------------------------
20+
21+// Setting up signal chain
22+SinOsc s[4]; Chorus chor[4];
23+[62, 65, 69, 72] @=> int notes[]; // chorus often "shines" best with polyphonic textures!
24+
25+for(int i; i < s.size(); i++) {
26+ s[i] => chor[i] => dac;
27+
28+ // sine wave as source signal
29+ s[i].gain(.2);
30+ s[i].freq(Std.mtof(notes[i]));
31+
32+ // initializing a light chorus effect
33+ // Try tweaking these values!
34+ chor[i].baseDelay(10::ms);
35+ chor[i].modDepth(.4);
36+ chor[i].modFreq(1);
37+ chor[i].mix(.2);
38+}
39+
40+while(true)
41+{
42+ 1::second => now;
43+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t