TSM_TIM_sPL   xtlang


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

Implementation

(bind-func TSM_TIM_sPL
  (lambda ()
  (let ((in_offset_ptr:i64 0)
        (out_offset_ptr:i64 0)
        (output_sample:float 0.0)
        (in_size:i64 (bitwise-shift-left 2 20)) ;increase the second argument if audio is wrapping around circular buffer to soon
        (window_size:i64 8192) ;This is split between the number of input channels.  FFT size is window_size/IN_CHANNELS
        (out_size:i64 (* window_size 2))
        (input_buffer:float* (zalloc in_size))
        (output_buffer:float* (zalloc out_size))
        (window_buffer:float* (zalloc window_size))
        (framing (store_frame_sPL window_size))
        (first:i64 1))
  (lambda (in:float)
    (let ((overlap_factor:i64 4)
          (sample_Ss:i64 (/ window_size overlap_factor))
          (sample_Sa:i64 (ftoi64 (round (* (i64tof sample_Ss) speed))))) ;speed is a global variable
    (pset! input_buffer in_offset_ptr in) ;Set 'in' to whatever you want to be time stretched
    (if (= (% in_offset_ptr sample_Ss) 0)
      (if (= first 0)
          (framing input_buffer in_size output_buffer out_size sample_Sa sample_Ss)))
    (if (= in_offset_ptr window_size) ;Start the TSM process after window_size number of samples
          (set! first 0))
    (set! in_offset_ptr (% (+ in_offset_ptr 1) in_size))
    (cond ((= TSM_active 0)
            (set! output_sample 0.0))
          (else (set! output_sample (pref output_buffer out_offset_ptr))
                (set! out_offset_ptr (% (+ out_offset_ptr 1) out_size))
                output_sample)))))))


Back to Index

Similar Entries

  • LR_split    xtlang
  • PARAM_DELAY_TIME    scheme
  • PARAM_DELAY_TIME_LEFT    scheme
  • PARAM_DELAY_TIME_LEFT    scheme
  • PARAM_DELAY_TIME_RIGHT    scheme
  • PARAM_DELAY_TIME_RIGHT    scheme
  • PaStreamCallbackTimeInfo_print    xtlang
  • PaStreamCallbackTimeInfo_toString    xtlang
  • Pm_Event_Timestamp    xtlang
  • TSM_TIM_OLA    xtlang
  • TSM_TIM_PV    xtlang
  • TSM_TIM_iPL    xtlang
  • Widget_set_split    xtlang
  • Widget_split    xtlang
  • Widget_split_horizontal_p    xtlang
  • Widget_split_vertical_p    xtlang
  • Widget_swap_split_orientation    xtlang
  • aiProcess_OptimizeGraph    scheme
  • aiProcess_OptimizeMeshes    scheme
  • aiProcess_SplitByBoneCount    scheme
  • aiProcess_SplitLargeMeshes    scheme
  • cond-expand-runtime    scheme
  • dotimes    macro
  • get_display_handler    xtlang
  • get_midi_evt_clocktime    xtlang
  • get_midi_evt_timestamp    xtlang
  • impc:aot:do-at-runtime    macro
  • impc:ir:split-and-decode-poly-adhoc-name    scheme
  • impc:ti:dotimes    scheme
  • impc:ti:dotimes-check    scheme
  • impc:ti:split-namedfunc    scheme
  • impc:ti:split-namedtype    scheme
  • is_TSM_active    xtlang
  • join-clock-time    scheme
  • make-timeline    scheme
  • nnsock_set_recv_timeout    xtlang
  • nnsock_set_send_timeout    xtlang
  • nnsock_set_timeout    xtlang
  • phase_vocoder_sPL    xtlang
  • pm_current_time_in_ms    xtlang
  • regex:type-split    scheme
  • regex_split    xtlang
  • regex_split    xtlang
  • split-by    scheme
  • split-clock-time    scheme
  • splitjoin    xtlang
  • store_frame_sPL    xtlang
  • times-5    scheme