From: Jonathan Gregory <jgrg@autistici.org>
To: emacs-orgmode@gnu.org
Subject: Re: ob-lilypond.el doesn't generate midi files
Date: Mon, 30 Aug 2021 14:02:42 -0300 [thread overview]
Message-ID: <87y28i3lp5.fsf@autistici.org> (raw)
In-Reply-To: <CAH-0+bB=8ig58yCo+9jg7FGa28ZSxyidoit-1FuVNwUfqwyXgQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 488 bytes --]
Hi
On 29 Aug 2021, Michael Maurer wrote:
> Yep, that's it. Modified ob-lilypond.el and recompiled it.
> Timidity works as helper, couldn't get vlc to work. Maybe the
> file ending should be modifiable via org-babel-lilypond-commands
> as well, or make ob-lilypond.el look for *.mid or *.midi. I'm
> pretty confident *.mid is the default setting for lilypond on
> win, and not my doing.
I attached a patch to use a different suffix on Windows. Thanks
for your help.
--
Jonathan
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Set-the-MIDI-file-extension-conditionally.patch --]
[-- Type: text/x-diff, Size: 1310 bytes --]
From 1929b8082b9cff2a4bd99c573b2a2bd50b76b184 Mon Sep 17 00:00:00 2001
From: Jonathan Gregory <jgrg@autistici.org>
Date: Mon, 30 Aug 2021 13:49:48 -0300
Subject: [PATCH] Set the MIDI file extension conditionally
* lisp/ob-lilypond.el (org-babel-lilypond-attempt-to-play-midi): By
default, LilyPond outputs .mid files for Windows and .midi for
everything else.
See: <https://lists.gnu.org/r/emacs-orgmode/2021-08/msg00379.html>
TINYCHANGE
---
lisp/ob-lilypond.el | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lisp/ob-lilypond.el b/lisp/ob-lilypond.el
index eae1779ce..e197ea7a6 100644
--- a/lisp/ob-lilypond.el
+++ b/lisp/ob-lilypond.el
@@ -337,7 +337,9 @@ If TEST is non-nil, the shell command is returned and is not run."
FILE-NAME is full path to lilypond file.
If TEST is non-nil, the shell command is returned and is not run."
(when org-babel-lilypond-play-midi-post-tangle
- (let ((midi-file (org-babel-lilypond-switch-extension file-name ".midi")))
+ (let* ((ext (if (eq system-type 'windows-nt)
+ ".mid" ".midi"))
+ (midi-file (org-babel-lilypond-switch-extension file-name ext)))
(if (file-exists-p midi-file)
(let ((cmd-string
(concat org-babel-lilypond-midi-command " " midi-file)))
--
2.25.1
next prev parent reply other threads:[~2021-08-30 17:10 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-26 10:37 ob-lilypond.el doesn't generate midi files Michael Maurer
2021-08-26 12:55 ` Jonathan Gregory
2021-08-26 15:55 ` Michael Maurer
2021-08-26 16:04 ` Michael Maurer
2021-08-26 19:50 ` Nick Dokos
2021-08-27 14:53 ` Michael Maurer
2021-08-27 19:54 ` Nick Dokos
2021-08-28 8:20 ` Maxim Nikulin
2021-08-28 10:27 ` Michael Maurer
2021-08-28 13:03 ` Jonathan Gregory
2021-08-28 16:18 ` Michael Maurer
2021-08-29 11:16 ` Michael Maurer
2021-08-30 17:02 ` Jonathan Gregory [this message]
2022-11-01 2:01 ` Ihor Radchenko
2022-11-01 11:22 ` Jonathan Gregory
2022-11-01 11:51 ` Ihor Radchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y28i3lp5.fsf@autistici.org \
--to=jgrg@autistici.org \
--cc=emacs-orgmode@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).