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
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_greaterthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtm_lessthan    xtlang
  • xtmdoc-alist-lessthan    scheme