AudioBuffer_concat   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm

Implementation

(bind-func AudioBuffer_concat
  (lambda (ab1:AudioBuffer* ab2:AudioBuffer*)
    (if (or (<> (AudioBuffer_samplerate ab1) (AudioBuffer_samplerate ab2))
            (<> (AudioBuffer_channels ab1) (AudioBuffer_channels ab2)))
        (begin (println "Error: cannot concat incompatible audiobuffers") null) ;; return null on error!
        (let ((new (AudioBuffer (+ (AudioBuffer_frames ab1) (AudioBuffer_frames ab2))
                                (AudioBuffer_channels ab1)
                                (AudioBuffer_samplerate ab1)))
              (dat1 (AudioBuffer_ptr new 0 0))
              (dat2 (AudioBuffer_ptr new (AudioBuffer_frames ab1) 0)))
          (memcpy (cast dat1) (cast (AudioBuffer_ptr ab1 0 0)) (* (AudioBuffer_frames ab1) (AudioBuffer_channels ab1) 4))
          (memcpy (cast dat2) (cast (AudioBuffer_ptr ab2 0 0)) (* (AudioBuffer_frames ab2) (AudioBuffer_channels ab2) 4))
          new))))


Back to Index

Similar Entries

  • AudioBuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_cstring    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_data_b64    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_data_b64_cstring    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_from_aiff    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_from_wave    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_malloc    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_interp    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_interp_mix    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_interp_pw    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_looped    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_looped    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_set_data_b64    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_shared_data    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • concat    xtlang    /digego/extempore/tree/v0.8.9/libs/core/adt.xtm
  • set_sampler_audiobuffer    xtlang    /digego/extempore/tree/v0.8.9/libs/external/instruments_ext.xtm