sampler-parse-spn-filename   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/external/instruments_ext-scm.xtm

Implementation

;; match the first pitch (in scientific pitch notation) in the filename if you
;; need more subtlety (e.g. if there are multiple patterns which might be
;; matched) then supply a different parser function
(define sampler-parse-spn-filename
  (lambda (filename)
    (let ((result (regex:matched filename  "([abcdefgABCDEFG][#b]?-?[0-9]).*\\.(wav|WAV|aif|AIF|aiff|AIFF|ogg|OGG)$")))
      (if (null? result)
          #f
          (list filename (scientific-pitch-notation-to-midi-number (cadr result)) 0 0)))))


Back to Index