; OM File Header - Saved 2022/07/29 17:17:02 ; (7.0 :patc (om-make-point 10 110) (om-make-point 0 23) (om-make-point 1280 725) "" 183 0 "2022/07/29 16:28:36" "2022/07/29 17:17:02") ; End File Header ; External resources ; (list (list (quote :sound) "#P\"../../../out-files/my_synt.aiff\"" "#P\"../../../in-files/africa.aiff\"")) (in-package :om)(load-lib-for (quote ("OMChroma")))(setf *om-current-persistent* (om-load-patch1 "020-vocoder-1" (quote ((let ((box (om-load-boxcall (quote genfun) "SOUND-STEREO-TO-MONO" (quote sound-stereo-to-mono) (quote ((om-load-inputfun (quote input-funbox) "a sound" "S" nil))) (om-make-point 419 82) nil nil nil nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcomment "comment 2" (om-make-point 134 42) (quote "Csound instrument for$the generated class") "" (om-make-point 968 27) nil (om-make-color 1.0 0.0 0.0) (om-make-font "Arial" 12.0D0 :family "Arial" :style (quote (:plain)) :mode (quote nil))))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "list" (quote list) (quote nil) (om-make-point 284 438) (om-make-point 102 30) "f1 0 4096 10 1" "\"f1 0 4096 10 1\"" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-editor-box1 "my_synt.aiff" (quote sound) (quote ((om-load-inputfun (quote input-funbox) "object" "self" nil) (om-load-inputfun (quote input-funbox) "a track index for multichannel mixing (0 = no specific track)" "tracknum" 0) (om-load-inputfun (quote input-funbox) "a list of markers (s)" "markers" nil))) (om-make-point 181 542) (om-make-point 260 104) (let ((newobj (let ((thesound (load-sound (om-make-pathname :directory (quote (:relative "out-files")) :device :unspecific :host :unspecific :name "my_synt" :type "aiff") 0 1.0 0))) (when thesound (setf (markers thesound) (quote nil))) thesound))) (load-port-info newobj (quote nil)) (init-mus-color newobj (quote nil)) (set-extra-pairs newobj (quote nil)) (set-patch-pairs newobj (quote nil)) (set-name newobj "my_synt.aiff") (set-tonalite newobj nil) newobj) nil nil (pairlis (quote (outport inport player zoom grillestep mode winsize winpos show-spectrum deltapict obj-mode cmnpref notechancolor? show-stems scale)) (list nil nil (quote :om-audio) 1 nil 0 (om-make-point 370 280) (om-make-point 400 20) nil (om-make-point 0 0) 0 (let ((newobj (make-instance (quote edition-values)))) (setf (paper-size newobj) (om-make-point 600 800)) (setf (top-margin newobj) 2) (setf (left-margin newobj) 1) (setf (right-margin newobj) 1) (setf (bottom-margin newobj) 1) (setf (orientation newobj) nil) (setf (scale newobj) nil) (setf (system-space newobj) (quote (1))) (setf (system-color newobj) (quote nil)) (setf (line-space newobj) 1) (setf (title newobj) nil) (setf (show-title? newobj) nil) (setf (show-page? newobj) nil) (setf (sheet-id newobj) nil) (setf (page-mode newobj) nil) newobj) nil (quote t) nil)) t nil nil nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote genfun) "SYNTHESIZE" (quote synthesize) (quote ((om-load-inputfun (quote input-funbox) "something to synthesize..." "ELEMENTS" nil) (om-load-inputkeyword (quote input-keyword) "" "tables" (quote :tables) nil nil) (om-load-inputkeyword (quote input-keyword) "" "run" (quote :run) nil nil))) (om-make-point 226 469) nil nil nil nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "aux 5" (quote t) (quote nil) (om-make-point 518 293) (om-make-point 38 30) 0.5 "0.5" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "aux 4" (quote t) (quote nil) (om-make-point 481 293) (om-make-point 27 30) 1 "1" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "aux 3" (quote t) (quote nil) (om-make-point 448 263) (om-make-point 41 30) 880 "880" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "aux 2" (quote t) (quote nil) (om-make-point 421 293) (om-make-point 41 30) 440 "440" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote bastype) "aux" (quote t) (quote nil) (om-make-point 400 263) (om-make-point 27 30) 1 "1" nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-editor-box1 "VC10-2" (quote vc10-2) (quote ((om-load-inputfun (quote input-funbox) "Synthesis event" "self" nil) (om-load-inputfun (quote input-funbox) "Number of components [int]" "numcols" 1) (om-load-inputfun (quote input-funbox) "Event offset [s]" "action-time" 0) (om-load-inputfun (quote input-funbox) "A lambda function applied to each component" "user-fun" nil) (om-load-inputkeyword (quote editor-keyword) "" "e-dels" (quote :e-dels) 0 nil) (om-load-inputkeyword (quote editor-keyword) "" "durs" (quote :durs) 1 nil) (om-load-inputkeyword (quote editor-keyword) "" "p4" (quote :p4) 0 nil) (om-load-inputkeyword (quote editor-keyword) "" "p5" (quote :p5) 0 nil) (om-load-inputkeyword (quote editor-keyword) "" "p6" (quote :p6) 0 nil) (om-load-inputkeyword (quote editor-keyword) "" "p7" (quote :p7) 0 nil) (om-load-inputkeyword (quote editor-keyword) "" "p8" (quote :p8) 0 nil))) (om-make-point 223 323) (om-make-point 320 106) (let ((rep (if (find-class (quote vc10-2) nil) (let ((rep (make-instance (quote vc10-2) :numcols 1))) (when (member (quote e-dels) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote e-dels)) 0)) (when (member (quote durs) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote durs)) 5.2302947)) (when (member (quote p4) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote p4)) 1)) (when (member (quote p5) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote p5)) 440)) (when (member (quote p6) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote p6)) 880)) (when (member (quote p7) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote p7)) 1)) (when (member (quote p8) (get-init-slots-of-class (quote vc10-2)) :key (quote car)) (setf (slot-value rep (quote p8)) 0.5)) (setf (lcontrols rep) (list)) (setf (action-time rep) 0) (setf (data rep) (list (list 0) (list 5.2302947) (list 1) (list 440) (list 880) (list 1) (list 0.5))) rep)))) (put-precision rep (list 3)) rep) nil nil (pairlis (quote (panel-list cur-group-ind show-opt-fields color-list winsize winpos)) (list (list (list "All open" (list 0 (quote t)) (list 1 (quote t)) (list 2 (quote t)) (list 3 (quote t)) (list 4 (quote t)) (list 5 (quote t)) (list 6 (quote t))) (list "All close" (list 0 nil) (list 1 nil) (list 2 nil) (list 3 nil) (list 4 nil) (list 5 nil) (list 6 nil))) 0 (quote t) (list (om-make-color 0 0 0) (om-make-color 0 0 0) (om-make-color 0 0 0) (om-make-color 0 0 0) (om-make-color 0 0 0) (om-make-color 0 0 0) (om-make-color 0 0 0)) (om-make-point 500 280) (om-make-point 10 40))) nil nil nil nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcomment "comment 2" (om-make-point 181 42) (quote "Valutare per creare una$classe da un'orchestra Csound") "" (om-make-point 104 25) nil (om-make-color 1.0 0.0 0.0) (om-make-font "Arial" 12.0D0 :family "Arial" :style (quote (:plain)) :mode (quote nil))))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcomment "comment 3" (om-make-point 367 98) (quote " idur = p3$ igain = p4$ ilow = p5 ; the lowest frequency for the vocoder$ ihigh = p6 ; the highest frequency for the vocoder$ itable = p7 ; which waveform to use for the oscillators$ ibandadj = p8 ; an adjustment factor to make smaller-width bands") "" (om-make-point 553 325) nil (om-make-color 1.0 0.0 0.0) (om-make-font "Arial" 12.0D0 :family "Arial" :style (quote (:plain)) :mode (quote nil))))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-editor-box1 "TEXTFILE" (quote textfile) (quote ((om-load-inputfun (quote input-funbox) "object" "self" nil) (om-load-inputfun (quote input-funbox) "input data or text" "exp-list" nil) (om-load-inputfunmenu1 (quote input-funmenu) "append or supersede" "ed-mode" "supersede" (list (list "append" "append") (list "supersede" "supersede"))) (om-load-inputfunmenu1 (quote input-funmenu) "eval interpretation mode" "eval-mode" "list" (list (list "text" "text") (list "data list" "data") (list "list" "list") (list "value" "value"))))) (om-make-point 902 77) (om-make-point 291 112) (load-buffer-textfile (quote ("instr 2 ; 10 band vocoder - geometric bands" " idur = p3" " igain = p4" " ilow = p5 ; the lowest frequency for the vocoder" " ihigh = p6 ; the highest frequency for the vocoder" " itable = p7 ; which waveform to use for the oscillators" " ibandadj = p8 ; an adjustment factor to make smaller-width bands" " " " acar soundin \"vc10.wav\"" " " " ; determine the frequency bands" " " " icoef pow ( ihigh / ilow ), ( 1. / 9. )" " " " ib0=ilow;" "" "" " ib1 = ib0 * icoef" " ib2 = ib1 * icoef" " ib3 = ib2 * icoef" " ib4 = ib3 * icoef" " ib5 = ib4 * icoef" " ib6 = ib5 * icoef" " ib7 = ib6 * icoef" " ib8 = ib7 * icoef" " ib9 = ib8 * icoef" " " " ;create a bunch of oscillators with which to recreate the input signal" " " " ar0 oscil 1,ib0,itablec" " ar1 oscil 1,ib1,itablec" " ar2 oscil 1,ib2,itablec" " ar3 oscil 1,ib3,itablec" " ar4 oscil 1,ib4,itablec" " ar5 oscil 1,ib5,itablec" " ar6 oscil 1,ib6,itablec" " ar7 oscil 1,ib7,itablec" " ar8 oscil 1,ib8,itablec" " ar9 oscil 1,ib9,itablec" "" "" " ; measure frequency band content of input " " " " abpc0 butterbp acar, ib0, ib0*(icoef-1.0)*ibandadj" " abpc1 butterbp acar, ib1, ib1*(icoef-1.0)*ibandadj" " abpc2 butterbp acar, ib2, ib2*(icoef-1.0)*ibandadj" " abpc3 butterbp acar, ib3, ib3*(icoef-1.0)*ibandadj" " abpc4 butterbp acar, ib4, ib4*(icoef-1.0)*ibandadj" " abpc5 butterbp acar, ib5, ib5*(icoef-1.0)*ibandadj" " abpc6 butterbp acar, ib6, ib6*(icoef-1.0)*ibandadj" " abpc7 butterbp acar, ib7, ib7*(icoef-1.0)*ibandadj" " abpc8 butterbp acar, ib8, ib8*(icoef-1.0)*ibandadj" " abpc9 butterbp acar, ib9, ib9*(icoef-1.0)*ibandadj" " " " ;recreate the input signal using an oscillator for each frequency band" " " " av0 balance ar0, abpc0" " av1 balance ar1, abpc1" " av2 balance ar2, abpc2" " av3 balance ar3, abpc3" " av4 balance ar4, abpc4" " av5 balance ar5, abpc5" " av6 balance ar6, abpc6" " av7 balance ar7, abpc7" " av8 balance ar8, abpc8" " av9 balance ar9, abpc9" " " " ; Mix and output" " " " aenv linseg 0, 0.01, 1, idur - 0.02, 1, 0.01, 0" " " " amixl = 0.9*( av0 + av2 + av4 + av6 + av8 )" " amixl = amixl * aenv * igain " " amixr = 0.9*(av1+av3+av5+av7+av9)" " amixr = amixr * aenv * igain" " " " outs p4*amixr, p4*amixl" " " "endin" "" "" "")) (quote textfile) "supersede" "list") "x" nil (pairlis (quote (winsize winpos)) (list (om-make-point 335 275) (om-make-point 10 40))) t nil nil nil))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote genfun) "SOUND-DUR" (quote sound-dur) (quote ((om-load-inputfun (quote input-funbox) "a sound object or file pathname" "S" nil))) (om-make-point 340 182) nil nil nil nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcomment "comment 2" (om-make-point 165 42) (quote "Valutare per impostare il file$audio giusto in SSDIR") "" (om-make-point 610 158) nil (om-make-color 1.0 0.0 0.0) (om-make-font "Arial" 12.0D0 :family "Arial" :style (quote (:plain)) :mode (quote nil))))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcomment "comment" (om-make-point 273 42) (quote "Salvataggio del file scelto in SSDIR per Csound:$#P\"/Users/fabio/lib/SSDIR/vc10.wav\"") "" (om-make-point 615 67) nil (om-make-color 1.0 0.0 0.0) (om-make-font "Arial" 12.0D0 :family "Arial" :style (quote (:plain)) :mode (quote nil))))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote genfun) "FILE-CHOOSER" (quote file-chooser) (quote nil) (om-make-point 552 60) nil (list (om-make-pathname :directory (quote (:absolute "Users" "fabio" "lib" "SSDIR")) :device :unspecific :host nil :name "vc10" :type "wav")) "x" nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote genfun) "SAVE-SOUND" (quote save-sound) (quote ((om-load-inputfun (quote input-funbox) "a sound or om-sound-data buffer" "SELF" nil) (om-load-inputfun (quote input-funbox) "output file pathname" "FILENAME" nil))) (om-make-point 538 145) nil nil nil nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-editor-box1 "africa.aiff" (quote sound) (quote ((om-load-inputfun (quote input-funbox) "object" "self" nil) (om-load-inputfun (quote input-funbox) "a track index for multichannel mixing (0 = no specific track)" "tracknum" 0) (om-load-inputfun (quote input-funbox) "a list of markers (s)" "markers" nil))) (om-make-point 382 23) (om-make-point 108 53) (let ((newobj (let ((thesound (load-sound (om-make-pathname :directory (quote (:relative "in-files")) :device :unspecific :host :unspecific :name "africa" :type "aiff") 0 1.0 0))) (when thesound (setf (markers thesound) (quote nil))) thesound))) (load-port-info newobj (quote nil)) (init-mus-color newobj (quote nil)) (set-extra-pairs newobj (quote nil)) (set-patch-pairs newobj (quote nil)) (set-name newobj "africa.aiff") (set-tonalite newobj nil) newobj) "x" nil (pairlis (quote (scale show-stems notechancolor? cmnpref obj-mode deltapict show-spectrum winpos winsize mode grillestep zoom player inport outport)) (list nil (quote t) nil (let ((newobj (make-instance (quote edition-values)))) (setf (paper-size newobj) (om-make-point 600 800)) (setf (top-margin newobj) 2) (setf (left-margin newobj) 1) (setf (right-margin newobj) 1) (setf (bottom-margin newobj) 1) (setf (orientation newobj) nil) (setf (scale newobj) nil) (setf (system-space newobj) (quote (1))) (setf (system-color newobj) (quote nil)) (setf (line-space newobj) 1) (setf (title newobj) nil) (setf (show-title? newobj) nil) (setf (show-page? newobj) nil) (setf (sheet-id newobj) nil) (setf (page-mode newobj) nil) newobj) 0 (om-make-point 0 0) nil (om-make-point 400 20) (om-make-point 370 280) 0 nil 1 (quote :om-audio) nil nil)) t nil nil t))) (when (fboundp (quote set-active)) (set-active box nil)) box) (let ((box (om-load-boxcall (quote genfun) "GET-INSTRUMENT" (quote get-instrument) (quote nil) (om-make-point 146 62) nil nil nil nil 1))) (when (fboundp (quote set-active)) (set-active box nil)) box))) (quote ((19 0 0 0 nil 0) (4 0 3 0 nil 0) (10 0 4 0 nil 0) (2 0 4 1 nil 0) (14 0 10 5 nil 0) (9 0 10 6 nil 0) (8 0 10 7 nil 0) (7 0 10 8 nil 0) (6 0 10 9 nil 0) (5 0 10 10 nil 0) (19 0 14 0 nil 0) (0 0 18 0 nil 0) (17 0 18 1 nil 0))) nil 7.0))