;; 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)))))