TSM_TIM_PV   xtlang


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

Implementation

(bind-func TSM_TIM_PV
  (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_PV 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

  • PARAM_DELAY_TIME    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • PARAM_DELAY_TIME_LEFT    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • PARAM_DELAY_TIME_LEFT    scheme    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • PARAM_DELAY_TIME_RIGHT    scheme    /digego/extempore/tree/v0.8.9/libs/core/instruments-scm.xtm
  • PARAM_DELAY_TIME_RIGHT    scheme    /digego/extempore/tree/v0.8.9/examples/sharedsystem/audiosetup.xtm
  • PaStreamCallbackTimeInfo_print    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portaudio.xtm
  • PaStreamCallbackTimeInfo_toString    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portaudio.xtm
  • Pm_Event_Timestamp    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • TSM_TIM_OLA    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
  • TSM_TIM_sPL    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • aiProcess_OptimizeGraph    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • aiProcess_OptimizeMeshes    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • cond-expand-runtime    scheme    /digego/extempore/tree/v0.8.9/runtime/init.xtm
  • cpBBClampVect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpBBWrapVect    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpBB.xtm
  • cpvadd    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvclamp    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvcross    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvdist    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvdistsq    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvdot    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpveql    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpverp    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvforangle    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvlength    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvlengthsq    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvlerp    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvlerpconst    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvmult    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvnear    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvneg    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvnormalize    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvproject    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvrerp    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvrotate    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvslerp    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvslerpconst    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvsub    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • cpvtoangle    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/libchipmunk/cpVect.xtm
  • dotimes    macro    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • get_midi_evt_clocktime    xtlang    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • get_midi_evt_timestamp    xtlang    /digego/extempore/tree/v0.8.9/libs/external/midi.xtm
  • godot_bool_pvar    xtlang    /digego/extempore/tree/v0.8.9/examples/core/godot_test1.xtm
  • godot_string_pvar    xtlang    /digego/extempore/tree/v0.8.9/examples/core/godot_test1.xtm
  • godot_vector2_pvar    xtlang    /digego/extempore/tree/v0.8.9/examples/core/godot_test1.xtm
  • godot_vector3_pvar    xtlang    /digego/extempore/tree/v0.8.9/examples/core/godot_test1.xtm
  • impc:aot:do-at-runtime    macro    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:dotimes    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • impc:ti:dotimes-check    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • is_TSM_active    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • join-clock-time    scheme    /digego/extempore/tree/v0.8.9/libs/core/toplap_clock.xtm
  • make-timeline    scheme    /digego/extempore/tree/v0.8.9/runtime/scheme.xtm
  • nnsock_set_recv_timeout    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • nnsock_set_send_timeout    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • nnsock_set_timeout    xtlang    /digego/extempore/tree/v0.8.9/libs/external/nanomsg.xtm
  • phase_vocoder_PV    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • pm_current_time_in_ms    xtlang    /digego/extempore/tree/v0.8.9/libs/external/portmidi.xtm
  • split-clock-time    scheme    /digego/extempore/tree/v0.8.9/libs/core/toplap_clock.xtm
  • store_frame_PV    xtlang    /digego/extempore/tree/v0.8.9/libs/contrib/TSM_library.xtm
  • times-5    scheme    /digego/extempore/tree/v0.8.9/tests/core/system.xtm