User Tools

Site Tools


folkarc:touch

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
folkarc:touch [2024/06/11 19:44] discordfolkarc:touch [2024/09/15 19:11] (current) discord
Line 5: Line 5:
  
 <file tcl> <file tcl>
-# Tablet Touch Handler 9000 - Revamped live at folk0!+# Tablet Touch Handler 9000 - Revamped live at folk0 on Jun 11 2024
 Wish the web server handles route "/tablet" with handler { Wish the web server handles route "/tablet" with handler {
     html {     html {
Line 150: Line 150:
     }     }
  
 +}
 +</file>
 +
 +If you have [[:supercollider|Supercollider]] set up, play this little theremin!
 +
 +<file tcl>
 +# Supercollider touch demo
 +
 +When /thing/ claims /thing2/ has touch number /i/ with x /x/ and y /y/ {
 +    set freq [expr {int($Display::WIDTH * $x) % $Display::WIDTH} / 2.]
 +
 +    Wish Supercollider sound $thing2-touch-noise attr freq is $freq
 +    
 +    Wish $this is labelled "$freq Hz"
 +
 +    Wish Supercollider plays sound $thing2-touch-noise {
 +        arg freq = 0;
 +        var envgen;
 +        envgen = EnvGen.kr(Env.adsr(sustainLevel: 0.2));
 +        Pan2.ar(SinOsc.ar(freq) * 0.5 * envgen, 1.0);
 +    }
 } }
 </file> </file>
  
folkarc/touch.1718135076.txt.gz · Last modified: 2024/06/11 19:44 by discord

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki