Extension:Score/it
The Score extension requires setting up an external service, Shellbox , to securely process musical scores via LilyPond. Please review the information in #Security concerns and the 2021 security advisory before installing this extension. |
Score Stato della release: stabile |
|
---|---|
File:Lilytest1.png | |
Implementazione | Etichetta |
Descrizione | Permette la resa di spartiti musicali con LilyPond. |
Autore(i) | Alexander Klauer, Étienne Beaulé |
Versione | 0.3.0 (2019-03-23) |
MediaWiki | 1.36+ |
PHP | 5.3+ |
Licenza | Nessuna licenza specificata |
Scaricare | README.md |
score |
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Traduci l'estensione Score se è disponibile su translatewiki.net | |
Problemi | Compiti aperti · Riportare un bug |
L'estensione Score permette il rendering di spartiti musicali come immagini PNG utilizzando LilyPond e può anche trasformarli in file audio e MIDI.
Riconoscimenti
L'originale Extension:LilyPond è stato scritto da Johannes E. Schindelin.
- Questa estensione si basa su una revisione del code di Extension:LilyPond di Tim Starling.
- L'originale Extension:ABC è stato scritto da River Tarnell.
Uso
Dopo l'installazione, puoi semplicemeten incorporare le notazioni LilyPond nel tuo wikitesto usando i tag <score>...</score>
. Per esempio:
<score>\relative c' { f d f a d f e d cis a cis e a g f e }</score>
rende:
<score lang="lilypond">\relative c' { f d f a d f e d cis a cis e a g f e }</score>
È inoltre possibile specificare gli attributi dei tag di punteggio nella forma generale
<score attribute1="value1" attribute2="value2">…</score>.
Per esempio:
<score sound="1">\relative c' { f d f a d f e d cis a cis e a g f e }</score>
rende:
<score sound="1" lang="lilypond" vorbis="1">\relative c' { f d f a d f e d cis a cis e a g f e }</score>
Sono disponibili i seguenti attributi:
Attributi | Valori concessi | Effetti |
---|---|---|
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 | <translate> (removed)</translate> This used to control whether the rendered score image linked to a MIDI file. | |
override_midi | Known file name, that is, if override_midi="name" is given, [[File:name]] does not yield a red link |
<translate> (deprecated)</translate> Instead you can add a [[File:superior midi filename.mid]] wikilink after the closing </score> tag.Uses the specified MIDI file instead of generating one with LilyPond. Use this attribute together with the midi attribute (see before) or the sound 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_audio | Known file name, that is, if override_audio="name" is given, [[File:Name]] does not yield a red link |
<translate> (deprecated)</translate> Instead you can add a [[File:superior audio filename.oga]] wikilink after the closing </score> tag.Embeds the media specified by the file name in the HTML after the score image(s). This is an alternative to the sound attribute (see further). It can, for example, be useful if you have a suitable audio file of superior quality compared with the auto-generated audio file. Of course, you can still omit both attributes in this case and add the file manually to the page, if you prefer. |
override_ogg | <translate> (deprecated)</translate> Doubly-deprecated alias for override_audio. | |
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. By default (when raw=0), provided code is wrapped in a \score{...} block, along with default \layout{...} and \midi{...} blocks, if not already provided.
|
sound | 0 (default), 1 | If set to 1, an audio file will be generated for the score, provided you installed and configured Extension:TimedMediaHandler . An audio player will be embedded in the HTML after the score image(s). |
vorbis | 0 (default), 1 | <translate> (deprecated)</translate> Alias for sound. |
Il linguaggio Lilypond
I testi possono essere aggiunti in questo modo:
<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>
<score lang="lilypond" vorbis="1">\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>
Per gli utenti avanzati, il comando \set Staff.midiInstrument
può essere usato per cambiare lo strumento MIDI per il suono.
Prerequisiti
The following packages are recommended:
- LilyPond
- Ghostscript
- ImageMagick
- FluidSynth
- Firejail
Questa estensione utilizza LilyPond per rendere le immagini dei punteggi, quindi è necessaria un'installazione LilyPond funzionante. Se volete l'estensione per tagliare i file dei punteggi per voi, avrete bisogno anche di ImageMagick. If you install LilyPond from a package, Ghostscript will also be installed, since LilyPond depends on Ghostscript. ImageMagick should be installed to trim the images, otherwise they will contain an excessive amount of whitespace.
For security reasons, it is highly recommended to install firejail to further restrict what LilyPond and Ghostscript can do if untrusted users are allowed to edit your wiki.
L'estensione è anche in grado di creare file audio dai file MIDI generati da LilyPond. Se si vuole utilizzare questa funzionalità, è necessario avere installato Extension:TimedMediaHandler .
FluidSynth is the preferred method to convert MIDI files to audio files, however TiMidity++ is also supported.
Security concerns
Score uses LilyPond in safe mode, however there are known unfixed safe mode escape vulnerabilities leading to arbitrary execution.
If you don't absolutely trust everyone who has editing privileges on your wiki, it is strongly recommended to set up containment of lilypond using Shellbox . See Shellbox#Server setup for details on how to set up the contained server, and below for configuring MediaWiki to use it. Also, ensure you're using a recent version of LilyPond (2.22.0+) or a distribution package (e.g. from Debian) that has security fixes. Keep safe mode enabled, even with containment as an extra layer of defense. Certain functionality will not work in safe mode, the fix for that is to modify LilyPond to allow that functionality in safe mode.
Installazione
- See the extension's
README.md
for detailed installation instructions.
- <translate> [[<tvar name=2>Special:ExtensionDistributor/Score/it</tvar>|Download]] and move the extracted <tvar name=name>
Score/it
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Score%2Fit - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'Score/it' ); $wgScoreTrim = true; $wgImageMagickConvertCommand = '/usr/bin/convert'; $wgShellboxUrl = '... address to Shellbox ...'; $wgShellboxSecretKey = '... your secret key ...';
- Create a subdirectory named
lilypond
in your $wgUploadDirectory (usually the directory namedimages
in your MediaWiki directory). Make sure the directory is writable by your Web server. - File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
Configurazione
Attualmente, l'estensione ha i seguenti parametri di configurazione globale.
$wgScoreLilyPond
Imposta $wgScoreLilyPond
sul percorso del tuo eseguibile LilyPond (tipicamente /usr/bin/bin/lilypond
o /usr/local/bin/lilypond
).
$wgScoreTrim
Il <codice>$wgScoreTrim</codice> è un booleano che ha come valore predefinito <codice>$wgUseImageMagick</codice>. Se true
, le immagini PNG del punteggio risultante vengono tagliate con ImageMagick. Se non si desidera il trimming, o non si vuole installare ImageMagick, impostare $wgScoreTrim
su false
$wgScoreAbc2Ly
Impostare $wgScoreAbc2Ly
sul percorso eseguibile del convertitore da ABC a LilyPond (tipicamente /usr/bin/abc2ly
o /usr/local/bin/abc2ly
).
$wgScoreFluidsynth
Impostare $wgScoreFluidsynth
sul percorso del proprio eseguibile Fluidsynth (tipicamente /usr/bin/fluidsynth
o /usr/local/bin/fluidsynth
).
$wgScoreSoundfont
Impostare $wgScoreSoundfont
sul percorso del file soundfont (tipicamente /usr/share/sounds/sf2/FluidR3_GM.sf2
o /usr/share/sounds/sf2/FluidR3_GS.sf2
).
$wgScoreLame
Impostare $wgScoreLame
sul percorso del proprio eseguibile Lame (tipicamente /usr/bin/lame
o /usr/local/bin/lame
). Richiesto se il file audio generato deve essere un MP3.
Osservazioni
Questa estensione esegue vari binari su shell. Potresti dover aumentare di $wgMaxShellMemory se esci per errori di memoria.
Trovare i punteggi
Le pagine con i punteggi su di esse avranno il "punteggio" page property impostato. Usando Special:PagesWithProp, si possono trovare pagine che hanno un punteggio. ([$url Esempio di richiesta per la Wikipedia inglese]).
See also
- Help:Score on English Wikipedia and Help:Sheet music on Wikisource have more examples of LilyPond syntax.
- Vexflow Renderizzatore musicale open source SVG/Canvas
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
Lilytest1.png |
- Pages with script errors
- Pages with broken file links
- Stable extensions/it
- Tag extensions/it
- Extensions with manual MediaWiki version
- Extensions with no license specified/it
- Extensions in Wikimedia version control/it
- All extensions/it
- Extensions not in ExtensionJson
- Extensions used on Wikimedia/it
- Music editor extensions/it
- Extensions with VisualEditor support/it