my_simple_fm_inst   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/core/midi_synth.xtm

Implementation

(bind-func my_simple_fm_inst
  (lambda ()
    (let ((freq 440.0) (newfreq 440.0) ;; frequency
          (amp 1.0) (newamp 1.0)       ;; amplitude
          (a 10.0) (b 0.1) ;; fm params (midi cc 21 & 22)
          (attack 100.0) (decay 200.0) (sustain 0.75) (release 200.0)
          (gate 0.0)      ;; gate (as per analogue synth)
          (pitch:i32 0)   ;; to help with note off
          (glide 0.001:f) ;; frequency glide amount (midi cc 23)
          (wet 0.35)      ;; amount of delay (midi cc 24)
          (adsr (adsr_c)) ;; adsr all in ms (midi cc 25,26,27,28)
          (osc1 (osc_mc_c 0.0))
          (lfo1 (osc_mc_c 0.0))
          (dly (delay_st_c (/ SR 6) (/ SR 4))))
      (lambda (chan:i64)
        (if (< (fabs (- newfreq freq)) 5.0) ;; portamento
            (set! freq newfreq)
            (set! freq (+ freq (* glide (- newfreq freq)))))
        (if (< (fabs (- newamp amp)) 0.05)
            (set! amp newamp)
            (set! amp (+ amp (* 0.0001:f (- newamp amp)))))
        (dly chan
             (* (adsr chan gate attack decay sustain release)
                (osc1 chan (* 0.25 amp)
                      (+ freq
                         (lfo1 chan
                               (* a b freq)
                               (* a freq)))))
             wet 0.75)))))


Back to Index

Similar Entries

  • MyLittleCleanupTest    xtlang
  • aiProcess_FindInstances    scheme
  • dl_fm_h    xtlang
  • dl_fm_h    xtlang
  • dl_fm_idx    xtlang
  • dl_fm_idx    xtlang
  • fmap    xtlang
  • fmap    xtlang
  • fmap    xtlang
  • fmap    xtlang
  • fmap    xtlang
  • fmap    xtlang
  • fmsynth    scheme
  • fmsynth    scheme
  • fmsynth    scheme
  • fmsynth_note    xtlang
  • impc:ti:check-bang-against-reified    scheme
  • impc:ti:find-unresolved-simple-types    scheme
  • instrument_find_note    xtlang
  • make-instrument    macro
  • make_instrument    xtlang
  • make_instrument    xtlang
  • my-gl-loop    xtlang
  • my-inc-maker    xtlang
  • my-inc-maker-wrapper    xtlang
  • my-inc-test    xtlang
  • my-test-1    xtlang
  • my-test-1    xtlang
  • my-test-10    xtlang
  • my-test-11    xtlang
  • my-test-12    xtlang
  • my-test-13    xtlang
  • my-test-1f    xtlang
  • my-test-2    xtlang
  • my-test-3    xtlang
  • my-test-4    xtlang
  • my-test-6    xtlang
  • my-test-7    xtlang
  • my-test-8    xtlang
  • my-test-9    xtlang
  • my-test14    xtlang
  • my-test15    xtlang
  • my-test16    xtlang
  • my-test17    xtlang
  • my-test18    xtlang
  • my-test19    xtlang
  • my-test20    xtlang
  • my-test25    xtlang
  • my-test26    xtlang
  • my-test27    xtlang
  • my-test28    xtlang
  • my-test29    xtlang
  • my-tuple-chk    scheme
  • my_button_cb    xtlang
  • my_checkbox_cb    xtlang
  • my_osc_send    xtlang
  • my_radio_cb    xtlang
  • my_slider2D_cb    xtlang
  • my_slider_cb    xtlang
  • myf    scheme
  • myf    scheme
  • myprint    xtlang
  • myprint    xtlang
  • myprint    xtlang
  • set_dl_fm    xtlang
  • set_instance_matrices    xtlang
  • simple-bone-vert-xtm    scheme
  • simple-frag    scheme
  • simple-segment:name    scheme
  • simple-segment?    scheme
  • simple-var:name    scheme
  • simple-var?    scheme
  • simple-vert    scheme
  • simple-vert-xtm    scheme
  • xtm_render_init_simple_bone_shader    xtlang
  • xtm_render_init_simple_shader    xtlang