summaryrefslogtreecommitdiff
path: root/demos/pmorales/a4.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'demos/pmorales/a4.lsp')
-rw-r--r--demos/pmorales/a4.lsp25
1 files changed, 25 insertions, 0 deletions
diff --git a/demos/pmorales/a4.lsp b/demos/pmorales/a4.lsp
new file mode 100644
index 0000000..6c39f22
--- /dev/null
+++ b/demos/pmorales/a4.lsp
@@ -0,0 +1,25 @@
+;;; SIMPLE SYNTHESIS
+;;; Waveform + Envelope. Modulating the envelope with noise
+;;; coded by Pedro Jose Morales
+;;; pmorales@iele-ab.uclm.es
+
+(setf *pmorales-path* (current-path))
+(load (strcat *pmorales-path* "pjmg.lsp"))
+
+(defun shiver (dur frq noise-percent noise-frq)
+ (mult (osc frq dur)
+ (sum (pwlv 5e-2 300e-3 1.0 (- dur 300e-3) 1.0 dur 2e-3)
+ (mult (/ noise-percent 100.0) (randi1 noise-frq dur)))))
+
+; when noise-percent is too big (> 40), there is a click risk at the
+; beginning and the end of the note
+; this would be avoided if randi function were multiplied by a smooth envelope
+; WARNING: randi1 is defined in PJMG.LSP
+
+(defun shiver-demo ()
+ (ss (seq (shiver 1 c5 20 40)
+ (shiver 1 b4 50 40)
+ (shiver 1 a4 80 40)
+ (shiver 1 g4 20 300)
+ (shiver 1 f4 50 300)
+ (shiver 1 d4 80 300))))