supercollider
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
supercollider [2024/09/15 19:30] – discord | supercollider [2025/03/05 19:10] (current) – smj-edison | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Directions ====== | ====== Directions ====== | ||
- | Use the '' | + | Use the '' |
* '' | * '' | ||
- | Install '' | + | Install '' |
- | * '' | + | * '' |
Add yourself to the audio group and reboot. | Add yourself to the audio group and reboot. | ||
Line 17: | Line 17: | ||
* This is a bit more involved. | * This is a bit more involved. | ||
- | * Start by running '' | + | |
- | * You'll get a huge list of audio device. Try and find one that says something about HD-Audio, being generic, and being analog. You'll want the string that looks like '' | + | * <file bash> |
- | * Now, go to '' | + | * Or, manually: |
+ | * Start by running '' | ||
+ | | ||
+ | * Now, go to '' | ||
* Add a section that looks like this: | * Add a section that looks like this: | ||
* <file tcl> | * <file tcl> | ||
Line 29: | Line 32: | ||
[... rest of ifs] | [... rest of ifs] | ||
</ | </ | ||
+ | * Install the SuperDirt library by running <file bash> | ||
* It should be set up! | * It should be set up! | ||
Line 42: | Line 46: | ||
<file tcl> | <file tcl> | ||
set noteSemitones [dict create A 0 B 2 C 3 D 5 E 7 F 8 G 10] | set noteSemitones [dict create A 0 B 2 C 3 D 5 E 7 F 8 G 10] | ||
- | set modSemitones | + | set accidentalSemitones |
When /player/ wishes to play note /note/ { | When /player/ wishes to play note /note/ { | ||
- | | + | |
- | set noteMod | + | set noteSt [dict get $noteSemitones $note] |
- | set noteSt [dict get $noteSemitones $noteName] | + | set modSt [dict get $accidentalSemitones |
- | set modSt [dict get $modSemitones | + | |
set st [expr { $noteSt + $modSt }] | set st [expr { $noteSt + $modSt }] | ||
- | set noteFreq [expr { 440.0 * (2.0 ** ($st / 12.0)) }] | + | set noteFreq [expr { 440.0 * (2.0 ** (($octave == "" |
- | Wish $player is labelled " | + | |
set soundName note-$player-$note | set soundName note-$player-$note | ||
Wish Supercollider sound $soundName attr freq is $noteFreq | Wish Supercollider sound $soundName attr freq is $noteFreq | ||
Line 57: | Line 59: | ||
arg freq = 440.0; | arg freq = 440.0; | ||
var envgen; | var envgen; | ||
- | envgen = EnvGen.kr(Env.adsr(sustainLevel: | + | envgen = EnvGen.kr(Env.adsr(sustainLevel: |
- | Pan2.ar(SinOsc.ar(freq) * 0.5 * envgen, 0.0); | + | Pan2.ar(Saw.ar(freq) * 0.5 * envgen, 0.0); |
} | } | ||
+ | |||
+ | When the clock time is /t/ { | ||
+ | When /nobody/ claims $soundName has start time /startTime/ { | ||
+ | Hold $soundName { Claim $soundName has start time $t } | ||
+ | } | ||
+ | When $player has region /r/ & $soundName has start time /startTime/ { | ||
+ | # set radius [expr { max([region width $r], [region height $r])/2 + 10 }] | ||
+ | set radius [expr { ($t - $startTime) * 500 }] | ||
+ | Wish $player draws a circle with radius $radius color red | ||
+ | } | ||
+ | } | ||
+ | On unmatch { Hold $soundName { } } | ||
} | } | ||
</ | </ | ||
Line 91: | Line 105: | ||
s = t; | s = t; | ||
</ | </ | ||
+ | |||
+ | TODO: add audio debugging page that can be printed? |
supercollider.1726428627.txt.gz · Last modified: 2024/09/15 19:30 by discord