From patchwork Sat Sep 7 05:01:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Antero Mejr X-Patchwork-Id: 67695 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0EAB027BBEA; Sat, 7 Sep 2024 06:02:22 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_VALIDITY_CERTIFIED, RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 1EBDC27BBE2 for ; Sat, 7 Sep 2024 06:02:21 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1smnaF-00077a-Pj; Sat, 07 Sep 2024 01:02:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smnaE-00077Q-Q8 for guix-patches@gnu.org; Sat, 07 Sep 2024 01:02:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1smnaE-0006cl-Gb for guix-patches@gnu.org; Sat, 07 Sep 2024 01:02:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=BAGwb63qCSQbr72QGBv07QyGJ4qbshiOj0B6/NqC8/g=; b=P1ySYtWdK5gRiX8OVjjQHkIvc2nasy5dkvKEM4eY459GW94siVm0LlH4A+8L9EwybdgioWqHQrZTo9gu1/3PYylmGKeXan1n5PVw77I1r9J6NCVx73TACaZZdiFtenltO4Fbo0BgqZJgILL8Klz1+IidveD25QPTZDb8a1H4n7UM90R1lP9w6B6WlCw8mBSRHQD7+Wab4rzx+CDFqk3yjmGH3u/ZAPo5KMjoup1Mnf4iliZD9Sl4C874PegRekta9zTe+orIXJhIrobz1tfnjiK1MYtb3ClGr3a5YwYcRQmMwf0P2DzA8062Q+2lZq2ac5vltpDI1ze/ydpPhcuPzw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1smnaE-00019O-Hj for guix-patches@gnu.org; Sat, 07 Sep 2024 01:02:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#73090] [PATCH] gnu: Add neural-amp-modeler-core. Resent-From: Antero Mejr Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 07 Sep 2024 05:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 73090 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 73090@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17256853044392 (code B ref -1); Sat, 07 Sep 2024 05:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Sep 2024 05:01:44 +0000 Received: from localhost ([127.0.0.1]:54541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smnZv-00018l-L6 for submit@debbugs.gnu.org; Sat, 07 Sep 2024 01:01:44 -0400 Received: from lists.gnu.org ([209.51.188.17]:36374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1smnZu-00018c-0R for submit@debbugs.gnu.org; Sat, 07 Sep 2024 01:01:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1smnZt-00075m-AX for guix-patches@gnu.org; Sat, 07 Sep 2024 01:01:41 -0400 Received: from mout-p-201.mailbox.org ([2001:67c:2050:0:465::201]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1smnZr-0006ZQ-Cb for guix-patches@gnu.org; Sat, 07 Sep 2024 01:01:41 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4X11Cd74YTz9scR for ; Sat, 7 Sep 2024 07:01:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antr.me; s=MBO0001; t=1725685294; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=BAGwb63qCSQbr72QGBv07QyGJ4qbshiOj0B6/NqC8/g=; b=v8GIjqYCkxylq7HxQre6BYJz6zT1aoML3JiB/RfGez4GTmyJ83ODET+dnN5DdpnK6iGCUn d3TlQq8Fz+vh1DAJ6CxYZoUZwoVP50GaEt5EDEDsOcOgfmyFs9S9QUt15UDf+P1rdxm62W i3v3euG774njxEuXufUFmNDcGt1USy1LfMOPKs+GdrOffxjRBy03r2kTz6Af0EhiQUlYhy Gqu50TrAG88k5Zojves9gXC/cmC78l+VTYlfUjr2tNJinWQV3YBGUW0bU0Lcjd6e2O0oqA dFtk9WuMb1y4J0vR9aY21GBhoRsXaGJLG8WM6fP25hWC7AkYZTKQPCdQVbtjjA== From: Antero Mejr Date: Sat, 07 Sep 2024 05:01:31 +0000 Message-ID: <87seuc9hw4.fsf@antr.me> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:67c:2050:0:465::201; envelope-from=mail@antr.me; helo=mout-p-201.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/music.scm (neural-amp-modeler-core): New variable. Change-Id: Ia93c978dba936300e3d0493ee5764fc560a1cd3a --- gnu/local.mk | 1 + gnu/packages/music.scm | 57 +++++++++++++++++++ ...l-amp-modeler-core-fix-eigen-methods.patch | 15 +++++ 3 files changed, 73 insertions(+) create mode 100644 gnu/packages/patches/neural-amp-modeler-core-fix-eigen-methods.patch diff --git a/gnu/local.mk b/gnu/local.mk index cf42e2b6da..5adea82be4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1794,6 +1794,7 @@ dist_patch_DATA = \ %D%/packages/patches/netsurf-system-utf8proc.patch \ %D%/packages/patches/netsurf-y2038-tests.patch \ %D%/packages/patches/netsurf-longer-test-timeout.patch \ + %D%/packages/patches/neural-amp-modeler-core-fix-eigen-methods.patch \ %D%/packages/patches/nhc98-c-update.patch \ %D%/packages/patches/nix-dont-build-html-doc.diff \ %D%/packages/patches/nfs4-acl-tools-0.3.7-fixpaths.patch \ diff --git a/gnu/packages/music.scm b/gnu/packages/music.scm index bc2d7f62f1..e85d917222 100644 --- a/gnu/packages/music.scm +++ b/gnu/packages/music.scm @@ -7986,6 +7986,63 @@ (define-public le-biniou visuals based on audio performances or existing tracks.") (license license:gpl2+))) +(define-public neural-amp-modeler-core + (package + (name "neural-amp-modeler-core") + (version "0.1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/sdatkinson/NeuralAmpModelerCore") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "05gfva1qkcq7n7vhvksv1jj5ciag4dp9bbn22svy2xys85mxg0xv")) + (patches (search-patches + "neural-amp-modeler-core-fix-eigen-methods.patch")) + (modules '((guix build utils))) + (snippet #~(begin + (delete-file-recursively "Dependencies") + (substitute* (find-files "NAM" "\\.(h|cpp)$") + (("#include \"Eigen/") + "#include \"eigen3/Eigen/") + (("#include ")) + ;; Remove Clang flags + (substitute* "CMakeLists.txt" + (("-stdlib=libc\\+\\+") + "") + (("add_subdirectory\\(tools\\)") + "\ +file(GLOB_RECURSE NAM_SOURCES ./NAM/*.cpp ./NAM/*.c ./NAM/*.h) +add_library(neural_amp_modeler SHARED ${NAM_SOURCES})")))))) + (build-system cmake-build-system) + (arguments + (list #:tests? #f ;no tests + #:phases #~(modify-phases %standard-phases + (replace 'install + (lambda _ + (let ((inc (string-append #$output + "/include/NAM")) + (lib (string-append #$output "/lib"))) + (for-each (lambda (file) + (install-file file lib)) + (find-files "." "\\.so")) + (with-directory-excursion "../source/NAM" + (for-each (lambda (file) + (install-file file inc)) + (find-files "." "\\.h"))))))))) + (inputs (list eigen nlohmann-json)) + (home-page "https://github.com/sdatkinson/NeuralAmpModelerCore") + (synopsis "DSP library for NeuralAmpModeler plugins") + (description + "This package provides the core DSP library for @acronym{NAM, Neural Amp +Modeler} plugins.") + (license license:expat))) + ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances ;;; of a merge conflict, place them above by existing packages with similar diff --git a/gnu/packages/patches/neural-amp-modeler-core-fix-eigen-methods.patch b/gnu/packages/patches/neural-amp-modeler-core-fix-eigen-methods.patch new file mode 100644 index 0000000000..bcac428a2a --- /dev/null +++ b/gnu/packages/patches/neural-amp-modeler-core-fix-eigen-methods.patch @@ -0,0 +1,15 @@ +Author: Antero Mejr + +diff --git a/NAM/lstm.h b/NAM/lstm.h +index 6b02b18..8da207f 100644 +--- a/NAM/lstm.h ++++ b/NAM/lstm.h +@@ -23,7 +23,7 @@ class LSTMCell + { + public: + LSTMCell(const int input_size, const int hidden_size, std::vector::iterator& weights); +- Eigen::VectorXf get_hidden_state() const { return this->_xh(Eigen::placeholders::lastN(this->_get_hidden_size())); }; ++ Eigen::VectorXf get_hidden_state() const { return this->_xh.tail(this->_get_hidden_size()); }; + void process_(const Eigen::VectorXf& x); + + private: