notename en français pour la 2

• Mar 29, 2015 - 19:01

Bonjour

je viens de télécharger la 2

est-ce que notename a été traduit en français

et est-ce que sa syntaxe est modifiable comme décrit dans cet échange sur la version précédente ?
http://musescore.org/fr/node/25633)


Comments

Encore merci

voici la traduction

//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Note Names Plugin
//
// Copyright (C) 2012 Werner Schweer
// Copyright (C) 2013, 2014 Joachim Schmitz
// Copyright (C) 2014 Jörn Eichler
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================

import QtQuick 2.0
import MuseScore 1.0

MuseScore {
version: "2.0"
description: qsTr("This plugin names notes")
menuPath: "Plugins.Notes." + qsTr("Note Names") // this does not work, why?

function nameChord (notes, text) {
for (var i = 0; i < notes.length; i++) {
var sep = ","; // change to "\n" if you want them vertically
if ( i > 0 )
text.text = sep + text.text;

if (typeof notes[i].tpc === "undefined") // just in case
return
switch (notes[i].tpc) {
case -1: text.text = qsTr("fabb") + text.text; break;
case 0: text.text = qsTr("dobb") + text.text; break;
case 1: text.text = qsTr("solbb") + text.text; break;
case 2: text.text = qsTr("rebb") + text.text; break;
case 3: text.text = qsTr("labb") + text.text; break;
case 4: text.text = qsTr("mibb") + text.text; break;
case 5: text.text = qsTr("sibb") + text.text; break;
case 6: text.text = qsTr("fab") + text.text; break;
case 7: text.text = qsTr("dob") + text.text; break;

case 8: text.text = qsTr("solb") + text.text; break;
case 9: text.text = qsTr("reb") + text.text; break;
case 10: text.text = qsTr("lab") + text.text; break;
case 11: text.text = qsTr("mib") + text.text; break;
case 12: text.text = qsTr("sib") + text.text; break;
case 13: text.text = qsTr("fa") + text.text; break;
case 14: text.text = qsTr("do") + text.text; break;
case 15: text.text = qsTr("sol") + text.text; break;
case 16: text.text = qsTr("re") + text.text; break;
case 17: text.text = qsTr("la") + text.text; break;
case 18: text.text = qsTr("mi") + text.text; break;
case 19: text.text = qsTr("si") + text.text; break;

case 20: text.text = qsTr("fa#") + text.text; break;
case 21: text.text = qsTr("do#") + text.text; break;
case 22: text.text = qsTr("sol#") + text.text; break;
case 23: text.text = qsTr("re#") + text.text; break;
case 24: text.text = qsTr("la#") + text.text; break;
case 25: text.text = qsTr("mi#") + text.text; break;
case 26: text.text = qsTr("si#") + text.text; break;
case 27: text.text = qsTr("fa##") + text.text; break;
case 28: text.text = qsTr("do##") + text.text; break;
case 29: text.text = qsTr("sol##") + text.text; break;
case 30: text.text = qsTr("re##") + text.text; break;
case 31: text.text = qsTr("la##") + text.text; break;
case 32: text.text = qsTr("mi##") + text.text; break;
case 33: text.text = qsTr("si##") + text.text; break;
default: text.text = qsTr("?") + text.text; break;
} // end switch tpc

// octave, middle C being C4
//text.text += (Math.floor(notes[i].pitch / 12) - 1)
// or
//text.text += (Math.floor(notes[i].ppitch / 12) - 1)

// change below false to true for courtesy- and microtonal accidentals
// you might need to come up with suitable translations
// only #, b, natural and possibly also ## seem to be available in UNICODE
if (false) {
switch (notes[i].userAccidental) {
case 0: break;
case 1: text.text = qsTr("#") + text.text; break;
case 2: text.text = qsTr("b") + text.text; break;
case 3: text.text = qsTr("##") + text.text; break;
case 4: text.text = qsTr("bb") + text.text; break;
case 5: text.text = qsTr("natural") + text.text; break;
case 6: text.text = qsTr("flat-slash") + text.text; break;
case 7: text.text = qsTr("flat-slash2") + text.text; break;
case 8: text.text = qsTr("mirrored-flat2") + text.text; break;
case 9: text.text = qsTr("mirrored-flat") + text.text; break;
case 10: text.text = qsTr("mirrored-flat-slash") + text.text; break;
case 11: text.text = qsTr("flat-flat-slash") + text.text; break;
case 12: text.text = qsTr("sharp-slash") + text.text; break;
case 13: text.text = qsTr("sharp-slash2") + text.text; break;
case 14: text.text = qsTr("sharp-slash3") + text.text; break;
case 15: text.text = qsTr("sharp-slash4") + text.text; break;
case 16: text.text = qsTr("sharp arrow up") + text.text; break;
case 17: text.text = qsTr("sharp arrow down") + text.text; break;
case 18: text.text = qsTr("sharp arrow both") + text.text; break;
case 19: text.text = qsTr("flat arrow up") + text.text; break;
case 20: text.text = qsTr("flat arrow down") + text.text; break;
case 21: text.text = qsTr("flat arrow both") + text.text; break;
case 22: text.text = qsTr("natural arrow down") + text.text; break;
case 23: text.text = qsTr("natural arrow up") + text.text; break;
case 24: text.text = qsTr("natural arrow both") + text.text; break;
case 25: text.text = qsTr("sori") + text.text; break;
case 26: text.text = qsTr("koron") + text.text; break;
default: text.text = qsTr("?") + text.text; break;
} // end switch userAccidental
} // end if courtesy- and microtonal accidentals
} // end for note
}

onRun: {
if (typeof curScore === 'undefined')
Qt.quit();
var cursor = curScore.newCursor();
var startStaff;
var endStaff;
var endTick;
var fullScore = false;
cursor.rewind(1);
if (!cursor.segment) { // no selection
fullScore = true;
startStaff = 0; // start with 1st staff
endStaff = curScore.nstaves - 1; // and end with last
} else {
startStaff = cursor.staffIdx;
cursor.rewind(2);
if (cursor.tick == 0) {
// this happens when the selection includes
// the last measure of the score.
// rewind(2) goes behind the last segment (where
// there's none) and sets tick=0
endTick = curScore.lastSegment.tick + 1;
} else {
endTick = cursor.tick;
}
endStaff = cursor.staffIdx;
}
console.log(startStaff + " - " + endStaff + " - " + endTick)

for (var staff = startStaff; staff <= endStaff; staff++) {
for (var voice = 0; voice < 4; voice++) {
cursor.rewind(1); // beginning of selection
cursor.voice = voice;
cursor.staffIdx = staff;

if (fullScore) // no selection
cursor.rewind(0); // beginning of score

while (cursor.segment && (fullScore || cursor.tick < endTick)) {
if (cursor.element && cursor.element.type == Element.CHORD) {
var text = newElement(Element.STAFF_TEXT);

var graceChords = cursor.element.graceNotes;
for (var i = 0; i < graceChords.length; i++) {
// iterate through all grace chords
var notes = graceChords[i].notes;
nameChord(notes, text);
// there seems to be no way of knowing the exact horizontal pos.
// of a grace note, so we have to guess:
text.pos.x = -2.5 * (graceChords.length - i);
switch (voice) {
case 0: text.pos.y = 1; break;
case 1: text.pos.y = 10; break;
case 2: text.pos.y = -1; break;
case 3: text.pos.y = 12; break;
}

cursor.add(text);
// new text for next element
text = newElement(Element.STAFF_TEXT);
}

var notes = cursor.element.notes;
nameChord(notes, text);

switch (voice) {
case 0: text.pos.y = 1; break;
case 1: text.pos.y = 10; break;
case 2: text.pos.y = -1; break;
case 3: text.pos.y = 12; break;
}
if ((voice == 0) && (notes[0].pitch > 83))
text.pos.x = 1;
cursor.add(text);
} // end if CHORD
cursor.next();
} // end while segment
} // end for voice
} // end for staff
Qt.quit();
} // end onRun
}

Bonjour

dans MS2 quand je lance notename sur une "partie" le nom des notes s'affiche aussi sur le conducteur.
Comment faire pour n'afficher le nom des notes que sur les parties et pas sur le conducteur ?
Et aussi pour extraire deux fois la même partie dont une sans nom des note et l'autre avec nom des notes ?

In reply to by RV

Tu veux que les parties restent liées ? Si non tu peux exporter les parties au format MSCZ et appliquer le plugin que dans ce format.
Si oui, tu peux créer deux fois la partie, et rendre le nom des notes invisibles dans le conducteur et dans une des deux parties.

grand merci pour ta réponse !

j'espérais n'avoir la liaison entre le conducteur et les parties que dans le sens descendant
tout ajout dans les parties n'étant pas remonté au conducteur
et toute modification du conducteur répercuté sur les parties

si je conserve les parties liées au conducteur il faudrait que je cache les noms des notes quand je veux imprimer une partie sans le nom des notes et que je les montre quand je veux les imprimer
mais en fait ce n'est pas opérationnel parce que les parties avec le nom des notes n'ont pas du tout la même mise en page que celle sans le nom des notes.
Dans le cas le plus courant , une page sans nom des notes tient sur deux pages quand je mets le nom des notes parce que je modifie la mise en page pour que le texte soit suffisamment lisible et qu'il ne se chevauche pas !

donc je vais prendre ta solution qui consiste à exporter en MSCZ et appliquer le plugin que dans ce format.

Bonjour,

Tous les posts précédents m'ont été très précieux pour faire mes modifications sous Linux.
Le plugin se trouve dans /usr/share/mscore-2.0/plugins. Voici le script :
//=============================================================================
// MuseScore
// Music Composition & Notation
//
// Note Names Plugin
//
// Copyright (C) 2012 Werner Schweer
// Copyright (C) 2013 - 2016 Joachim Schmitz
// Copyright (C) 2014 Jörn Eichler
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================

import QtQuick 2.0
import MuseScore 1.0

MuseScore {
version: "2.0"
description: qsTr("This plugin names notes as per your language setting")
menuPath: "Plugins.Notes." + qsTr("Note Names") // this does not work, why?

function nameChord (notes, text) {
for (var i = 0; i < notes.length; i++) {
var sep = ","; // change to "\n" if you want them vertically
if ( i > 0 )
text.text = sep + text.text; // any but top note

if (typeof notes[i].tpc === "undefined") // like for grace notes ?!?
return
switch (notes[i].tpc) {
case -1: text.text = qsTranslate("InspectorAmbitus", "Fa♭♭") + text.text; break;
case 0: text.text = qsTranslate("InspectorAmbitus", "Do♭♭") + text.text; break;
case 1: text.text = qsTranslate("InspectorAmbitus", "Sol♭♭") + text.text; break;
case 2: text.text = qsTranslate("InspectorAmbitus", "Ré♭♭") + text.text; break;
case 3: text.text = qsTranslate("InspectorAmbitus", "La♭♭") + text.text; break;
case 4: text.text = qsTranslate("InspectorAmbitus", "Mi♭♭") + text.text; break;
case 5: text.text = qsTranslate("InspectorAmbitus", "Si♭♭") + text.text; break;
case 6: text.text = qsTranslate("InspectorAmbitus", "Fa♭") + text.text; break;
case 7: text.text = qsTranslate("InspectorAmbitus", "Do♭") + text.text; break;

case 8: text.text = qsTranslate("InspectorAmbitus", "Sol♭") + text.text; break;
case 9: text.text = qsTranslate("InspectorAmbitus", "Ré♭") + text.text; break;
case 10: text.text = qsTranslate("InspectorAmbitus", "La♭") + text.text; break;
case 11: text.text = qsTranslate("InspectorAmbitus", "Mi♭") + text.text; break;
case 12: text.text = qsTranslate("InspectorAmbitus", "Si♭") + text.text; break;
case 13: text.text = qsTranslate("InspectorAmbitus", "Fa") + text.text; break;
case 14: text.text = qsTranslate("InspectorAmbitus", "Do") + text.text; break;
case 15: text.text = qsTranslate("InspectorAmbitus", "Sol") + text.text; break;
case 16: text.text = qsTranslate("InspectorAmbitus", "Ré") + text.text; break;
case 17: text.text = qsTranslate("InspectorAmbitus", "La") + text.text; break;
case 18: text.text = qsTranslate("InspectorAmbitus", "Mi") + text.text; break;
case 19: text.text = qsTranslate("InspectorAmbitus", "Si") + text.text; break;

case 20: text.text = qsTranslate("InspectorAmbitus", "Fa♯") + text.text; break;
case 21: text.text = qsTranslate("InspectorAmbitus", "Do♯") + text.text; break;
case 22: text.text = qsTranslate("InspectorAmbitus", "Sol♯") + text.text; break;
case 23: text.text = qsTranslate("InspectorAmbitus", "Ré♯") + text.text; break;
case 24: text.text = qsTranslate("InspectorAmbitus", "La♯") + text.text; break;
case 25: text.text = qsTranslate("InspectorAmbitus", "Mi♯") + text.text; break;
case 26: text.text = qsTranslate("InspectorAmbitus", "Si♯") + text.text; break;
case 27: text.text = qsTranslate("InspectorAmbitus", "Fa♯♯") + text.text; break;
case 28: text.text = qsTranslate("InspectorAmbitus", "Do♯♯") + text.text; break;
case 29: text.text = qsTranslate("InspectorAmbitus", "Sol♯♯") + text.text; break;
case 30: text.text = qsTranslate("InspectorAmbitus", "Ré♯♯") + text.text; break;
case 31: text.text = qsTranslate("InspectorAmbitus", "La♯♯") + text.text; break;
case 32: text.text = qsTranslate("InspectorAmbitus", "Mi♯♯") + text.text; break;
case 33: text.text = qsTranslate("InspectorAmbitus", "Si♯♯") + text.text; break;
default: text.text = qsTr("?") + text.text; break;
} // end switch tpc

// octave, middle C being C4
//text.text += (Math.floor(notes[i].pitch / 12) - 1)
// or
//text.text += (Math.floor(notes[i].ppitch / 12) - 1)

// change below false to true for courtesy- and microtonal accidentals
// you might need to come up with suitable translations
// only #, b, natural and possibly also ## seem to be available in UNICODE
if (false) {
switch (notes[i].userAccidental) {
case 0: break;
case 1: text.text = qsTranslate("accidental", "Sharp") + text.text; break;
case 2: text.text = qsTranslate("accidental", "Flat") + text.text; break;
case 3: text.text = qsTranslate("accidental", "Double sharp") + text.text; break;
case 4: text.text = qsTranslate("accidental", "Double flat") + text.text; break;
case 5: text.text = qsTranslate("accidental", "Natural") + text.text; break;
case 6: text.text = qsTranslate("accidental", "Flat-slash") + text.text; break;
case 7: text.text = qsTranslate("accidental", "Flat-slash2") + text.text; break;
case 8: text.text = qsTranslate("accidental", "Mirrored-flat2") + text.text; break;
case 9: text.text = qsTranslate("accidental", "Mirrored-flat") + text.text; break;
case 10: text.text = qsTranslate("accidental", "Mirrored-flat-slash") + text.text; break;
case 11: text.text = qsTranslate("accidental", "Flat-flat-slash") + text.text; break;
case 12: text.text = qsTranslate("accidental", "Sharp-slash") + text.text; break;
case 13: text.text = qsTranslate("accidental", "Sharp-slash2") + text.text; break;
case 14: text.text = qsTranslate("accidental", "Sharp-slash3") + text.text; break;
case 15: text.text = qsTranslate("accidental", "Sharp-slash4") + text.text; break;
case 16: text.text = qsTranslate("accidental", "Sharp arrow up") + text.text; break;
case 17: text.text = qsTranslate("accidental", "Sharp arrow down") + text.text; break;
case 18: text.text = qsTranslate("accidental", "Sharp arrow both") + text.text; break;
case 19: text.text = qsTranslate("accidental", "Flat arrow up") + text.text; break;
case 20: text.text = qsTranslate("accidental", "Flat arrow down") + text.text; break;
case 21: text.text = qsTranslate("accidental", "Flat arrow both") + text.text; break;
case 22: text.text = qsTranslate("accidental", "Natural arrow down") + text.text; break;
case 23: text.text = qsTranslate("accidental", "Natural arrow up") + text.text; break;
case 24: text.text = qsTranslate("accidental", "Natural arrow both") + text.text; break;
case 25: text.text = qsTranslate("accidental", "Sori") + text.text; break;
case 26: text.text = qsTranslate("accidental", "Koron") + text.text; break;
default: text.text = qsTr("?") + text.text; break;
} // end switch userAccidental
} // end if courtesy- and microtonal accidentals
} // end for note
}

onRun: {
if (typeof curScore === 'undefined')
Qt.quit();

var cursor = curScore.newCursor();
var startStaff;
var endStaff;
var endTick;
var fullScore = false;
cursor.rewind(1);
if (!cursor.segment) { // no selection
fullScore = true;
startStaff = 0; // start with 1st staff
endStaff = curScore.nstaves - 1; // and end with last
} else {
startStaff = cursor.staffIdx;
cursor.rewind(2);
if (cursor.tick == 0) {
// this happens when the selection includes
// the last measure of the score.
// rewind(2) goes behind the last segment (where
// there's none) and sets tick=0
endTick = curScore.lastSegment.tick + 1;
} else {
endTick = cursor.tick;
}
endStaff = cursor.staffIdx;
}
console.log(startStaff + " - " + endStaff + " - " + endTick)

for (var staff = startStaff; staff <= endStaff; staff++) {
for (var voice = 0; voice < 4; voice++) {
cursor.rewind(1); // beginning of selection
cursor.voice = voice;
cursor.staffIdx = staff;

if (fullScore) // no selection
cursor.rewind(0); // beginning of score

while (cursor.segment && (fullScore || cursor.tick < endTick)) {
if (cursor.element && cursor.element.type == Element.CHORD) {
var text = newElement(Element.STAFF_TEXT);

var graceChords = cursor.element.graceNotes;
for (var i = 0; i < graceChords.length; i++) {
// iterate through all grace chords
var notes = graceChords[i].notes;
nameChord(notes, text);
// there seems to be no way of knowing the exact horizontal pos.
// of a grace note, so we have to guess:
text.pos.x = -2.5 * (graceChords.length - i);
switch (voice) {
case 0: text.pos.y = 1; break;
case 1: text.pos.y = 10; break;
case 2: text.pos.y = -1; break;
case 3: text.pos.y = 12; break;
}

cursor.add(text);
// new text for next element
text = newElement(Element.STAFF_TEXT);
}

var notes = cursor.element.notes;
nameChord(notes, text);

switch (voice) {
case 0: text.pos.y = 1; break;
case 1: text.pos.y = 10; break;
case 2: text.pos.y = -1; break;
case 3: text.pos.y = 12; break;
}
if ((voice == 0) && (notes[0].pitch > 83))
text.pos.x = 1;
cursor.add(text);
} // end if CHORD
cursor.next();
} // end while segment
} // end for voice
} // end for staff
Qt.quit();
} // end onRun
}
Cordialement. DR

Do you still have an unanswered question? Please log in first to post your question.