# -*- coding: ISO-8859-1 -*- """ capellaScript -- 28.05.2007 Hans H. Lampe >>> Tonartvorzeichnung entfernen Mit diesem Skript kann die Tonartvorzeichnung am Anfang der Notenzeilen z.B. für Orchester-Instrumente, wie Trompeten, Hörner oder Pauken entfernt werden. ||Die entsprechenden Alterationen befinden sich dann direkt an den Noten.|| Bitte den Cursor für die automatische Zeilenwahl in die entsprechende Notenzeile setzen, oder die gewünschte Notenzeile im nachfolgenden Dialog wählen.||| Rückmeldungen bitte an Hans H. Lampe:|HansHermann.Lampe@t-online.de Remove Key Signatures

With this script key signatures can be removed e.g. for orchestre instruments such as trumpets, horns and tympani. The corresponding accidentals are placed directly in front of the notes.

Please put the cursor in the corresponding staff for automatic selection or select the desired staff in the selection window of the dialogue.

Reactions please to Hans H. Lampe: HansHermann.Lampe@t-online.de

Tonartvorzeichnung entfernen

Mit diesem Skript kann die Tonartvorzeichnung am Anfang der Notenzeilen z.B. für Orchester-Instrumente, wie Trompeten, Hörner oder Pauken entfernt werden. Die entsprechenden Alterationen befinden sich dann direkt an den Noten.

Bitte den Cursor für die automatische Zeilenwahl in die entsprechende Notenzeile setzen, oder die gewünschte Notenzeile im nachfolgenden Dialog wählen.

Rückmeldungen bitte an Hans H. Lampe: HansHermann.Lampe@t-online.de

Toonsoortvoortekens verwijderen

Met dit script kunnen toonsoortvoortekens aan het begin van de notenbalk worden verwijderd voor instrumenten zoals trompetten, hoorns en pauken. De betreffende voortekens worden direct vóór de noten geplaatst.

S.v.p. de cursor voor automatische notenbalkselectie in de betreffende notenbalk plaatsen of de gewenste notenbalk in het selectievenster in de dialoog selecteren.

Reacties graag naar Hans H. Lampe: HansHermann.Lampe@t-online.de

History: Version 1.0 HL 28.05.2007 Version 1.1 PB 21.08.2017 Anpassung an Capella 8 Version 1.2 WW 30.04.2020 Internationalisiert (de-en-nl) <<< """ english = { 'selStaff' :'Select staff of the instrument ( by positioning of the cursor automatically preselected ) ', 'descrStaffLayout' :' \'Description\' of the staff in the Staff Lay-out', 'remKeySign' :' Remove Key Signatures', } german = { 'selStaff' :'Notenzeile des Instruments wählen ( durch Cursorpositionierung automatisch vorgewählt ) ', 'descrStaffLayout' :' \'Beschreibung\' der Notenzeile im Mustersystem', 'remKeySign' :' Tonartvorzeichnung entfernen', } dutch = { 'selStaff' :'Notenbalk van het instrument selecteren ( door cursorplaatsing automatisch voorgeselecteerd ) ', 'descrStaffLayout' :' \'Beschrijving\' van de notenbalk in het partituursjabloon', 'remKeySign' :' Toonsoortvoortekens verwijderen', } try: setStringTable( ("en", english), ("de", german), ("nl", dutch)) except: def tr(s): return german[s] # -------- Cursorzeile ermitteln --------- # staffList = activeScore().voiceList() staffIndex = 0 sel = curSelection() if sel <> 0: (sy,st,vo,no) = sel[0] system = activeScore().system(sy) staff = system.staff(st) # ------ Aktuellen Eintrag im Mustersystem bestimmen ------- # i = 0 for descr in staffList: if staff.index() == system.staffIndexFromDescr(descr): staffIndex = i i += 1 # -------- Dialogbox --------- # labStaff1 = Label(tr('selStaff')) selStaff = ComboBox(staffList, value = staffIndex, width = 19) labStaff2 = Label(tr('descrStaffLayout'), width=38) dlg = Dialog(tr('remKeySign'), VBox([ HBox([labStaff1]), Label(''), HBox([selStaff, labStaff2]), ] ) ) # Tonartvorzeichnung entfernen #============================= from caplib.capDOM import ScoreChange import xml.dom.minidom DOC = xml.dom.minidom.Document import tempfile, codecs def deleteKey(score): for system in score.getElementsByTagName('system'): for staff in system.getElementsByTagName('staff'): layout = staff.getAttribute('layout') if layout != staffList[selStaff.value()]: continue keySign = staff.getElementsByTagName('keySign') if keySign != []: keySign = staff.getElementsByTagName('keySign')[0] fifths = keySign.getAttribute('fifths') keySign.setAttribute('fifths','0') class newScoreChange(ScoreChange): def changeScore(self, score): global scriptAction, doc doc = score.parentNode deleteKey(score) # ------ Hauptprogramm ------ # activeScore().registerUndo("Vorzeichnung entfernen") if dlg.run(): if activeScore(): activeScore().registerUndo("Vorzeichnung entfernen") tempInput = tempfile.mktemp('.capx') # für aktuelle aktive Partitur # tempOutput = tempfile.mktemp('.capx') activeScore().write(tempInput) newScoreChange(tempInput, tempOutput) # Tonartvorzeichnung entfernen activeScore().read(tempOutput) os.remove(tempInput) os.remove(tempOutput)