all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#51635] [PATCH 1/2] gnu: Add freepats-gm.
  2021-11-06 14:11 [bug#51635] [PATCH 0/2] Enable music playback in OpenTTD Liliana Marie Prikler
@ 2021-11-06 13:06 ` Liliana Prikler
  2021-11-06 13:06 ` [bug#51635] [PATCH 2/2] gnu: openttd: Let the music play Liliana Prikler
  2022-04-19 18:39 ` bug#51635: Liliana Marie Prikler
  2 siblings, 0 replies; 4+ messages in thread
From: Liliana Prikler @ 2021-11-06 13:06 UTC (permalink / raw)
  To: 51635

* gnu/packages/audio.scm (freepats-gm): New variable.
---
 gnu/packages/audio.scm | 45 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm
index 7cfbfc731d..eb5779340e 100644
--- a/gnu/packages/audio.scm
+++ b/gnu/packages/audio.scm
@@ -1936,6 +1936,51 @@ (define-public freepats
     ;; GPLv2+ with exception for compositions using these patches.
     (license license:gpl2+)))
 
+(define-public freepats-gm
+  (package
+    (name "freepats-gm")
+    (version "20210329")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://freepats.zenvoid.org/SoundSets/"
+                                  "FreePats-GeneralMIDI/FreePatsGM-SF2-"  version ".7z"))
+              (sha256
+               (base32
+                "19a1mp9yi33j2zff4mjvhrjz97dwwgjwzfdlf84j9xyydhx0crhc"))))
+    (build-system trivial-build-system)
+    (native-inputs
+     `(("p7zip" ,p7zip)))
+    (arguments
+     `(#:modules ((guix build utils))
+       #:builder
+       (let ((dir (string-append "FreePatsGM-SF2-" ,version))
+             (file (string-append "FreePatsGM-" ,version ".sf2"))
+             (out (string-append %output "/share/soundfonts"))
+             (doc (string-append %output "/share/doc/freepats-gm-" ,version)))
+         (use-modules (guix build utils))
+         (invoke (string-append (assoc-ref %build-inputs "p7zip") "/bin/7z")
+                 "e" (assoc-ref %build-inputs "source")
+                 (string-append dir "/" file)
+                 (string-append dir "/gpl.txt")
+                 (string-append dir "/cc0.txt")
+                 (string-append dir "/readme.txt"))
+         (mkdir-p out)
+         (copy-file file (string-append out "/FreePatsGM.sf2"))
+         (mkdir-p doc)
+         (for-each
+          (lambda (file)
+            (copy-file file (string-append doc "/" file)))
+          (find-files "." "\\.txt$"))
+         #t)))
+    (home-page "https://freepats.zenvoid.org/SoundSets/general-midi.html")
+    (synopsis "General MIDI sound set")
+    (description "FreePats is a project to create a free (as in free software)
+collection of digital instruments for music production.  This sound bank is a
+partial release of the General MIDI sound set.")
+    (license (list
+              license:gpl3+ ; with sampling exception
+              license:cc0))))
+
 (define-public guitarix
   (package
     (name "guitarix")
-- 
2.33.1






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#51635] [PATCH 2/2] gnu: openttd: Let the music play.
  2021-11-06 14:11 [bug#51635] [PATCH 0/2] Enable music playback in OpenTTD Liliana Marie Prikler
  2021-11-06 13:06 ` [bug#51635] [PATCH 1/2] gnu: Add freepats-gm Liliana Prikler
@ 2021-11-06 13:06 ` Liliana Prikler
  2022-04-19 18:39 ` bug#51635: Liliana Marie Prikler
  2 siblings, 0 replies; 4+ messages in thread
From: Liliana Prikler @ 2021-11-06 13:06 UTC (permalink / raw)
  To: 51635

* gnu/packages/games.scm (openttd)[inputs]: Remove timidity++.
Add fluidsynth and freepats-gm.
[#:phases]<patch-sources>: New phase.
---
 gnu/packages/games.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm
index 14131fa065..47ed3fc1b4 100644
--- a/gnu/packages/games.scm
+++ b/gnu/packages/games.scm
@@ -4481,6 +4481,15 @@ (define-public openttd
          (list (string-append "-DCMAKE_INSTALL_BINDIR=" out "/bin")))
        #:phases
        (modify-phases %standard-phases
+         (add-after 'unpack 'patch-sources
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "src/music/fluidsynth.cpp"
+               (("default_sf\\[\\] = \\{" all)
+                (string-append all "
+\t/* Guix hardcoded :P */
+\t\"" (string-append (assoc-ref inputs "freepats-gm")
+                     "/share/soundfonts/FreePatsGM.sf2") "\",
+")))))
          (add-before 'check 'install-data
            (lambda* (#:key inputs outputs #:allow-other-keys)
              (for-each
@@ -4489,7 +4498,8 @@ (define-public openttd
                                   (assoc-ref outputs "out")))
               (list "opengfx" "openmsx" "opensfx")))))))
     (inputs
-     `(("timidity++" ,timidity++)
+     `(("fluidsynth" ,fluidsynth)
+       ("freepats-gm" ,freepats-gm)
        ,@(package-inputs openttd-engine)))
     (native-inputs
      `(("opengfx" ,openttd-opengfx)
-- 
2.33.1






^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [bug#51635] [PATCH 0/2] Enable music playback in OpenTTD
@ 2021-11-06 14:11 Liliana Marie Prikler
  2021-11-06 13:06 ` [bug#51635] [PATCH 1/2] gnu: Add freepats-gm Liliana Prikler
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Liliana Marie Prikler @ 2021-11-06 14:11 UTC (permalink / raw)
  To: 51635

This series makes it so that OpenTTD can play music via fluidsynth.
In order to do so, the FreePats GM soundfont [1] is packaged as SF2 file.
I'm using the prebuilt SF2 file here, as I haven't yet found tools that'd
bundle the sources into a single file (the tools that FreePats themselves
provide could bundle individual sountfonts).  Are there any Guix+MIDI
engineers here, who could give me a few pointers?

Cheers,
Liliana

[1] https://freepats.zenvoid.org/SoundSets/general-midi.html#FreePatsGM

Liliana Prikler (2):
  gnu: Add freepats-gm.
  gnu: openttd: Let the music play.

 gnu/packages/audio.scm | 45 ++++++++++++++++++++++++++++++++++++++++++
 gnu/packages/games.scm | 12 ++++++++++-
 2 files changed, 56 insertions(+), 1 deletion(-)

-- 
2.33.1






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#51635:
  2021-11-06 14:11 [bug#51635] [PATCH 0/2] Enable music playback in OpenTTD Liliana Marie Prikler
  2021-11-06 13:06 ` [bug#51635] [PATCH 1/2] gnu: Add freepats-gm Liliana Prikler
  2021-11-06 13:06 ` [bug#51635] [PATCH 2/2] gnu: openttd: Let the music play Liliana Prikler
@ 2022-04-19 18:39 ` Liliana Marie Prikler
  2 siblings, 0 replies; 4+ messages in thread
From: Liliana Marie Prikler @ 2022-04-19 18:39 UTC (permalink / raw)
  To: 51635-done

Pushed this with a bunch of style changes to master.




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-19 18:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 14:11 [bug#51635] [PATCH 0/2] Enable music playback in OpenTTD Liliana Marie Prikler
2021-11-06 13:06 ` [bug#51635] [PATCH 1/2] gnu: Add freepats-gm Liliana Prikler
2021-11-06 13:06 ` [bug#51635] [PATCH 2/2] gnu: openttd: Let the music play Liliana Prikler
2022-04-19 18:39 ` bug#51635: Liliana Marie Prikler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.