Last modified: 2014-08-05 20:08:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49703, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47703 - MIDI generation on Windows fails with "No MIDI file generated despite being requested"; Support "-dmidi-extension=midi"
MIDI generation on Windows fails with "No MIDI file generated despite being r...
Status: PATCH_TO_REVIEW
Product: MediaWiki extensions
Classification: Unclassified
Score (Other open bugs)
unspecified
All Windows XP
: Normal major (vote)
: ---
Assigned To: Nobody - You can work on this!
: easy
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-26 01:17 UTC by gnosygnu
Modified: 2014-08-05 20:08 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description gnosygnu 2013-04-26 01:17:24 UTC
-------------------
Reproductions steps
-------------------
* Install the Score extension on a Windows machine (I was able to reproduce on Windows XP and Windows 7)

* Create a page with the following wikitext:
<score midi="1">\relative c' { d }</score>

* Click "Show Preview". The following error appears:

No MIDI file generated despite being requested. If you are working in raw LilyPond mode, make sure to provide a proper \midi block.


-----
Cause
-----
* Score.body.php uses ".midi" throughout the file as the extension for MIDI files

* However, on Windows, Lilypond treats ".mid" as the default extension for MIDI files. See the following Lilypond page (http://lilypond.org/doc/v2.15/Documentation/notation/creating-midi-files):

Due to some limitations on Windows, the default extension for MIDI files on Windows is .mid.  

--------------
Recommendation
--------------
* Add the "-dmidi-extension=midi" command line arg as per http://www.lilypond.org/doc/v2.17/Documentation/usage/command_002dline-usage

Specifically:
midi-extension	"midi"	Set the default file extension for MIDI output file to given string.

The recommended area of change would be here:
$cmd = wfEscapeShellArg( $wgScoreLilyPond )
			. ' ' . wfEscapeShellArg( '-dsafe=#t' )
			. ' -dmidi-extension=midi'
			. ' -dbackend=ps --png --header=texidoc '
			. wfEscapeShellArg( $factoryLy )
			. ' 2>&1';

The above change allows me to generate MIDI files on my Windows XP box.

I've also tested the "-dmidi-extension=midi" command-line argument on Windows XP, Windows 7, and Linux Mint Nadia. In each case, the output MIDI file has an extension of ".midi" (i.e.: manually specifying "midi" on Linux seems to be benign)
Comment 1 Andre Klapper 2014-07-07 14:20:07 UTC
Hi gnosygnu! Sorry that nobody has taken a look at this report yet and given feedback.

Seems like this is about adding one line to
https://git.wikimedia.org/blob/mediawiki%2Fextensions%2FScore.git/363b84080e5f5cc983d4a0c7aae22ee4a84b93c9/Score.body.php#L585 ?

If anybody feels like creating a patch:
You are welcome to use Developer access
  https://www.mediawiki.org/wiki/Developer_access
to submit this as a Git branch directly into Gerrit:
  https://www.mediawiki.org/wiki/Git/Tutorial
If you don't want to set up Git/Gerrit, you can also use https://tools.wmflabs.org/gerrit-patch-uploader/
Comment 2 gnosygnu 2014-07-08 01:46:09 UTC
Hey, thanks for the reply as well as the instructions. I'll take a look at it within the week and post again here after I've uploaded the patch.
Comment 3 gnosygnu 2014-07-17 03:29:48 UTC
I uploaded the patch here: https://gerrit.wikimedia.org/r/#/c/147015/

Let me know if there is anything else. Thanks.
Comment 4 Andre Klapper 2014-07-17 11:12:30 UTC
Great! Fixing the commit message is welcome, see https://www.mediawiki.org/wiki/Gerrit/Commit_message_guidelines
Comment 5 Gerrit Notification Bot 2014-08-05 20:08:32 UTC
Change 147015 had a related patch set uploaded by Ebe123:
(bug 47703) MIDI generation fails on Windows

https://gerrit.wikimedia.org/r/147015

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links