Topic on Extension talk:Score

Unable to convert MIDI to Ogg/Vorbis

25
Scoutladen (talkcontribs)

Trying to create output to Ogg/Vorbis I get this error

http://jurtenland.de/wiki/Atte_Katte_Nuwa

Code


<score raw="1" vorbis="1">

\version "2.19.56"

\language "deutsch"

\header {
  tagline = ""
}

#(set-global-staff-size 16)

global = {
  \autoBeamOff
  \time 2/4
  \key d \major
}

akkorde = \chordmode {
  d1 a1 d2 a2 d2 d2 d1*3/4 a1*3/4 a1*3/4 d1*3/4
}

melodie = \relative c' {
  \global
  \repeat volta 2 {
  d8 d d d
  d4 fis
  e8 e e e
  e4 g
  fis4 fis8 fis
  e4 e8 e
  d8 d d d
  d2 }
  \time 3/4
  fis8 fis fis fis
  fis8 fis h4 g2
  fis8 fis fis fis
  fis8 fis h4 g2

  \bar "|."
}

text = \lyricmode {
  \set stanza = "1."
  At -- te Ka -- te nu -- wa, at -- te ka -- te nu --wa, e -- mis -- a de -- mis -- a du -- la  mi -- sa de. Hex -- a ko -- la mis -- sa woa -- te, hex -- a ko -- la mi -- sa woa -te.
}

\score {
  <<
    \new ChordNames { \akkorde }
    \new Voice = "Lied" { \melodie }
    \new Lyrics \lyricsto "Lied" { \text }
  >>
\midi {}
}
</score>

Have you any idea, what I have to do?

Mediawiki 1.27.1 Extension TimedMediaHandler is installed and works with Ogg-Files

MarkAHershberger (talkcontribs)

I'm having trouble duplicating your problem. The following works for me, what happens for you?


<score vorbis="1">
\version "2.18.2"

\relative c'' { \time 4/4 \key c \major 
c4 g8 g a4 g r b^> c^> r \bar "|." } 
\addlyrics { Shave and a hair -- cut: two bits. }

\midi{}
</score>

Scoutladen (talkcontribs)

Playmode `v' is not compiled in. Try timidity -h for help

Seams to be a wrong compilation of timidity? How can I fix this?

MarkAHershberger (talkcontribs)

How much control do you have over the server? It looks like the version of timidity you are using doesn't have Ogg Vorbis support since -Ov is Ogg Vorbis output mode. When I installed timidity on my Debian system, Ogg Vorbis support was included. It looks like Redhat systems include it by default as well.

Scoutladen (talkcontribs)

I have access to the root-server (centos7)

tried to install / update timidity with ./configure --enable-audio=vorbis (version 2.14)

but there is no change...

Roomsixhu (talkcontribs)
MarkAHershberger (talkcontribs)

Make sure the ogg vorbis development libraries are available when you run configure. It looks like you'll need libogg-devel and libvorbis-devel.

I was also able to get timidity installed using this rpm via the following command:

# sudo yum install ftp://ftp.pbone.net/mirror/li.nux.ro/download/nux/dextop/el7/x86_64/timidity++-2.14.0-6.el7.nux.x86_64.rpm
Scoutladen (talkcontribs)

exactly this rpm I have installed. Now I've added libogg-devel and libvorbis-devel

Nothing happens. I think, I have to compile timidity with more options, but don't know how...

Scoutladen (talkcontribs)
Available output modes (-O, --output-mode option):
  -Ow          RIFF WAVE file
  -Or          Raw waveform data
  -Ou          Sun audio file
  -Oa          AIFF file
  -Ol          List MIDI event
  -Om          Write MIDI file
  -OM          MOD -> MIDI file conversion

There is no Vorbis for me :-(

Scoutladen (talkcontribs)

I have to compile timidity from source with

./configure --enable-audio=vorbis

but before I have to

make clean

For your code I can see the player. But there is no sound.

And for my code I get another error!

MarkAHershberger (talkcontribs)

If you install the timidity++ rpm I pointed to above, you'll have timidity installed and won't need your compiled version.

Here's a couple of commands and what you should see in the output:

$ type timidity
timidity is hashed (/usr/bin/timidity)
$ timidity --help | grep -- -O
  -O mode    --output-mode=mode
Available output modes (-O, --output-mode option):
  -OO          Libao mode
  -Os          ALSA pcm device
  -Od          dsp device
  -Oj          JACK device
  -Ow          RIFF WAVE file
  -Or          Raw waveform data
  -Ou          Sun audio file
  -Oa          AIFF file
  -Ov          Ogg Vorbis
  -OF          FLAC
  -OS          Ogg Speex
  -Ol          List MIDI event
  -Om          Write MIDI file
  -OM          MOD -> MIDI file conversion
Output format options (append to -O? option):
$

I suspect that when you run "type timidity", you'll see /usr/local/bin/timidity instead of /usr/bin/timidity.

Scoutladen (talkcontribs)

so I have set

$wgScoreTimidity = '/usr/bin/timidity';

instead of

$wgScoreTimidity = '/usr/local/bin/timidity';
MarkAHershberger (talkcontribs)
MarkAHershberger (talkcontribs)

I just took the time to set up score, timidity, selinux, etc, etc on my centos7 setup using the rpm (and not compiling it myself) and I got notes coming out. Whee!

I hope you can get your sound working.

Scoutladen (talkcontribs)

OK. I've uninstalled timidity++ on my server (I found two instances)

Now I'm using your rpm-package.

Please have a look http://jurtenland.de/wiki/Shave_and_a_hair_cut

Two questions:

Can I fix the space between score and player?

Can you here any sound?

MarkAHershberger (talkcontribs)

I'm not sure what is wrong, but from looking at questions like this one, I think you must not have any sound founts installed:

$ rpm -q -a | grep soundfont
fluid-soundfont-lite-patches-3.1-16.el7.noarch
fluid-soundfont-gm-3.1-16.el7.noarch
fluid-soundfont-common-3.1-16.el7.noarch
$ cat /etc/timidity++.cfg 
dir /usr/share/soundfonts
source fluid3gm.cfg
trysource fluid3gs.cfg
source fluid_altassign.cfg

Do you get the same results?

Scoutladen (talkcontribs)

I get this result

$ rpm -q -a | grep soundfont
fluid-soundfont-gm-3.1-16.el7.noarch
fluid-soundfont-common-3.1-16.el7.noarch
$cat /etc/timidity++.cfg
dir /usr/share/soundfonts
source fluid3gm.cfg
trysource fluid3gs.cfg
source fluid_altassign.cfg
MarkAHershberger (talkcontribs)

It looks the same, although, I do have the fluid-soundfont-lite-patches and you don't.

It probably won't make a difference, but is everything the same if you install that package?

Scoutladen (talkcontribs)

Thank you very much. No difference with fluid-soundfont-lite-patches

Must be any other problem on my server.

Scoutladen (talkcontribs)

Using this code from mediawiki:extension:Score


<score vorbis="1">\relative c' { f d f a d f e d cis a cis e a g f e }</score>

I get this output


<div id="mw-content-text" lang="de" dir="ltr" class="mw-content-ltr"><img src="/wiki/images/lilypond/j/q/jqn99bwy8777srpv45hxjoiu24f0636/jqn99bwy.png" width="434" height="52" alt="\relative c' { f d f a d f e d cis a cis e a g f e }"><div class="mediaContainer" style="width:300px"><div class="mwPlayerContainer k-player" style="width: 300px; position: relative; height: 20px;"><div class="videoHolder"><div class="mwEmbedPlayer" id="mwe_player_0" style=""><img src="/wiki/resources/assets/file-type-icons/fileicon-ogg.png" class="playerPoster" style="position: absolute; top: 0px; left: 140px; right: 0px; bottom: 0px; height: 20px; width: 20px;"></div><div title="Clip abspielen" class="play-btn-large" style="left: 50%; top: 50%; margin-left: -35px; margin-top: -27.5px;"></div></div><div class="ui-state-default ui-widget-header ui-helper-clearfix control-bar block" style="height: 20px;"><div class="ui-slider ui-slider-horizontal rButton volume-slider ui-widget ui-widget-content ui-corner-all"><div class="ui-slider-range ui-widget-header ui-slider-range-min" style="width: 80%;"></div><a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 80%;"></a></div><div title="Lautstärkeregelung" class="ui-state-default ui-corner-all ui-icon_link rButton volume_control"><span class="ui-icon ui-icon-volume-on"></span></div><div class="ui-widget time-disp">0:00</div><div class="play_head ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" title="" style="position: absolute; left: 33px; right: 87px;"><div class="ui-slider-range ui-widget-header ui-slider-range-min ui-corner-all" style="width: 0%; z-index: 2;"></div><a class="ui-slider-handle ui-state-default ui-corner-all" href="#" style="left: 0%; z-index: 4;"></a><div class="ui-slider-range ui-slider-range-min ui-widget-header ui-state-highlight ui-corner-all mw_buffer"></div></div><div title="Clip abspielen" class="ui-state-default ui-corner-all ui-icon_link lButton play-btn"><span class="ui-icon ui-icon-play"></span></div></div></div></div>

<!-- 

NewPP limit report

Cached time: 20170326190837

Cache expiry: 86400

Dynamic content: false

CPU time usage: 0.004 seconds

Real time usage: 0.004 seconds

Preprocessor visited node count: 4/1000000

Preprocessor generated node count: 24/1000000

Post‐expand include size: 0/2097152 bytes

Template argument size: 0/2097152 bytes

Highest expansion depth: 2/40

Expensive parser function count: 0/100

-->

<!-- 

Transclusion expansion time report (%,ms,calls,template)

100.00%    0.000      1 - -total

-->

<!-- Saved in parser cache with key my_wiki:pcache:idhash:1051-0!*!*!*!*!*!* and timestamp 20170326190837 and revision id 5913

 -->

</div>

Looking a the output from mediawiki, ther should be


<div class="mediaContainer" style="width:300px"><audio id="mwe_player_0" controls="" preload="none" style="width:300px" class="kskin" data-disablecontrols="options,timedText" data-durationhint="11.600453514739">

<source src="//upload.wikimedia.org/score/j/q/jqn99bwy8777srpv45hxjoiu24f0636/jqn99bwy.ogg" type="audio/ogg; codecs="vorbis""></audio></div>

Seams to be a wrong configuration....

MarkAHershberger (talkcontribs)

The difference you're seeing is related to the version installed. I checked your version page and installed matching versions and got similar output to what you have -- and it played.

A direct download of your ogg file shows that it is, indeed, silent.

That leads me to think that the problem is somewhere outside of MediaWiki.

At this point, I'm not sure what to look at. Since I am testing this on a virtual CentOS box on my laptop, I went ahead and uploaded a list of all the packages I have installed. Maybe you'll be able to spot something in there.

The other thing to do is to try running the command to convert the midi file to an ogg file yourself. You can find the commands by looking at your debug log and duplicate them.

For example here's what I see if I look for wfShellExec in my debug log:

$ grep wfShellExec images/debug.log | tail -5
wfShellExec: /bin/bash '/var/www/html/w/includes/limit.sh' 'LILYPOND_GC_YIELD='\''25'\'' '\''/usr/local/bin/lilypond'\'' '\''-dsafe=#t'\'' -dbackend=ps --png --header=texidoc '\''/tmp/MWLP.e8f63cbbbf327ecd7fe9f86157c73e0a/file.ly'\'' 2>&1' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
wfShellExec: /bin/bash '/var/www/html/w/includes/limit.sh' ''\''/usr/bin/convert'\'' -trim '\''/tmp/MWLP.e8f63cbbbf327ecd7fe9f86157c73e0a/file.png'\'' '\''/tmp/MWLP.e8f63cbbbf327ecd7fe9f86157c73e0a/file-trimmed.png'\'' 2>&1' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
wfShellExec: /bin/bash '/var/www/html/w/includes/limit.sh' ''\''/usr/bin/timidity'\'' -Ov '\''--output-file=/tmp/MWLP.e8f63cbbbf327ecd7fe9f86157c73e0a/file.ogg'\'' '\''/tmp/MWLP.e8f63cbbbf327ecd7fe9f86157c73e0a/file.midi'\'' 2>&1' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
wfShellExec: /bin/bash '/var/www/html/w/includes/limit.sh' 'GIT_DIR='\''/var/www/html/w/.git'\'' '\''/usr/bin/git'\'' show -s --format=format:%ct HEAD' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
wfShellExec: /bin/bash '/var/www/html/w/includes/limit.sh' 'GIT_DIR='\''/var/www/html/w/extensions/MwEmbedSupport/../../.git/modules/extensions/MwEmbedSupport'\'' '\''/usr/bin/git'\'' show -s --format=format:%ct HEAD' 'MW_INCLUDE_STDERR=;MW_CPU_LIMIT=180; MW_CGROUP='\'''\''; MW_MEM_LIMIT=307200; MW_FILE_SIZE_LIMIT=102400; MW_WALL_CLOCK_LIMIT=180; MW_USE_LOG_PIPE=yes'
$

Copying everything after "wfShellExec:" gives me something I can put in a shell file and duplicate and actions.

There may be some interesting output there.

Scoutladen (talkcontribs)

Thank you. Now I've enabled Error-reporting and the debug.log

This way I found some other error:

Every Lilypond-Code with

<score raw ="1">

results in

Warning: is_executable(): open_basedir restriction in effect. File(/bin/bash) is not within the allowed path(s): (/var/www/vhosts/jurtenland.eu/:/tmp/:/usr/local/bin/) in /var/www/vhosts/jurtenland.eu/httpdocs/kohtenland/wiki/includes/GlobalFunctions.php on line 2426

Thats not in case with vorbis, but perhaps the open_basedir restriction causes same error for timidity.

Scoutladen (talkcontribs)
MarkAHershberger (talkcontribs)

You should maybe set Manual:$wgLanguageCode to "de".

I'm glad you found a way to get sound. Your open_basedir issue needs to be taken up with your hosting provider, or, since you have access to root, you can change your php.ini yourself.

I'm not sure how to regenerate the files. Have you tried adding "?action=purge" to the url of a web page that doesn't seem to be working to regenerate the audio file?

Scoutladen (talkcontribs)

Now every songs are working. Thank you very much or your help.

Reply to "Unable to convert MIDI to Ogg/Vorbis"