gnu: Add python-ly.
[jackhill/guix/guix.git] / gnu / packages / music.scm
index 5795ecb..fa8cccb 100644 (file)
   #:use-module (guix utils)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix git-download)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system cmake)
+  #:use-module (guix build-system waf)
   #:use-module (gnu packages)
   #:use-module (gnu packages audio)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages base) ;libbdf
+  #:use-module (gnu packages boost)
   #:use-module (gnu packages bison)
+  #:use-module (gnu packages code)
+  #:use-module (gnu packages check)
+  #:use-module (gnu packages compression)
   #:use-module (gnu packages docbook)
   #:use-module (gnu packages flex)
+  #:use-module (gnu packages fltk)
   #:use-module (gnu packages fonts)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
+  #:use-module (gnu packages gl)
+  #:use-module (gnu packages glib)
   #:use-module (gnu packages gnome)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages netpbm)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
+  #:use-module (gnu packages pulseaudio) ;libsndfile
   #:use-module (gnu packages python)
+  #:use-module (gnu packages qt)
+  #:use-module (gnu packages rdf)
   #:use-module (gnu packages rsync)
+  #:use-module (gnu packages tcl)
   #:use-module (gnu packages texinfo)
   #:use-module (gnu packages texlive)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages xml)
   #:use-module (gnu packages xiph)
-  #:use-module (gnu packages zip))
+  #:use-module (gnu packages zip)
+  #:use-module ((srfi srfi-1) #:select (last)))
+
+(define-public hydrogen
+  (package
+    (name "hydrogen")
+    (version "0.9.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "mirror://sourceforge/hydrogen/Hydrogen/"
+                    (version-prefix version 3) "%20Sources/"
+                    "hydrogen-" version ".tar.gz"))
+              (sha256
+               (base32
+                "1fvyp6gfzcqcc90dmaqbm11p272zczz5pfz1z4lj33nfr7z0bqgb"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;no "check" target
+       #:phases
+       ;; TODO: Add scons-build-system and use it here.
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (add-after 'unpack 'scons-propagate-environment
+                    (lambda _
+                      ;; By design, SCons does not, by default, propagate
+                      ;; environment variables to subprocesses.  See:
+                      ;; <http://comments.gmane.org/gmane.linux.distributions.nixos/4969>
+                      ;; Here, we modify the Sconstruct file to arrange for
+                      ;; environment variables to be propagated.
+                      (substitute* "Sconstruct"
+                        (("^env = Environment\\(")
+                         "env = Environment(ENV=os.environ, "))))
+         (replace 'build
+                  (lambda* (#:key inputs outputs #:allow-other-keys)
+                    (let ((out (assoc-ref outputs "out")))
+                      (zero? (system* "scons"
+                                      (string-append "prefix=" out)
+                                      "lrdf=0" ; cannot be found
+                                      "lash=1")))))
+         (add-before
+          'install
+          'fix-img-install
+          (lambda _
+            ;; The whole ./data/img directory is copied to the target first.
+            ;; Scons complains about existing files when we try to install all
+            ;; images a second time.
+            (substitute* "Sconstruct"
+              (("os.path.walk\\(\"./data/img/\",install_images,env\\)") ""))
+            #t))
+         (replace 'install (lambda _ (zero? (system* "scons" "install")))))))
+    (native-inputs
+     `(("scons" ,scons)
+       ("python" ,python-2)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("zlib" ,zlib)
+       ("libtar" ,libtar)
+       ("alsa-lib" ,alsa-lib)
+       ("jack" ,jack-1)
+       ("lash" ,lash)
+       ;;("lrdf" ,lrdf) ;FIXME: cannot be found by scons
+       ("qt" ,qt-4)
+       ("libsndfile" ,libsndfile)))
+    (home-page "http://www.hydrogen-music.org")
+    (synopsis "Drum machine")
+    (description
+     "Hydrogen is an advanced drum machine for GNU/Linux.  Its main goal is to
+enable professional yet simple and intuitive pattern-based drum programming.")
+    (license license:gpl2+)))
+
+(define-public klick
+  (package
+    (name "klick")
+    (version "0.12.2")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "http://das.nasophon.de/download/klick-"
+                                  version ".tar.gz"))
+              (sha256
+               (base32
+                "0hmcaywnwzjci3pp4xpvbijnnwvibz7gf9xzcdjbdca910y5728j"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ;no "check" target
+       #:phases
+       ;; TODO: Add scons-build-system and use it here.
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (replace 'build
+                  (lambda* (#:key inputs outputs #:allow-other-keys)
+                    (let ((out (assoc-ref outputs "out")))
+                      (mkdir-p out)
+                      (zero? (system* "scons" (string-append "PREFIX=" out))))))
+         (replace 'install (lambda _ (zero? (system* "scons" "install")))))))
+    (inputs
+     `(("boost" ,boost)
+       ("jack" ,jack-1)
+       ("libsndfile" ,libsndfile)
+       ("libsamplerate" ,libsamplerate)
+       ("liblo" ,liblo)
+       ("rubberband" ,rubberband)))
+    (native-inputs
+     `(("scons" ,scons)
+       ("python" ,python-2)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://das.nasophon.de/klick/")
+    (synopsis "Metronome for JACK")
+    (description
+     "klick is an advanced command-line based metronome for JACK.  It allows
+you to define complex tempo maps for entire songs or performances.")
+    (license license:gpl2+)))
 
 (define-public lilypond
   (package
@@ -113,6 +241,44 @@ interpreted by LilyPond to produce the final document.  It is extendable with
 Guile.")
     (license license:gpl3+)))
 
+(define-public non-sequencer
+  ;; The latest tagged release is three years old and uses a custom build
+  ;; system, so we take the last commit affecting the "sequencer" directory.
+  (let ((commit "1d9bd576"))
+    (package
+      (name "non-sequencer")
+      (version (string-append "1.9.5-" commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "git://git.tuxfamily.org/gitroot/non/non.git")
+                      (commit commit)))
+                (sha256
+                 (base32
+                  "0pkkw8q6d55j38xm7r4rwpdv1wy00a44h8c4wrn7vbgpq9nij46y"))
+                (file-name (string-append name "-" version "-checkout"))))
+      (build-system waf-build-system)
+      (arguments
+       `(#:tests? #f ;no "check" target
+         #:configure-flags '("--project=sequencer")
+         #:python ,python-2))
+      (inputs
+       `(("jack" ,jack-1)
+         ("libsigc++" ,libsigc++)
+         ("liblo" ,liblo)
+         ("ntk" ,ntk)))
+      (native-inputs
+       `(("pkg-config" ,pkg-config)))
+      (home-page "http://non.tuxfamily.org/wiki/Non%20Sequencer")
+      (synopsis "Pattern-based MIDI sequencer")
+      (description
+       "The Non Sequencer is a powerful, lightweight, real-time,
+pattern-based MIDI sequencer.  It utilizes the JACK Audio Connection Kit for
+MIDI I/O and the NTK GUI toolkit for its user interface.  Everything in Non
+Sequencer happens on-line, in real-time.  Music can be composed live, while the
+transport is rolling.")
+      (license license:gpl2+))))
+
 (define-public solfege
   (package
     (name "solfege")
@@ -224,6 +390,159 @@ sessions.  Solfege is also designed to be extensible so you can easily write
 your own lessons.")
     (license license:gpl3+)))
 
+(define-public powertabeditor
+  (package
+    (name "powertabeditor")
+    (version "2.0.0-alpha8")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append
+                    "https://github.com/powertab/powertabeditor/archive/"
+                    version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0gaa2x209v3azql8ak3r1n9a9qbxjx2ssirvwdxwklv2lmfqkm82"))
+              (modules '((guix build utils)))
+              (snippet
+               '(begin
+                  ;; Remove bundled sources for external libraries
+                  (delete-file-recursively "external")
+                  (substitute* "CMakeLists.txt"
+                    (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") "")
+                    (("add_subdirectory\\(external\\)") ""))
+                  (substitute* "test/CMakeLists.txt"
+                    (("include_directories\\(\\$\\{PROJECT_SOURCE_DIR\\}/external/.*") ""))
+
+                  ;; Add install target
+                  (substitute* "source/CMakeLists.txt"
+                    (("qt5_use_modules")
+                     (string-append
+                      "install(TARGETS powertabeditor "
+                      "RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)\n"
+                      "install(FILES data/tunings.json DESTINATION "
+                      "${CMAKE_INSTALL_PREFIX}/share/powertabeditor/)\n"
+                      "qt5_use_modules")))
+                  #t))))
+    (build-system cmake-build-system)
+    (arguments
+     `(#:modules ((guix build cmake-build-system)
+                  (guix build utils)
+                  (ice-9 match))
+       #:configure-flags
+       ;; CMake appears to lose the RUNPATH for some reason, so it has to be
+       ;; explicitly set with CMAKE_INSTALL_RPATH.
+       (list "-DCMAKE_BUILD_WITH_INSTALL_RPATH=TRUE"
+             "-DCMAKE_ENABLE_PRECOMPILED_HEADERS=OFF" ; if ON pte_tests cannot be built
+             (string-append "-DCMAKE_INSTALL_RPATH="
+                            (string-join (map (match-lambda
+                                                ((name . directory)
+                                                 (string-append directory "/lib")))
+                                              %build-inputs) ";")))
+       #:phases
+       (modify-phases %standard-phases
+         (replace
+          'check
+          (lambda _
+            (zero? (system* "bin/pte_tests"
+                            ;; Exclude this failing test
+                            "~Formats/PowerTabOldImport/Directions"))))
+         (add-before
+          'configure 'fix-tests
+          (lambda _
+            ;; Tests cannot be built with precompiled headers
+            (substitute* "test/CMakeLists.txt"
+              (("cotire\\(pte_tests\\)") ""))
+            #t))
+         (add-before
+          'configure 'remove-third-party-libs
+          (lambda* (#:key inputs #:allow-other-keys)
+            ;; Link with required static libraries, because we're not
+            ;; using the bundled version of withershins.
+            (substitute* '("source/CMakeLists.txt"
+                           "test/CMakeLists.txt")
+              (("target_link_libraries\\((powertabeditor|pte_tests)" _ target)
+               (string-append "target_link_libraries(" target " "
+                              (assoc-ref inputs "binutils")
+                              "/lib/libbfd.a "
+                              (assoc-ref inputs "libiberty")
+                              "/lib/libiberty.a "
+                              "dl")))
+            #t)))))
+    (inputs
+     `(("boost" ,boost)
+       ("alsa-lib" ,alsa-lib)
+       ("qt" ,qt)
+       ("withershins" ,withershins)
+       ("libiberty" ,libiberty) ;for withershins
+       ("binutils" ,binutils) ;for -lbfd and -liberty (for withershins)
+       ("timidity" ,timidity++)
+       ("pugixml" ,pugixml)
+       ("rtmidi" ,rtmidi)
+       ("rapidjson" ,rapidjson)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("catch" ,catch-framework)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://powertabs.net")
+    (synopsis "Guitar tablature editor")
+    (description
+     "Power Tab Editor 2.0 is the successor to the famous original Power Tab
+Editor.  It is compatible with Power Tab Editor 1.7 and Guitar Pro.")
+    (license license:gpl3+)))
+
+(define-public setbfree
+  (package
+    (name "setbfree")
+    (version "0.8.0")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append
+                "https://github.com/pantherb/setBfree/releases/download/v"
+                version "/setbfree-" version ".tar.gz"))
+              (sha256
+               (base32
+                "045bgp7qsigpbrhk7qvgvliwiy26sajifwn7f2jvk90ckfqnlw4b"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no "check" target
+       #:make-flags
+       (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             (string-append "FONTFILE="
+                            (assoc-ref %build-inputs "font-bitstream-vera")
+                            "/share/fonts/truetype/VeraBd.ttf")
+             ;; Disable unsupported optimization flags on non-x86
+             ,@(let ((system (or (%current-target-system)
+                                 (%current-system))))
+                 (if (or (string-prefix? "x86_64" system)
+                         (string-prefix? "i686" system))
+                     '()
+                     '("OPTIMIZATIONS=-ffast-math -fomit-frame-pointer -O3"))))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'build 'set-CC-variable
+                     (lambda _ (setenv "CC" "gcc") #t))
+         (delete 'configure))))
+    (inputs
+     `(("jack" ,jack-1)
+       ("lv2" ,lv2)
+       ("zita-convolver" ,zita-convolver)
+       ("glu" ,glu)
+       ("ftgl" ,ftgl)
+       ("font-bitstream-vera" ,font-bitstream-vera)))
+    (native-inputs
+     `(("help2man" ,help2man)
+       ("pkg-config" ,pkg-config)))
+    (home-page "http://setbfree.org")
+    (synopsis "Tonewheel organ")
+    (description
+     "setBfree is a MIDI-controlled, software synthesizer designed to imitate
+the sound and properties of the electromechanical organs and sound
+modification devices that brought world-wide fame to the names and products of
+Laurens Hammond and Don Leslie.")
+    (license license:gpl2+)))
+
 (define-public tuxguitar
   (package
     (name "tuxguitar")
@@ -274,3 +593,57 @@ management, bend/slide/vibrato/hammer-on/pull-off effects, support for
 tuplets, time signature management, tempo management, gp3/gp4/gp5 import and
 export.")
     (license license:lgpl2.1+)))
+
+(define-public pd
+  (package
+    (name "pd")
+    (version "0.45.4")
+    (source (origin
+              (method url-fetch)
+              (uri
+               (string-append "mirror://sourceforge/pure-data/pure-data/"
+                              version "/pd-" (version-major+minor version)
+                              "-" (last (string-split version #\.))
+                              ".src.tar.gz"))
+              (sha256
+               (base32
+                "1ls2ap5yi2zxvmr247621g4jx0hhfds4j5704a050bn2n3l0va2p"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:tests? #f ; no "check" target
+       #:phases
+       (modify-phases %standard-phases
+         (add-before
+          'configure 'fix-wish-path
+          (lambda _
+            (substitute* "src/s_inter.c"
+              (("  wish ") (string-append "  " (which "wish8.6") " ")))
+            (substitute* "tcl/pd-gui.tcl"
+              (("exec wish ") (string-append "exec " (which "wish8.6") " ")))
+            #t))
+         (add-after
+          'unpack 'autoconf
+          (lambda _ (zero? (system* "autoreconf" "-vfi")))))))
+    (native-inputs
+     `(("autoconf" ,autoconf)
+       ("automake" ,automake)
+       ("libtool" ,libtool)
+       ("gettext" ,gnu-gettext)
+       ("pkg-config" ,pkg-config)))
+    (inputs
+     `(("tk" ,tk)
+       ("alsa-lib" ,alsa-lib)
+       ("jack" ,jack-1)))
+    (home-page "http://puredata.info")
+    (synopsis "Visual programming language for artistic performances")
+    (description
+     "Pure Data (aka Pd) is a visual programming language.  Pd enables
+musicians, visual artists, performers, researchers, and developers to create
+software graphically, without writing lines of code.  Pd is used to process
+and generate sound, video, 2D/3D graphics, and interface sensors, input
+devices, and MIDI.  Pd can easily work over local and remote networks to
+integrate wearable technology, motor systems, lighting rigs, and other
+equipment.  Pd is suitable for learning basic multimedia processing and visual
+programming methods as well as for realizing complex systems for large-scale
+projects.")
+    (license license:bsd-3)))