store_frame_PV   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_PV
  (lambda (window_size:i64)
  (let ((read_head:i64 0)
        (write_head:i64 0)
        ;(PV_left (phase_vocoder_PV (/ window_size IN_CHANNELS)))
        ;(PV_right (phase_vocoder_PV (/ window_size IN_CHANNELS)))
        (PV_mid (phase_vocoder_PV (/ window_size 2))) ;replace 2 with IN_CHANNELS if using 0.7.0 release
        (PV_side (phase_vocoder_PV (/ 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

  • TSM_TIM_PV    xtlang
  • cpBBClampVect    xtlang
  • cpBBWrapVect    xtlang
  • cpvadd    xtlang
  • cpvclamp    xtlang
  • cpvcross    xtlang
  • cpvdist    xtlang
  • cpvdistsq    xtlang
  • cpvdot    xtlang
  • cpveql    xtlang
  • cpverp    xtlang
  • cpvforangle    xtlang
  • cpvlength    xtlang
  • cpvlengthsq    xtlang
  • cpvlerp    xtlang
  • cpvlerpconst    xtlang
  • cpvmult    xtlang
  • cpvnear    xtlang
  • cpvneg    xtlang
  • cpvnormalize    xtlang
  • cpvproject    xtlang
  • cpvrerp    xtlang
  • cpvrotate    xtlang
  • cpvslerp    xtlang
  • cpvslerpconst    xtlang
  • cpvsub    xtlang
  • cpvtoangle    xtlang
  • draw_color_body_frame    xtlang
  • draw_color_body_frame_with_hands    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_frame    xtlang
  • draw_rgb_frame    xtlang
  • get_focused_frame    xtlang
  • get_frame    xtlang
  • get_frame_byident    xtlang
  • get_frame_count    xtlang
  • get_frame_identifiers    xtlang
  • get_frame_names    xtlang
  • get_main_frame    xtlang
  • glfw_get_framebuffer_height    xtlang
  • glfw_get_framebuffer_width    xtlang
  • godot_bool_pvar    xtlang
  • godot_string_pvar    xtlang
  • godot_vector2_pvar    xtlang
  • godot_vector3_pvar    xtlang
  • phase_vocoder_PV    xtlang
  • read_and_write_frame    xtlang
  • sf_frames    xtlang
  • sf_frames_from_file    xtlang
  • sf_set_frames    xtlang
  • store_frame_OLA    xtlang
  • store_frame_iPL    xtlang
  • store_frame_sPL    xtlang
  • vcframe    scheme
  • xtm_frame_data_to_tex    xtlang