greater_than_neighbours   xtlang


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

Implementation

;Compare a value in an array with neighbours. neighbours is per side
(bind-func greater_than_neighbours
  (lambda (buffer:float* offset:i64 num_neighbours:i64)
    (let ((n:i64 0)
          (peak:i64 1))
      (dotimes (n num_neighbours)
        (cond ((and (= peak 1) (> (pref buffer offset) (pref buffer (+ offset (+ n 1)))) (> (pref buffer offset) (pref buffer (- offset (+ n 1)))))
                (set! peak 1))
              (else
                (set! peak 0))))
      peak)))


Back to Index

Similar Entries

  • aiProcess_MakeLeftHanded    scheme    /digego/extempore/tree/v0.8.9/libs/external/assimp.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_greaterthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtm_lessthan    xtlang    /digego/extempore/tree/v0.8.9/libs/core/rational.xtm
  • xtmdoc-alist-lessthan    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm