store_frame_OLA   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm

Implementation

;--------------------------------------------------------------------------------------------------------------------
;Overlap-Add
;This is only included for demonstration purposes, and whacky effects.
;This is the most basic of algorithms for time stretching, and modifies the pitch as well as time.
;Could include applying a window function.
;If the sample_Sa calculation is set to be the same as every other method, the stereo field signal will flip back and forth.
;--------------------------------------------------------------------------------------------------------------------
(bind-func store_frame_OLA
  (lambda (window_size:i64)
  (let ((read_head:i64 0)
        (write_head:i64 0))
    (lambda (input_buffer:float* in_size:i64 output_buffer:float* out_size:i64 Sa:i64 Ss:i64)
      (let ((n:i64 0)
            (window_buffer:float* (salloc window_size)))
        (dotimes (n window_size)
          (pset! window_buffer n (* 0.5 (pref input_buffer (% (+ n read_head) in_size)))))
        (set! read_head (% (+ read_head Sa ) in_size))   ;Advance the playhead by the Analysis hopsize
        (dotimes (n window_size)  ;Overlap-Add section
          (cond ((< n (- window_size Ss))
                  (pset! output_buffer (% (+ write_head n) out_size) (+ (pref window_buffer n)
                                                                     (pref output_buffer (% (+ write_head n) out_size)))))
                (else
                  (pset! output_buffer (% (+  write_head n) out_size) (pref window_buffer n)))))
        (set! write_head (% (+ write_head Ss ) out_size))
        (set! TSM_active 1)
        void
        )))))


Back to Index

Similar Entries

  • Complex_multiplication_polar    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • Cpolar    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/gsl.xtm
  • TSM_TIM_OLA    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • draw_color_body_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm
  • draw_color_body_frame_with_hands    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm
  • draw_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/chipmunk-simple.xtm
  • draw_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/external/going-native.xtm
  • draw_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/external/openvg.xtm
  • draw_rgb_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/orbbec_test.xtm
  • get_focused_frame    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_frame    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_frame_byident    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_frame_count    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_frame_identifiers    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_frame_names    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • get_main_frame    xtlang    /digego/extempore/tree/v0.8.9/libs/external/cef/cef.xtm
  • glfw_get_framebuffer_height    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • glfw_get_framebuffer_width    xtlang    /digego/extempore/tree/v0.8.9/libs/external/glfw3.xtm
  • ndiff_extrapolated    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • read_and_write_frame    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/opencv_test.xtm
  • sf_frames    xtlang    /digego/extempore/tree/v0.8.9/libs/external/sndfile.xtm
  • sf_frames_from_file    xtlang    /digego/extempore/tree/v0.8.9/libs/external/sndfile.xtm
  • sf_set_frames    xtlang    /digego/extempore/tree/v0.8.9/libs/external/sndfile.xtm
  • store_frame_PV    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • store_frame_iPL    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • store_frame_sPL    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • vcframe    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/opencv_test.xtm
  • xtm_frame_data_to_tex    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm