cerberus-save-preset   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/instruments/cerberus_fileio-scm.xtm

Implementation

(define cerberus-save-preset
  (let ((i 0) (j 0)
        (dict '()))
    (lambda (inst filename)
      (set! dict '())
      ;;
      ;; oscillators
      ;;
      ;; amplitude of osc
      (set! dict (cons (cons 'osc1_amp (get_osc1_amp inst)) dict))
       ;; waveform of osc 1 (PARAM_SINE,PARAM_SAW,PARAM_PULSE,PARAM_TRI,PARAM_WT)
      (set! dict (cons (cons 'osc1_wave (get_osc1_wave inst)) dict))
      ;; frequency shift of osc - tuning - 2.0 up tune 0.5 down tune etc..
      (set! dict (cons (cons 'osc1_tune (get_osc1_tune inst)) dict))
      ;; pulse width (for PARAM_PULSE wave) 0.0-1.0 (0.5 is square)
      (set! dict (cons (cons 'osc1_pw (get_osc1_pw inst)) dict))
      ;; stereo pan (default is 0.5)
      (set! dict (cons (cons 'osc1_phase (get_osc1_phase inst)) dict))
      ;; if osc1 is a wavetable then store the wavetable
      (if (= (get_osc1_wave inst) PARAM_WT)
          (let ((wt (get_osc1_wt inst)))
            (set! dict (cons (cons 'osc1_wt (cerberus_get_wt_expr wt)) dict))))


Back to Index