Extension:Score

From MediaWiki.org
Jump to: navigation, search
This page is a translated version of the page Extension:Score and the translation is 45% complete.

Outdated translations are marked like this.
Other languages:
English • ‎español • ‎français • ‎日本語 • ‎中文
Manuel des extensions MediaWikiManual:Extensions
Crystal Clear action run.png
Score

État de la version :Extension status stable

Lilytest1.png
ImplémentationTemplate:Extension#type Tag
DescriptionTemplate:Extension#description Permet l'affichage de partitions musicales avec LilyPond
Auteur(s)Template:Extension#username Alexander Klauer (GrafZahltalk)
Dernière versionTemplate:Extension#version 0.3 (2014-03-28)
MediaWikiTemplate:Extension#mediawiki 1.25+
PHPTemplate:Extension#php 5.3+
Changements de la base de donnéesTemplate:Extension#needs-updatephp Non
LicenceTemplate:Extension#license GNU General Public License 3.0 or later
Téléchargement
README
ParamètresTemplate:Extension#parameters
  • $wgScoreLilyPond
  • $wgScoreAbc2Ly
  • $wgScoreTimidity
  • $wgScoreTrim
  • $wgScorePath
  • $wgScoreDirectory
  • $wgScoreFileBackend
BalisesTemplate:Extension#tags
score
Accroches utiliséesTemplate:Extension#hook
ParserFirstCallInitManual:Hooks/ParserFirstCallInit

Traduisez l’extension Score sur translatewiki.net

Vérifiez la matrice des utilisations et des versions.

ProblèmesPhabricator

Tâches ouvertes · Signalez un bug

L'extension Score permet l'affichage de partitions musicales au format PNG en utilisant LilyPond et peut aussi les transformer en fichier audio ou MIDI.

Note Note : La documentation de cette page se réfère à la version actuelle de l'extension Score. Si vous téléchargez la version 0.1, référez-vous au fichier README.

Remerciements

Utilisation

Après l'installation, vous pouvez intégrer du code LilyPond simple dans le wikitext en utilisant les balises score. Par exemple :

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

donne :

\relative c' { f d f a d f e d cis a cis e a g f e }

Vous pouvez aussi préciser les attributs dans les balises score, sous la forme générale

<score attribute1="value1" attribute2="value2"></score>.

Par exemple :

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

donne :

\relative c' { f d f a d f e d cis a cis e a g f e }

Les attributs suivants sont disponibles :

Attribute Allowed values Effect
lang ABC, lilypond (default) Sets the score language. For example, to provide a score in ABC notation, you might use
<score lang="ABC">
X:1
M:C
L:1/4
K:C
C, D, E, F,|G, A, B, C|D E F G|A B c d|
e f g a|b c' d' e'|f' g' a' b'|]
</score>.
midi 0 (default), 1 If set to 1, the rendered image(s) will be embedded into a hyperlink to an appropriate MIDI file.
override_midi Known file name, that is, if override_midi="name" is given, [[File:name]] does not yield a red link Uses the specified MIDI file instead of generating one with LilyPond. Use this attribute together with the midi attribute (see before) or the vorbis attribute (see later). This attribute is useful if you already have a MIDI file whose quality is superior to what would be generated by LilyPond.
override_ogg Known file name, that is, if override_ogg="name" is given, [[File:Name]] does not yield a red link Embeds the media specified by the file name in the HTML after the score image(s). This is an alternative to the vorbis attribute (see further). It can, for example, be useful if you have a suitable Ogg/Vorbis file of superior quality compared with the auto-generated Ogg/Vorbis file the vorbis attribute yields. Of course, you can still omit both attributes in this case and add the file manually to the page, if you prefer.
raw 0 (default), 1 If set to 1, the score code is interpreted as a complete LilyPond file. Use this option if you want to create more complex scores. If the score language (lang attribute) is not set to lilypond, this attribute is ignored.
vorbis 0 (default), 1 If set to 1, an Ogg/Vorbis file will be generated for the score, provided you installed and configured Extension:TimedMediaHandler. An Ogg/Vorbis player will be embedded in the HTML after the score image(s).

Des paroles peuvent être ajoutées de cette manière :

<score>\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. }</score>

\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. }

Pré-requis

Cette extension utilise Lilypond pour générer les images des partitions, donc vous avez besoin de l'installer. Si vous souhaitez que l'extension puisse modifier les images à votre place, vous aurez aussi besoin de ImageMagick.

The extension is also capable of creating Ogg/Vorbis files from the MIDI files generated by LilyPond. If you want to make use of this functionality, you need to have Extension:TimedMediaHandler installed.

Version 0.1 of this extension was tested with MediaWiki 1.18.0 and LilyPond 2.12.3. The current SVN snapshot might require a newer version of MediaWiki and/or LilyPond.

Download instructions

Use the extension distributor. You can also download a tarball from GitHub: [1]; or as a zipped file: [2]. The score master branch on GitHub works with a stable version of MediaWiki, but may not yet have the newest features in it.

Installation

  • Téléchargez et placez le(s) fichiers (s) dans un répertoire appelé Score dans votre dossier extensions/.
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php :
    wfLoadExtension( 'Score' );
    $wgScoreLilyPond = '/path/to/your/lilypond/executable'; /* required */
    $wgScoreAbc2Ly = '/path/to/your/abc2ly/executable'; /* if you want ABC to LilyPond conversion */
    $wgScoreTimidity = '/path/to/your/timidity/executable'; /* if you want MIDI to Vorbis conversion */
    $wgScoreTrim = true; /* Set to false if you don't want score trimming */
    
  • Create a subdirectory named lilypond in your $wgUploadDirectory (usually the directory named images in in your MediaWiki directory). Make sure the directory is writable by your Web server.
  • YesY Fait - Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.

Pour les utilisateurs de MediaWiki 1.26 ou précédents :

Les instructions ci-dessous décrivent la nouvelle procédure pour installer cette extension en utilisant wfLoadExtension()

Si vous avez besoin d'installer cette extensions sur les précédentes versions de MediaWiki (1.26 ou précédent), à la place de wfLoadExtension( 'Score' );, vous devez utiliser :

require_once "$IP/extensions/Score/Score.php";

Configuration

Currently, the extension has the following global configuration parameters.

$wgScoreLilyPond

Set $wgScoreLilyPond to the path to your LilyPond executable (typically /usr/bin/lilypond or /usr/local/bin/lilypond).

$wgScoreTrim

The $wgScoreTrim is a boolean which defaults to the value of $wgUseImageMagick. If true, the resulting score PNG images are trimmed with ImageMagick. If you don't want trimming, or don't want to install ImageMagick, set $wgScoreTrim to false.

$wgScoreAbc2Ly

Set $wgScoreAbc2Ly to the path of your ABC to LilyPond converter executable (typically /usr/bin/abc2ly or /usr/local/bin/abc2ly).

$wgScoreTimidity

Set $wgScoreTimidity to the path of your TiMidity++ executable (typically /usr/bin/timidity or /usr/local/bin/timidity).

Remarks

This extension runs various binaries on a shell. You may have to increase $wgMaxShellMemory if you get out of memory errors.

Finding scores

Pages with scores on them will have the "score" page property set. Using Special:PagesWithProp, you can find pages that have scores. (Example query for the English Wikipedia.)

See also

External links