Subject: [bug#58208] [PATCH v2 9/9] gnu: Add nnls-chroma.

From: Lilah Tascheter <[email-masked]>
Date: Fri, 2 Jun 2023 00:56:46 -0500

* gnu/packages/audio.scm (nnls-chroma): New variable.
---
 gnu/packages/audio.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index c34ccb30a5..d7c11b0a5d 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -659,6 +659,44 @@ (define-public vamp-aubio-plugins
 description, and beat tracking.")
     (license license:gpl3+)))
 
+(define-public nnls-chroma
+  (package
+    (name "nnls-chroma")
+    (version "1.1")
+    (source (origin
+              (method url-fetch)
+              ;; These urls have an "attachment number" :/ which makes this url
+              ;; not generalizable across versions.
+              (uri (string-append
+                     "https://code.soundsoftware.ac.uk/attachments/download/"
+                     "1691/nnls-chroma-" version ".tar.gz"))
+              (sha256
+               (base32
+                "06n66ff4w4a07rfz1kn0hq2g953dsx8a4cx1bhpvswqds1kb70md"))))
+    (build-system gnu-build-system)
+    (arguments
+      (list #:tests? #f ;; no tests available
+            #:make-flags
+            #~(list "-f" "Makefile.linux"
+                    (string-append "CC=" #$(cc-for-target))
+                    (string-append "VAMP_SDK_DIR=" #$(this-package-input "vamp")
+                                   "/include/vamp-sdk"))
+            #:phases
+            #~(modify-phases %standard-phases
+                (delete 'configure) ; no configure script
+                (replace 'install
+                  (lambda _
+                    (install-file "nnls-chroma.so"
+                                  (string-append #$output "/lib/vamp")))))))
+    (inputs (list boost vamp))
+    (home-page "http://www.isophonics.net/nnls-chroma/")
+    (synopsis "VAMP plugins for audio transcription")
+    (description "This is a set of three VAMP plugins used for audio
+transcription: NNLS Chroma, providing chromatic transcription, Chordino,
+providing chord transcription, and Tuning, which estimates local and global
+tuning.")
+    (license license:gpl2+)))
+
 (define-public dsp
   (package
     (name "dsp")
-- 
2.40.1