cerberus_create_lfos   xtlang


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

Implementation

(bind-func cerberus_create_lfos
  (lambda (lfos:|4,|8,[SAMPLE,i64,i64]*||* i:i64 frequency:SAMPLE onecycleinhz:SAMPLE mod_amp:|4,SAMPLE|* mod_frq:|4,SAMPLE|* mod_phase:|4,SAMPLE|* mod_options:|4,i32|* mod_attack:|4,SAMPLE|* mod_decay:|4,SAMPLE|* mod_attack_slope:|4,SAMPLE|* mod_decay_slope:|4,SAMPLE|*)
    (let ((opts (aref mod_options i))
          (notedur:SAMPLE (if (> (& opts LFO_OPT_NOTEDUR) 0) onecycleinhz 1.0))
          (amod:SAMPLE (if (> (& opts LFO_OPT_FRQ_TO_AMP) 0) frequency 1.0))
          (fmod:SAMPLE (* notedur (if (> (& opts LFO_OPT_FRQ_TO_FRQ) 0) frequency 1.0))))
      (aset! lfos i
        (array (let ((osc (osc_c (aref mod_phase i))))
                (lambda (chan:i64 idx:i64)
                  (osc (* amod (aref mod_amp idx))
                       (* fmod (aref mod_frq idx)))))
              (let ((osc (saw_c (aref mod_phase i))))
                (lambda (chan:i64 idx:i64)
                  (osc (* amod (aref mod_amp idx))
                       (* fmod (aref mod_frq idx)))))
              (let ((osc (pulse_c (aref mod_phase i))))
                (lambda (chan:i64 idx:i64)
                  (osc (* amod (aref mod_amp idx))
                       (* fmod (aref mod_frq idx))
                       0.5)))
              (let ((osc (tri_c (aref mod_phase i))))
                (lambda (chan:i64 idx:i64)
                  (osc (* amod (aref mod_amp idx))
                       (* fmod (aref mod_frq idx)))))
              (let ((osc (ad_c)))
                (cset! osc cycle #t i1)
                (lambda (chan:i64 idx:i64)
                  (osc chan 1.0
                        (aref mod_attack idx)
                        (aref mod_decay idx)
                        (aref mod_attack_slope idx)
                        (aref mod_decay_slope idx))))
              (lambda (chan:i64 idx:i64) (aref mod_amp idx)) ;; constant instead of WT
              (lambda (chan:i64 idx:i64) (aref mod_amp idx)) ;; constant
              (let ((cnt 0)
                    (rem:SAMPLE (* (aref mod_amp i) (random)))) ;; random S & H
                (lambda (chan:i64 idx:i64)
                  (if (and (= chan 0 )
                            (= (% cnt (ftoi64 (/ SRf (aref mod_frq idx)))) 0))
                      (begin
                        (set! cnt (+ cnt 1))
                        (set! rem (* (aref mod_amp idx) (random)))))
                  rem)) ;; random S & H
              )))
    void))


Back to Index

Similar Entries

  • FBO_create    xtlang
  • FBO_create_with_textures    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • ShaderProgram_create    xtlang
  • Shader_create    xtlang
  • Texture_create    xtlang
  • Texture_create_FBO_depth_texture    xtlang
  • VAO_create    xtlang
  • VAO_create_ss_quad    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • VBO_create    xtlang
  • apr_pool_create    xtlang
  • apr_pool_create    xtlang
  • cerberus-load-preset    scheme
  • cerberus-load-state    scheme
  • cerberus-reset    scheme
  • cerberus-save-preset    scheme
  • cerberus_amp_pitch_env_cc    xtlang
  • cerberus_cc    xtlang
  • cerberus_delay_cc    xtlang
  • cerberus_extras_cc    xtlang
  • cerberus_filter_cc    xtlang
  • cerberus_filter_env_cc    xtlang
  • cerberus_flanger_cc    xtlang
  • cerberus_frq_from_val    xtlang
  • cerberus_fx    xtlang
  • cerberus_get_filtertype    xtlang
  • cerberus_get_lfo_waveform    xtlang
  • cerberus_get_mod_matrix    xtlang
  • cerberus_get_noisetype    xtlang
  • cerberus_get_waveform    xtlang
  • cerberus_get_wt_expr    scheme
  • cerberus_lfo1_cc    xtlang
  • cerberus_lfo2_cc    xtlang
  • cerberus_lfo3_cc    xtlang
  • cerberus_lfo4_cc    xtlang
  • cerberus_logRamp    xtlang
  • cerberus_main_cc    xtlang
  • cerberus_matrix_cc    xtlang
  • cerberus_moog_ladder_inlined    xtlang
  • cerberus_note    xtlang
  • cerberus_octave_from_val    xtlang
  • cerberus_osc1_cc    xtlang
  • cerberus_osc2_cc    xtlang
  • cerberus_osc3_cc    xtlang
  • cerberus_osc4_cc    xtlang
  • cerberus_remove_file    xtlang
  • cerberus_reset    xtlang
  • cerberus_reset_lfos    xtlang
  • cerberus_reverb_cc    xtlang
  • cerberus_set_mod_matrix    xtlang
  • cerberus_sub_noise_cc    xtlang
  • create-zone    scheme
  • create-zone1    xtlang
  • create-zone2    xtlang
  • create_arrows_shader    xtlang
  • create_data    xtlang
  • create_fbo    xtlang
  • create_fbo_no_depth    xtlang
  • create_fbo_no_depth_rect    xtlang
  • create_fbo_rect    xtlang
  • create_heatmap_shader    xtlang
  • create_particles_shader    xtlang
  • create_points_shader    xtlang
  • create_post_process_shader    xtlang
  • create_raymarcher_shader    xtlang
  • create_shader    xtlang
  • create_shader_xtm    xtlang
  • create_shadertoy_shader    xtlang
  • create_texture_shader    xtlang
  • create_triangle_shader    xtlang
  • create_triangle_shader    xtlang
  • create_vbo    xtlang
  • create_walker_array    xtlang
  • fbo_create_depth_buffer    xtlang
  • fbo_create_depth_buffer_rect    xtlang
  • fbo_create_texture    xtlang
  • fbo_create_texture_rect    xtlang
  • fluid-cube-create    xtlang
  • fluid-cube-create    xtlang
  • fluid_cube_create    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_interaction_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_fullscreen_window    xtlang
  • glfw_create_interaction_window    xtlang
  • glfw_create_window    xtlang
  • glfw_init_and_create_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_compatibility_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_interaction_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_fullscreen_window    xtlang
  • glfw_init_and_create_interaction_compatibility_window    xtlang
  • glfw_init_and_create_interaction_window    xtlang
  • glfw_init_and_create_window    xtlang
  • impc:ir:compile:create_zone    scheme
  • impc:ti:create-scheme-wrapper    scheme
  • impc:ti:create-scm-wrapper?    scheme
  • impc:ti:create_zone-check    scheme
  • nnsock_create    xtlang
  • nnsock_create    xtlang
  • nvg_create_context    xtlang
  • nvg_create_font    xtlang
  • pa_create_default_stream    xtlang
  • pa_create_stream    xtlang
  • pm_create_input_stream    xtlang
  • pm_create_output_stream    xtlang
  • psystem_create    xtlang
  • psystem_create    xtlang
  • qr_create_l    xtlang
  • qr_create_with_level    xtlang
  • rados-pool-create    xtlang
  • world_create    xtlang
  • xtm-vg-create-context    scheme
  • xtm_create_path    xtlang
  • xtm_create_vgimage    xtlang
  • xtm_vg_create_contextf    xtlang
  • xtm_vg_create_contexti32    xtlang