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    /digego/extempore/tree/v0.8.9/tests/core/xtlang.xtm
  • aiProcess_FindInstances    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • dl_fm_h    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • dl_fm_h    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • dl_fm_idx    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • dl_fm_idx    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/tests/core/algebraic_data_types.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/tests/core/algebraic_data_types.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/libs/base/prelude.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/libs/base/prelude.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/algebraic_data_types.xtm
  • fmap    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/algebraic_data_types.xtm
  • fmsynth    scheme    /digego/extempore/tree/v0.8.9/examples/core/mtaudio.xtm
  • fmsynth    scheme    /digego/extempore/tree/v0.8.9/examples/core/scheduler.xtm
  • fmsynth    scheme    /digego/extempore/tree/v0.8.9/examples/external/spectrogram.xtm
  • fmsynth_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/fmsynth.xtm
  • impc:ti:check-bang-against-reified    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:find-unresolved-simple-types    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • instrument_find_note    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • make-instrument    macro    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • make_instrument    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments.xtm
  • make_instrument    xtlang    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext.xtm
  • my-gl-loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluid_dynamics.xtm
  • my-inc-maker    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-inc-maker-wrapper    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-inc-test    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-1    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-1    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-10    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-11    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-12    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-13    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-1f    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-2    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-3    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-4    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-6    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-7    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-8    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test-9    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test14    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test15    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test16    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test17    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test18    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test19    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test20    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test25    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test26    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test27    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test28    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-test29    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • my-tuple-chk    scheme    /digego/extempore/tree/v0.8.9/tests/core/constraints.xtm
  • my_button_cb    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gui.xtm
  • my_checkbox_cb    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gui.xtm
  • my_osc_send    xtlang    /digego/extempore/tree/v0.8.9/examples/core/osc_101.xtm
  • my_radio_cb    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gui.xtm
  • my_slider2D_cb    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gui.xtm
  • my_slider_cb    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gui.xtm
  • myf    scheme    /digego/extempore/tree/v0.8.9/tests/core/xtlang.xtm
  • myf    scheme    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • myprint    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • myprint    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • myprint    xtlang    /digego/extempore/tree/v0.8.9/examples/core/extempore_lang.xtm
  • set_dl_fm    xtlang    /digego/extempore/tree/v0.8.9/libs/core/instruments/dlogue.xtm
  • set_instance_matrices    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • simple-bone-vert-xtm    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • simple-frag    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • simple-segment:name    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • simple-segment?    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • simple-var:name    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • simple-var?    scheme    /digego/extempore/tree/v0.8.9/libs/base/pattern.xtm
  • simple-vert    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • simple-vert-xtm    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • xtm_render_init_simple_bone_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm
  • xtm_render_init_simple_shader    xtlang    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline.xtm