store_frame_iPL   xtlang


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

Implementation

;This function extracts a frame from the input buffer, multiplies by a constant,
;splits the signal into left and right, then re-interleaves to reconstruct the frame.
;This frame is then copied to the output buffer.
(bind-func store_frame_iPL
  (lambda (window_size:i64)
  (let ((read_head:i64 0)
        (write_head:i64 0)
        ;(PV_left (phase_vocoder_iPL (/ window_size IN_CHANNELS)))
        ;(PV_right (phase_vocoder_iPL (/ window_size IN_CHANNELS)))
        (PV_mid (phase_vocoder_iPL (/ window_size 2))) ;replace 2 with IN_CHANNELS if using 0.7.0 release
        (PV_side (phase_vocoder_iPL (/ window_size 2)))) ;replace 2 with IN_CHANNELS if using 0.7.0 release
    (lambda (input_buffer:float* in_size:i64 output_buffer:float* out_size:i64 Sa:i64 Ss:i64)
      (let ((n:i64 0)
            (window_buffer_in:float* (salloc window_size))
            (window_buffer_out:float* (salloc window_size))
            (left_right_size:i64 (/ window_size 2)) ;replace 2 with IN_CHANNELS if using 0.7.0 release
            ;(left:float* (salloc left_right_size))
            ;(right:float* (salloc left_right_size))
            (mid:float* (salloc left_right_size))
            (side:float* (salloc left_right_size)))
        (dotimes (n window_size)
          (pset! window_buffer_in n (pref input_buffer (% (+ n read_head) in_size))))
        (set! read_head (% (+ read_head Sa ) in_size))   ;Advance the playhead by the Analysis hopsize
        ;(LR_split window_buffer left right window_size)
        ;(PV_left left (/ Sa IN_CHANNELS) (/ Ss IN_CHANNELS))
        ;(PV_right right (/ Sa IN_CHANNELS) (/ Ss IN_CHANNELS))
        ;(LR_combine window_buffer left right window_size)
        (LR_to_MS_2_channels window_buffer_in window_size mid side)
        (PV_mid mid (/ Sa 2) (/ Ss 2)) ;replace 2 with IN_CHANNELS if using 0.7.0 release
        (PV_side side (/ Sa 2) (/ Ss 2)) ;replace 2 with IN_CHANNELS if using 0.7.0 release
        (MS_to_LR_2_channels window_buffer_out window_size mid side)
        (dotimes (n window_size)  ;Overlap-Add section
          (cond ((< n (- window_size Ss))
                  (pset! output_buffer (% (+ write_head n) out_size) (+ (pref window_buffer_out n)
                                                                     (pref output_buffer (% (+ write_head n) out_size)))))
                (else
                  (pset! output_buffer (% (+  write_head n) out_size) (pref window_buffer_out n)))))
        (set! write_head (% (+ write_head Ss ) out_size))
        (set! TSM_active 1)
        void
        )))))


Back to Index

Similar Entries

  • Complex_multiplication_bybuf    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • Complex_multiplication_bybuf    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • Complex_multiplication_polar    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • TSM_TIM_iPL    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
  • phase_vocoder_iPL    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.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_OLA    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • store_frame_PV    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
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm
  • xtm_multiplication    xtlang    /digego/extempore/tree/v0.8.9/libs/core/math_ext.xtm