aboutsummaryrefslogtreecommitdiff
path: root/site/udo/wavetables.udo
diff options
context:
space:
mode:
authorRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
committerRichard <q@1bpm.net>2025-04-13 18:48:02 +0100
commit9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22 (patch)
tree291bd79ce340e67affa755a8a6b4f6a83cce93ea /site/udo/wavetables.udo
downloadapps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.gz
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.tar.bz2
apps.csound.1bpm.net-9fbf91db06a6d4f4b5cd8bb45389a731bb86bf22.zip
initial
Diffstat (limited to 'site/udo/wavetables.udo')
-rwxr-xr-xsite/udo/wavetables.udo31
1 files changed, 31 insertions, 0 deletions
diff --git a/site/udo/wavetables.udo b/site/udo/wavetables.udo
new file mode 100755
index 0000000..564836e
--- /dev/null
+++ b/site/udo/wavetables.udo
@@ -0,0 +1,31 @@
+#ifndef UDO_WAVETABLES
+#define UDO_WAVETABLES ##
+/*
+ Standard regular wave function tables
+
+ This file is part of the SONICS UDO collection by Richard Knight 2021, 2023
+ License: GPL-2.0-or-later
+ http://1bpm.net
+*/
+
+ipoints = 8192
+gifnSine ftgen 0, 0, ipoints, 10, 1
+gifnSquare ftgen 0, 0, ipoints, 10, 1, 0 , .33, 0, .2 , 0, .14, 0 , .11, 0, .09
+gifnSaw ftgen 0, 0, ipoints, 10, 0, .2, 0, .4, 0, .6, 0, .8, 0, 1, 0, .8, 0, .6, 0, .4, 0, .2
+gifnPulse ftgen 0, 0, ipoints, 10, 1, 1, 1, 1, 0.7, 0.5, 0.3, 0.1
+gifnTriangle ftgen 0, 0, ipoints, 9, 1, 1, 0, 3, 0.333, 180, 5, 0.2, 0, 7, 0.143, 180, 9, 0.111, 0
+gifnCosine ftgen 0, 0, ipoints, 9, 1, 1, 90
+gifnHalfSine ftgen 0, 0, 2048, 9, 0.5, 1, 0
+gifnSigmoid ftgen 0, 0, 257, 9, .5, 1, 270
+gifnHanning ftgen 0, 0, 2048, 20, 2
+gifnHamming ftgen 0, 0, 2048, 20, 1, 1
+
+giwavetables[] fillarray gifnSine, gifnSquare, gifnSaw, gifnPulse, gifnCosine, gifnTriangle ;, gifnHalfSine, gifnSigmoid
+gSwavetables[] fillarray "Sine", "Square", "Saw", "Pulse", "Cosine", "Triangle" ;, "Half sine", "Sigmoid"
+
+opcode wavetable_random, i, 0
+ xout giwavetables[int(random(0, lenarray(giwavetables)-1))]
+endop
+
+#end
+