{ Initialize "() { AddToPluginsMenu(_PluginMenuName,'Run'); }" Run "() { if (Sibelius.ProgramVersion < zg_Sib52Version) { MyMessageBox(_msgVersionTooEarly); return False; } // update zg_VersionNumber when changes are made. _Version = BuildVersionText(zg_VersionNumber); if (Sibelius.ScoreCount = 0) { MyMessageBox(_ScoreError); return False; } score = Sibelius.ActiveScore; selection = score.Selection; if (score.StaffCount = 0) { MyMessageBox(_ScoreError); return False; } if (IsSelectionEmpty(selection)) { MyMessageBox(_msgNeedsSelection); return False; } score.Redraw = False; dlg_strTextStyleNameList = _strTextStyleTechnique; dlg_strTextStyleNameEdit = '' & dlg_strTextStyleNameList; dlg_strSymbolNameList = '' & _dlg_lstSymbol[0]; dlg_strSymbolNameEdit = '' &dlg_strSymbolNameList; SetDialogControlIds(); ok = DoDialog(score); if (ok = False) { score.Redraw = True; return False; } num = 0; switch (g_iType) { case (dlg_iSymbol) { num = ProcessSymbols(score, selection); } case (dlg_iTiedNotes) { num = ProcessTiedNotes(score, selection); } case (dlg_iNotePitches) { num = ProcessNotePitches(score, selection); } case (dlg_iNotehead) { num = ProcessNoteheads(score, selection); } case (dlg_iTimeSignature) { num = ProcessTimeSignatures(score, selection); } case (dlg_iGraceNote) { num = ProcessGraceNotes(score, selection); } case (dlg_iSpecialBarline) { num = ProcessSpecialBarlines(score, selection); } case (dlg_iNoteSlideProperty) { num = ProcessNoteSlideProperties(score, selection); } case (dlg_iNoteBracketProperty) { num = ProcessNoteBracketProperties(score, selection); } case (dlg_iCueSize) { num = ProcessCueSize(score, selection); } case (dlg_iHidden) { num = ProcessHidden(score, selection); } case (dlg_iColored) { num = ProcessColored(score, selection); } default { num = ProcessText(score, selection); } } // bring selection into view Sibelius.MoveActiveViewToSelection(); score.Redraw = True; if ((num >= 0) and (dlg_fShowResults)) { str = (_msgNumProcessed & dlg_strType & ' = ' & num); if (num = 0) { str = str & _msgNoneProcessed; } MyMessageBox(str); } }" _ScoreError "Please open a score with one or more staves and run the plugin again." _PluginMenuName "Filter Other" DisplayDialog "Dialog" { Controls { Button { Title "Deselect" X "322" Y "130" Width "46" Height "14" DefaultButton "0" Value Method "DoDeselect" SetFocus "0" EndDialog "1" } Button { Title "Select" X "373" Y "130" Width "40" Height "14" DefaultButton "1" Value Method "DoSelect" SetFocus "0" EndDialog "1" } ComboBox { Title X "4" Y "84" Width "103" Height "12" ListVar "_dlg_lstTypes" Value "dlg_strType" Method "DoChangeTypeList" SetFocus "0" } Edit { Title X "125" Y "85" Width "140" Height "12" Value "dlg_strStyleNameEdit" Method SetFocus "1" } ComboBox { Title X "273" Y "84" Width "140" Height "12" ListVar "dlg_lstStyles" Value "dlg_strStyleNameList" Method "DoChangeStyleList" SetFocus "0" } CheckBox { Title "Trace object locations" X "4" Y "102" Width "164" Height "12" Value "dlg_fTraceLocation" Method SetFocus "0" } Button { Title "Cancel" X "276" Y "130" Width "40" Height "14" DefaultButton "0" Value Method SetFocus "0" EndDialog "0" } Text { Title X "4" Y "4" Width "400" Height "47" RightAlign "0" Value "_InitialText" Method SetFocus "0" } Text { Title "Object to filter:" X "4" Y "57" Width "95" Height "12" RightAlign "0" Value Method SetFocus "0" } Text { Title X "112" Y "57" Width "299" Height "24" RightAlign "0" Value "dlg_strInstructions" Method SetFocus "0" } Text { Title "by Bob Zawalich" X "4" Y "132" Width "66" Height "12" RightAlign "0" Value Method SetFocus "0" } Text { Title X "81" Y "132" Width "68" Height "11" RightAlign "0" Value "_Version" Method SetFocus "0" } CheckBox { Title "Show number of objects found (this session)" X "4" Y "116" Width "210" Height "12" Value "dlg_fShowResults" Method SetFocus "0" } } Title "Filter Other" X "216" Y "220" Width "421" Height "166" } DoDialog "(score) { dlg_fDoSelect = False; dlg_fDoDeselect = False; ReopenDialog = True; g_fReopen = False; DoDialogSetup(); while (ReopenDialog = True) { g_fDialogVisible = True; // need to avoid calling RefreshDialog before dialog comes up if (Sibelius.ShowDialog(DisplayDialog,Self) = False) { return False; } if (ValidateChoice(score) = False) { g_fReopen = True; } //trace('DoDialog freopen = ' & g_fReopen); if (g_fReopen = False) { ReopenDialog = False; } g_fReopen = False; } return True; }" g_fReopen "false" MyMessageBox "(string) { Sibelius.MessageBox(_PluginMenuName & ': ' & string);}" _InitialText "Choose the type of object to filter; then, if appropriate, type or select a style name. You can then select or deselect the objects from the current selection. Note that Deselecting from a large selection can take a long time; please be patient!" Version "() { // this is a version number that can be compared numerically, of the form // Major version (2 digits) & Minor Version (2 digts) & Patch (2 digits) return 0 + zg_VersionNumber;}" _Version "Version 02.09.00" _VersionText "Version " zg_VersionNumber "020900" BuildVersionText "(versionNumber) { // this assumes that versionNumber is of the form // Major version (2 digits) & Minor Version (2 digts) & Patch (2 digits) // it builds up text version of the version number so only a single value needs to be updated str = '' & versionNumber; vText = _VersionText & Substring(str, 0, 2) & '.' & Substring(str, 2, 2) & '.' & Substring(str, 4, 2); return vText;}" _captionSorting "Building text styles list..." zg_Sib5Version "4700" _msgVersionTooEarly "This plug-in requires Sibelius version 5.2 or later." ProcessText "(score, selection) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { styleId = GetTextStyleId(score, str); } else { styleId = GetTextStyleIdFromList(score); } if (selection.IsPassage and (selection.IsSystemPassage = False)) // do not warn for multiple selection { if (styleId = _strAllTextStyles) { MyMessageBox(_msgStaffTextOnly); } else { if (IsSystemText(styleId)) { ok = MyYesNoMessageBox(_msgNeedsSystemSelection); if (ok) // ok means change to system selection { selection.SelectSystemPassage(selection.FirstBarNumber, selection.LastBarNumber, selection.FirstBarSr, selection.LastBarSr); } else { return -1; } } } } num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = (((obj.Type = 'Text') or (obj.Type = 'SystemTextItem') or (obj.Type = 'LyricItem')) and ((styleId = _strAllTextStyles) or (obj.StyleId = styleId))); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { n = 'obj' & num; @n = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { n = 'obj' & i; obj = @n; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" ProcessTiedNotes "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { if (obj.Type != 'NoteRest') // not desired object { fDesired = False; if (dlg_fDoDeselect) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; } } else // NoteRest { for each n in obj { if (n.Selected) { fDesired = n.Tied; if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = n; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" _strAllSymbols "All symbols" FillTextStyleList "(score) { dlg_lstTextStyles = _dlg_lstTextStyles; return True; }" GetTextStyleId "(score, str) { if (str = _strAllTextStyles) { return '' & _strAllTextStyles; } styleId = score.TextStyleId(str); return styleId; // '' if invalid }" GetTextStyleIdFromList "(score) { if (dlg_strStyleNameList = _strAllTextStyles) { return '' & _strAllTextStyles; } styleId = score.TextStyleId(dlg_strStyleNameList); return styleId; // '' if invalid }" _strAllTextStyles "All text styles" GetSymbolIndex "(score, str) { strTrim = TrimBlanks(str); if (strTrim = _strAllSymbols) { return 0; } if (utils.IsNumeric(strTrim, True)) // needs 5.2 version. Number may be out of range of list if user defined, so take any number entered. { return strTrim; } // see if the string is the right half of the current list entry. If so, just // use the index from the list entry. If not, check the validity of the name. arr = SplitString(dlg_strStyleNameList, '-'); if (strTrim = ('' & arr[1])) { id = 0 + arr[0]; return id; } // name not list entry. Find id in score id = score.SymbolIndex(strTrim); return id; // -1 if invalid }" GetSymbolIndexFromList "(score) { if (dlg_strStyleNameList = _strAllSymbols) { return 0; } arr = SplitString(dlg_strStyleNameList, '-'); id = 0 + arr[0]; return id; // -1 if invalid }" ProcessSymbols "(score, selection) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { indexSymbol = GetSymbolIndex(score, str); } else { indexSymbol = GetSymbolIndexFromList(score); } num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = ((obj.Type = 'SymbolItem') or (obj.Type = 'SystemSymbolItem') and ((indexSymbol = 0) or (obj.Index = indexSymbol))); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { n = 'obj' & num; @n = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { n = 'obj' & i; obj = @n; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" dlg_strInstructions "Type in a style name (case-sensitive) or choose one from the list. User-defined styles will not be in the list." _dlg_lstSymbol { "0-All symbols" "1-Segno" "2-Coda" "3-Serpent 1" "4-Serpent 2" "5-Repeat beat" "6-Repeat bar" "7-Repeat 2 bars" "8-Repeat 4 bars" "9-Barline" "10-Start repeat barline" "11-End repeat barline" "12-Final barline" "13-Segno" "14-Coda" "16-Do not photocopy" "17-Circle" "18-(" "19-)" "20-{" "21-}" "22-Bracket top" "23-Bracket bottom" "24-End bracket top" "25-End bracket bottom" "26-Small (" "27-System divider" "28-Common time" "29-Alla breve" "30-Lyric hyphen" "31-Small )" "32-Trill" "33-(Trill)" "34-Trill segment (internal)" "35-Arpeggio segment (internal)" "36-Inverted mordent" "37-Mordent" "38-Inverted turn" "39-Turn" "40-Reversed turn" "41-Inverted triple mordent" "42-Triple mordent" "43-Mordent 2" "44-Triple mordent 2" "45-Triple mordent 3" "46-C ornament" "48-Pedal" "49-Pedal P" "50-Pedal up" "51-Lift pedal" "52-Heel 1" "53-Heel 2" "54-Toe 1" "55-Toe 2" "64-Glockenspiel" "65-Marimba" "66-Vibraphone" "67-Xylophone" "68-Timpani" "69-Tubular bells" "70-Crotales" "71-Slide whistle" "72-Bell of cymbal" "73-Edge of cymbal" "74-Stick shot" "75-Scrape from center to edge" "76-On rim" "77-Slide brush on gong" "78-Buzz roll" "80-Snare drum" "81-Snare drum, snares off" "82-Military snare drum" "83-Bass drum" "84-Bass drum on its side" "85-Bongos" "86-Tom-tom" "87-Wood block" "88-Tambourine" "89-Timbales" "90-Slit drum" "91-Conga" "92-Log drum" "93-Temple blocks" "94-Tenor drum" "96-Crash cymbals" "97-Suspended cymbal" "98-Hi-hat" "99-Sizzle cymbal" "100-Tam-tam" "101-Gong" "102-Gong with button" "103-Triangle" "104-Sleigh bells" "105-Cow bell" "106-Almglocken" "107-Anvil" "108-Bell plate" "109-Brake drum" "110-Flexatone" "112-Maracas" "113-Cabasa" "114-Claves" "115-Guiro" "116-Ratchet" "117-Whip" "118-Lion's roar" "119-Bird whistle" "120-Siren" "121-Wind machine" "122-Thundersheet" "123-Police whistle" "124-Pistol shot" "125-Sand blocks" "126-Car horn" "127-Wind chimes (glass)" "128-Soft xylophone stick" "129-Medium xylophone stick" "130-Hard xylophone stick" "131-Wood xylophone stick" "132-Soft timpani stick" "133-Medium timpani stick" "134-Hard timpani stick" "135-Wood timpani stick" "136-Soft bass drum stick" "137-Medium bass drum stick" "138-Hard bass drum stick" "139-Double bass drum stick" "140-Soft yarn beater" "141-Medium yarn beater" "142-Hard yarn beater" "143-Percussion symbol outline" "144-Snare sticks" "145-Jazz sticks" "146-Triangle beater" "147-Brushes" "149-Guiro scraper" "150-Bow" "151-Mallet" "152-Hand" "153-Finger nails" "154-Coin" "155-Drum stick" "160-Closed / rim shot" "161-Half open" "162-Open" "163-Damp" "164-Damp 2" "165-Damp 3" "166-Damp 4" "167-Rim shot (on stem)" "168-Center" "169-Center 2" "170-Rim" "171-Rim 2" "172-Normal position" "173-Circular motion" "174-Circular motion 2" "175-Independent roll" "176-3 string frame" "177-3 string frame 2" "178-4 string frame" "179-4 stsring frame 2" "180-5 string frame" "181-5 string frame 2" "182-6 string frame" "183-6 string frame 2" "184-Stopped string" "185-Open string" "186-Silent string" "187-Guitar vibrato bar scoop" "188-Guitar vibrato bar dip" "189-Vertical line" "190-Vibrato segment (internal)" "191-Wide vibrato segment (internal)" "192-Circled 0" "193-Circled 1" "194-Circled 2" "195-Circled 3" "196-Circled 4" "197-Circled 5" "198-Circled 6" "199-Circled 7" "200-Circled 8" "201-Circled 9" "202-Guitar shake" "208-Articulation above (unused)" "209-Staccato above" "210-Staccatissimo above" "211-Wedge above" "212-Tenuto above" "213-Accent above" "214-Marcato above" "215-Open/harmonic above" "216-Closed/mute above" "217-Up-bow above" "218-Down-bow above" "219-Articulation above (unused)" "220-Long pause above" "221-Fermata (pause) above" "222-Short pause above" "223-Articulation above (unused)" "224-Articulation below (unused)" "225-Staccato below" "226-Staccatissimo below" "227-Wedge below" "228-Tenuto below" "229-Accent below" "230-Marcato below" "231-Open/harmonic below" "232-Closed/mute below" "233-Up-bow below" "234-Down-bow below" "235-Articulation below (unused)" "236-Long pause below" "237-Fermata (pause) below" "238-Short pause below" "239-Articulation below (unused)" "240-Double staccato" "241-Triple staccato" "242-Quadruple staccato" "243-Snap" "244-Snap 2" "245-Snap 3" "246-Snap 4" "247-Comma" "248-Tick" "249-Caesura" "250-Thick caesura" "251-Stress above" "252-Stress below" "253-Unstress above" "254-Unstress below" "255-Notch staccato" "256-Double flat" "257-Three-quarter flat" "258-Flat" "259-Quarter flat" "260-Natural" "261-Quarter sharp" "262-Sharp" "263-Three-quarter sharp" "264-Double sharp" "265-Natural flat" "266-Natural sharp" "267-Quarter flat 2" "268-Quarter flat 3" "269-Quarter sharp 2" "270-Three-quarter sharp 2" "271-Quarter sharp 3" "272-(Double flat)" "273-(Three-quarter flat)" "274-(Flat)" "275-(Quarter flat)" "276-(Natural)" "277-(Quarter sharp)" "278-(Sharp)" "279-(Three-quarter sharp)" "280-(Double sharp)" "281-(Natural flat)" "282-(Natural sharp)" "283-Three-quarter flat 2" "284-Three-quarter flat 3" "285-Quarter flat 4" "286-Quarter sharp 4" "287-Quarter flat 5" "288-16th note up" "289-Eighth note up" "290-Quarter note up" "291-Half note up" "292-Extra flag up (internal)" "293-Rhythm dot" "294-Grace note slash up" "295-l.v. up" "296-Eighth flag up" "297-16th flag up" "298-32nd flag up" "299-64th flag up" "300-128th flag up" "301-256th flag up" "302-512th flag up" "303-Cluster" "304-16th note down" "305-Eighth note down" "306-Quarter note down" "307-Half note down" "308-Extra flag down (internal)" "309-Tremolo" "310-Grace note slash down" "311-l.v. down" "312-Eighth flag down" "313-16th flag down" "314-32nd flag down" "315-64th flag down" "316-128th flag down" "317-256th flag down" "318-512th flag down" "320-Quarter note" "321-Half note" "322-Whole note" "323-Double whole note" "324-Square double whole note" "325-Long" "326-Cross note" "327-Circled cross note" "328-Cross note 2" "329-Circled cross note 2" "330-Diamond note" "331-Diamond whole note" "332-Quarter beat" "333-Half beat" "334-Inverted triangle quarter" "335-Inverted triangle half" "336-Bottom right corner quarter" "337-Bottom right corner half" "338-Slashed quarter note" "339-Slashed half note" "340-Slashed quarter note 2" "341-Slashed half note 2" "342-Small whole note" "343-Black diamond note" "344-Stalk quarter note up" "345-Stalk half note up" "346-Stalk quarter note down" "347-Stalk half note down" "348-Small quarter note" "349-Small half note" "350-Large quarter note" "351-Large half note" "352-Shaped quarter note 1" "353-Shaped half note 1" "354-Shaped quarter note 2" "355-Shaped half note 2" "356-Shaped quarter note 3" "357-Shaped half note 3" "358-Shaped quarter note 4 up" "359-Shaped half note 4 up" "360-Shaped quart note 4 down" "361-Shaped half note 4 down" "362-Shaped quarter note 5" "363-Shaped half note 5" "364-Shaped quarter note 6" "365-Shaped half note 6" "366-Shaped quarter note 7" "367-Shaped half note 7" "368-512th rest" "369-256th rest" "370-128th rest" "371-64th rest" "372-32nd rest" "373-16th rest" "374-Eighth rest" "375-Quarter rest" "376-Half rest" "377-Whole rest" "378-Double whole rest" "379-Triple whole rest" "380-Quadruple whole rest" "381-Quintuple whole rest" "382-Sextuple whole rest" "383-Septuple whole rest" "384-Multirest end" "385-Multirest middle" "399-Headless notehead" "400-Principal part" "401-Secondary part" "402-Start thick bracket" "403-End thick bracket" "404-Start bracket" "405-End bracket" "406-Arrow up right" "407-Arrow down right" "408-Arrow down" "409-Left half arrow down" "410-Right half arrow down" "411-White arrow down" "412-2 beats" "413-3 beats" "414-Compound 2 beats" "415-Compound 3 beats" "416-Treble clef" "417-Alto clef" "418-Tenor clef" "419-Bass clef" "420-Percussion clef" "421-Percussion clef 2" "422-6 string tab clef" "423-Treble clef up 15" "424-Treble clef up 8" "425-Treble clef down 8" "426-Treble clef (down 8)" "427-Treble clef down 8 (old)" "428-French violin clef" "429-Soprano clef" "430-Mezzo-soprano clef" "431-Tenor clef down 8" "432-Baritone C clef" "433-Bass clef up 8" "434-Bass clef down 8" "435-Bass clef up 15" "436-Baritone F clef" "437-Null clef (no symbol)" "438-4 string tab clef" "439-Tall 6 string tab clef" "440-Tall 4 string tab clef" "446-8 (for clefs)" "447-15 (for clefs)" "448-Octave" "449-(Octave)" "450-Octave up" "451-(Octave up)" "452-Octave down" "453-(Octave down)" "454-Octave down 2" "455-(Octave down 2)" "456-2 octaves" "457-(2 octaves)" "458-2 octaves up" "459-(2 octaves up)" "460-2 octaves down" "461-(2 octaves down)" "464-Middle of system" "465-End of system" "466-Middle/end of system" "467-End of page" "468-Middle system/End page" "469-End of system/page" "470-Good page break" "471-Bad page break" "472-Section end" "473-Split multirest" "474-Bad page break warning" "475-Auto system break" "476-Suppressed break" "477-Special page break" "480-Scoop" "481-Fall" "483-Closed hole" "484-Half hole" "485-Open hole" "486-Crossed stem" "487-Arrow through stem" "488-Bridge through stem" "489-Z through stem" "490-Fingernail" "491-Molto crescendo" "492-Wide molto crescendo" "496-Accordion treble coupler" "497-Accordion treble coupler" "498-Accordion treble coupler" "499-Accordion treble coupler" "500-Accordion treble coupler" "501-Accordion treble coupler" "502-Accordion treble coupler" "503-Accordion treble coupler" "504-Accordion treble coupler" "505-Accordion treble coupler" "506-Accordion treble coupler" "507-Accordion treble coupler" "508-Accordion treble coupler" "509-Accordion treble coupler" "510-Accordion treble coupler" "512-Accordion bass coupler" "513-Accordion bass blob" "514-Accordion bass coupler" "515-Accordion bass coupler" "516-Accordion bass coupler" "517-Accordion bass coupler" "518-Accordion bass coupler" "519-Accordion bass coupler" "520-Accordion bass coupler" "521-Accordion bass coupler" "522-Accordion bass coupler" "523-Accordion bass coupler" "524-Accordion bass coupler" "525-Accordion bass coupler" "526-Accordion bass coupler" "528-Martellato" "529-Martellato lift" "530-Hand martellato" "531-Muted martellato" "532-Mallet, bell suspended" "533-Mallet, bell on table" "534-Mallet lift" "535-Swing up" "536-Swing down" "537-Swing" "538-Echo" "539-Echo 2" "540-Gyro" "541-Damp 3" "544-Normal leger lines" "545-Whole note leger lines" "546-Cue note leger lines" "547-Choral divide arrow" "560-Opening parens. (2 lines)" "561-Closing parens. (2 lines)" "562-Opening parens. (3 lines)" "563-Closing parens. (3 lines)" "564-Opening bracket (2 lines)" "565-Closing bracket (2 lines)" "566-Opening bracket (3 lines)" "567-Closing bracket (3 lines)" "568-Parentheses (2 lines, 1 char)" "569-Parentheses (3 lines, 1 char)" "570-Parentheses (1 line, 2 chars)" "571-Parentheses (2 lines, 2 chars)" "572-Parentheses (3 lines, 2 chars)" "573-Brackets (2 lines, 1 char)" "574-Brackets (3 lines, 1 char)" "576-Brackets (1 line, 1 char)" "577-Brackets (2 lines, 2 chars)" "578-Brackets (3 lines, 2 chars)" "608-Mallet lift" } TrimBlanks "(strOrig) { // This removes all leading and trailing spaces from a string, and returns the stripped string if ((strOrig = '') or (strOrig = null)) { return ''; } strStrip = ''; lenOrig = Length(strOrig); strStrip1 = ''; // get leading spaces fContinue = True; i = 0; while (fContinue) { c = Substring (strOrig,i,1); if (c != ' ') { fContinue = False; } else { i = i + 1; } } strStrip1 = Substring (strOrig, i); lenStrip1 = Length(strStrip1); fContinue = True; i = lenStrip1 - 1; while (fContinue) { if (i < 0) { fContinue = False; } else { c = Substring (strStrip1, i, 1); if (c != ' ') { fContinue = False; } else { i = i - 1; } } } strStrip = Substring (strStrip1, 0, i + 1); // DoTrace('TrimBlanks string, pre-stripped string, stripped string, original length, stripped length = ' & strOrig & ', *' & strStrip1 & '*, *' & strStrip & '*, ' & lenOrig & ', ' & Length(strStrip)); return strStrip;}" ValidateChoice "(score) { retVal = False; if ((g_iType = dlg_iTiedNotes) or (g_iType = dlg_iNoteSlideProperty) or (g_iType = dlg_iNoteBracketProperty) or (g_iType = dlg_iTimeSignature) or (g_iType = dlg_iGraceNote) or (g_iType = dlg_iCueSize) or (g_iType = dlg_iHidden) or (g_iType = dlg_iColored)) { retVal = True; // no options } else { if (g_iType = dlg_iText) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { str = GetTextStyleId(score, str); } else { str = GetTextStyleIdFromList(score); } if (str != '') { retVal = True; } else { MyMessageBox(_msgInvalidTextStyle); retVal = False; } } if (g_iType = dlg_iNotePitches) { str = TrimBlanks(dlg_strStyleNameEdit); if (str = '') { str = '' % dlg_strStyleNameList; } i = utils.GetArrayIndex(_dlg_lstNotePitches, str); if (i != '-1') { retVal = True; } else { MyMessageBox(_msgInvalidNotePitch); retVal = False; } } if (g_iType = dlg_iNotehead) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { str = GetNotestyleIndex(score, str); } else { str = GetNotestyleIndexFromList(score); } if (str != '-1') { retVal = True; } else { MyMessageBox(_msgInvalidNoteheadStyle); retVal = False; } } if (g_iType = dlg_iSymbol) // special handling b3ecause of duplicate numbers { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { str = GetSymbolIndex(score, str); } else { str = GetSymbolIndexFromList(score); } retVal = (str != -1); if (str != '-1') { retVal = True; } else { MyMessageBox(_msgInvalidSymbol); retVal = False; } } if (g_iType = dlg_iSpecialBarline) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { styleId = GetBarlineIdFromList(score, str); } else { styleId = GetBarlineIdFromList(score, dlg_strStyleNameList); } if (styleId != '-1') { retVal = True; } else { MyMessageBox(_msgInvalidBarlineStyle); retVal = False; } } } //trace('ValidateChoice retVal = ' & retVal); return retVal; }" _msgInvalidTextStyle "The text style chosen is not present in this score. Please type or select a different style." _msgInvalidSymbol "The symbol name chosen is not present in this score. Please type or select a different symbol." DoDialogSetup "() { // 'Text Styles' // 'Symbols' // 'Noteheads' // 'Special Barlines' // 'Tied Notes' // 'Notes With Slide' // 'Notes In Parentheses' // 'Grace Notes' // 'Cue Size Objects' // 'Hidden Objects' // 'Time Signatures' // init these in one place so it is easier to modify them if we add new ones // these are indices into _dlg_lstTypes dlg_iColored = 0; dlg_iCueSize = 1; dlg_iGraceNote = 2; dlg_iHidden = 3; dlg_iNotePitches = 4; dlg_iNotehead = 5; dlg_iNoteSlideProperty = 6; dlg_iNoteBracketProperty = 7; dlg_iSpecialBarline = 8; dlg_iSymbol = 9; dlg_iText = 10; dlg_iTiedNotes = 11; dlg_iTimeSignature = 12; DoChangeTypeList(); }" _strTextStyleTechnique "Technique" SetDialogControlIds "() { i = 0; // not the tightest code, but only needs to be done once for each control in DisplayDialog.Controls { //trace('Dialog control: ' & i & ' title = ' & control.Title & ' value = ' & control.Value & ' method = ' & control.Method); switch(control.Value) // only using edit controls, so use value { case('dlg_strStyleNameEdit') { dlg_iControlStyleNameEdit = i; } case('dlg_strStyleNameList') { dlg_iControlStyleNameList = i; } } i = i + 1; } return True;}" ProcessTimeSignatures "(score, selection) { num = 0; numUnselected = 0; if (selection.IsPassage and (selection.IsSystemPassage = False)) { ok = MyYesNoMessageBox(_msgNeedsSystemSelection); if (ok) // ok means change to system selection { selection.SelectSystemPassage(selection.FirstBarNumber, selection.LastBarNumber, selection.FirstBarSr, selection.LastBarSr); } else { return -1; } } for each obj in selection { fDesired = (obj.Type = 'TimeSignature'); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { n = 'obj' & num; @n = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { n = 'obj' & i; obj = @n; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" _dlg_lstOther { "Filter Time Signatures" } dlg_strOther "Filter Time Signatures" _dlg_lstTextStyles { "All text styles" "1st and 2nd endings" "Auto page break warnings" "Bar numbers" "Bar numbers (parts)" "Block lyrics" "Boxed system text" "Boxed text (on blank page)" "Boxed text" "Chord diagram fingering" "Chord diagram fret" "Chord symbol" "Common symbols" "Composer" "Composer (on blank page)" "Copyright" "Dedication" "Dedication (on blank page)" "Drum set legend" "Duration at end of score" "Expression" "Figured bass" "Figured bass (extras)" "Fingering" "Footer (inside edge)" "Footer (outside edge)" "Footnote" "Function symbols" "Guitar fingering (p i m a)" "Header" "Header (after first page)" "Header (after first page, inside edge)" "Hit points" "Instrument change" "Instrument change announcement" "Instrument name (cues)" "Instrument name at top left" "Instrument names" "Lyricist" "Lyrics (chorus)" "Lyrics above staff" "Lyrics line 1" "Lyrics line 2" "Lyrics line 3" "Lyrics line 4" "Lyrics line 5" "Metric modulation" "Metronome mark" "Multirests (numbers)" "Multirests (tacet)" "Nashville chord numbers" "Note name noteheads" "Note tails" "Ornaments" "Page numbers" "Percussion instruments" "Percussion stickings" "Plain system text" "Plain text" "Plain text (on blank page)" "Plain text, centered (on blank page)" "Plain text, right (on blank page)" "Rehearsal marks" "Repeat (D.C./D.S./To Coda)" "Roman numerals" "Small text" "Special noteheads etc." "Special symbols" "Special symbols (extra)" "Subtitle" "Subtitle (on blank page)" "Tablature letters" "Tablature numbers" "Technique" "Tempo" "Time signatures" "Time signatures (huge)" "Time signatures (large)" "Time signatures (one staff only)" "Timecode" "Tiny text" "Title" "Title (on blank page)" "Tuplets" "Worksheet footer (first page, l)" "Worksheet footer (first page, r)" "Worksheet header (first page, l)" "Worksheet header (first page, r)" } _strAllNoteheads "All noteheads" _dlg_lstNoteheads { "0-Normal" "1-Cross" "2-Diamond" "3-Beat without stem" "4-Beat" "5-Cross or diamond" "6-Black & white diamond" "7-Headless" "8-Stemless" "9-Silent" "10-Small" "11-Slashed" "12-Back slashed" "13-Arrow down" "14-Arrow up" "15-Inverted triangle" "16-Shaped note 1" "17-Shaped note 2" "18-Shaped note 3" "19-Shaped note 4 (stem up)" "20-Shaped note 5" "21-Shaped note 6" "22-Shaped note 7" "23-Shaped note 4 (stem down)" "24-Cross 2" "25-Stick notation" "26-Large cross" "27-Large stemless slash" "28-Large slash with stem" "29-Cross (ornate)" "30-Ping" } ProcessNoteheads "(score, selection) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { indexNotestyle = GetNotestyleIndex(score, str); } else { indexNotestyle = GetNotestyleIndexFromList(score); } num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { if (obj.Type != 'NoteRest') // not desired object { fDesired = False; if (dlg_fDoDeselect) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; } } else // NoteRest { for each n in obj { if (n.Selected) // need to handle separately from noterest selection { fDesired = (n.NoteStyle = indexNotestyle); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = n; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } } } } //trace('ProcessNoteheads indexNotestyle, num = ' & indexNotestyle & ', ' & num); if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" GetNotestyleIndex "(score, str) { strTrim = TrimBlanks(str); if (utils.IsNumeric(strTrim, True)) // needs 5.2 version { return strTrim; } id = score.NoteStyleIndex(strTrim); return id; // -1 if invalid }" GetNotestyleIndexFromList "(score) { arr = SplitString(dlg_strStyleNameList, '-'); id = 0 + arr[0]; return id; // -1 if invalid }" _dlg_lstTypes { "Colored Objects" "Cue Size Objects" "Grace Notes" "Hidden Objects (not ~)" "Note Pitch (chromatic)" "Noteheads" "Notes With Slide" "Notes In Parentheses" "Special Barlines" "Symbols" "Text Styles" "Tied Notes" "Time Signatures" } DoChangeTypeList "() { i = utils.GetArrayIndex(_dlg_lstTypes, dlg_strType); //trace('DCSL symbol list i = ' & i); if (i < 0) { return False; // no change } g_iType = i; Sibelius.EnableNthControl((dlg_iControlStyleNameEdit), True); Sibelius.EnableNthControl((dlg_iControlStyleNameList), True); dlg_strInstructions = '' & _strInstructionsStyle; switch (i) { case (dlg_iText) //text { dlg_lstStyles = _dlg_lstTextStyles; dlg_strStyleNameList = '' & _strTextStyleTechnique; DoChangeStyleList(); } case(dlg_iSymbol) { dlg_lstStyles = _dlg_lstSymbol; dlg_strStyleNameList = '' & dlg_lstStyles[0]; dlg_strInstructions = '' & _strInstructionsStyle2; DoChangeStyleList(); } case(dlg_iSpecialBarline) { dlg_lstStyles = _dlg_lstBarline; dlg_strStyleNameList = '' & _strBarlineNormal; DoChangeStyleList(); } case(dlg_iNotehead) // notehead { dlg_lstStyles = _dlg_lstNoteheads; dlg_strStyleNameList = '' & dlg_lstStyles[0]; dlg_strInstructions = '' & _strInstructionsStyle2; DoChangeStyleList(); } case(dlg_iNotePitches) // note Pitches { //trace('DCTL note pitches'); dlg_lstStyles = _dlg_lstNotePitches; dlg_strStyleNameList = '' & dlg_lstStyles[g_iNotePitchLast]; dlg_strInstructions = '' & _strInstructionsPitch; DoChangeStyleList(); } default // do not use other controls { //trace('DCTL disable controls'); Sibelius.EnableNthControl((dlg_iControlStyleNameEdit), False); Sibelius.EnableNthControl((dlg_iControlStyleNameList), False); dlg_strInstructions = '' & _strInstructionsOther; } } Sibelius.RefreshDialog(); return True;}" dlg_iControlStyleNameEdit "3" dlg_iControlStyleNameList "4" dlg_strType "Text Styles" _strInstructionsStyle "Type in a style name (case-sensitive) or choose one from the list. User-defined styles will not be in the list." dlg_lstStyles { "All text styles" "1st and 2nd endings" "Auto page break warnings" "Bar numbers" "Bar numbers (parts)" "Block lyrics" "Boxed system text" "Boxed text (on blank page)" "Boxed text" "Chord diagram fingering" "Chord diagram fret" "Chord symbol" "Common symbols" "Composer" "Composer (on blank page)" "Copyright" "Dedication" "Dedication (on blank page)" "Drum set legend" "Duration at end of score" "Expression" "Figured bass" "Figured bass (extras)" "Fingering" "Footer (inside edge)" "Footer (outside edge)" "Footnote" "Function symbols" "Guitar fingering (p i m a)" "Header" "Header (after first page)" "Header (after first page, inside edge)" "Hit points" "Instrument change" "Instrument change announcement" "Instrument name (cues)" "Instrument name at top left" "Instrument names" "Lyricist" "Lyrics (chorus)" "Lyrics above staff" "Lyrics line 1" "Lyrics line 2" "Lyrics line 3" "Lyrics line 4" "Lyrics line 5" "Metric modulation" "Metronome mark" "Multirests (numbers)" "Multirests (tacet)" "Nashville chord numbers" "Note name noteheads" "Note tails" "Ornaments" "Page numbers" "Percussion instruments" "Percussion stickings" "Plain system text" "Plain text" "Plain text (on blank page)" "Plain text, centered (on blank page)" "Plain text, right (on blank page)" "Rehearsal marks" "Repeat (D.C./D.S./To Coda)" "Roman numerals" "Small text" "Special noteheads etc." "Special symbols" "Special symbols (extra)" "Subtitle" "Subtitle (on blank page)" "Tablature letters" "Tablature numbers" "Technique" "Tempo" "Time signatures" "Time signatures (huge)" "Time signatures (large)" "Time signatures (one staff only)" "Timecode" "Tiny text" "Title" "Title (on blank page)" "Tuplets" "Worksheet footer (first page, l)" "Worksheet footer (first page, r)" "Worksheet header (first page, l)" "Worksheet header (first page, r)" } dlg_iCueSize "1" dlg_iGraceNote "2" dlg_iHidden "3" dlg_iNotehead "5" dlg_iNoteSlideProperty "6" dlg_iSpecialBarline "8" dlg_iSymbol "9" dlg_iText "10" dlg_iTiedNotes "11" dlg_iTimeSignature "12" g_iType "10" _strInstructionsOther "Choose Select or Deselect to continue." dlg_strStyleNameList "Technique" DoChangeStyleList "() { if ((g_iType = dlg_iText) or (g_iType = dlg_iSpecialBarline)) { dlg_strStyleNameEdit = '' & dlg_strStyleNameList; } else { if (g_iType = dlg_iSymbol) { i = utils.GetArrayIndex(dlg_lstStyles, dlg_strStyleNameList); //trace('DCSL symbol list i = ' & i); if (i < 0) { return False; // no change } arr = SplitString(dlg_strStyleNameList, '-'); dlg_strStyleNameEdit = TrimBlanks('' & arr[1]); // the name field } else { if (g_iType = dlg_iNotePitches) { dlg_strStyleNameEdit = '' & dlg_strStyleNameList; } else // noteheads { // scores from Sib 1 have different name/number correspondence // than later scores, so it is better to just keep with the number // unless the user specifies a name. Otherwise we get the wrong notehead. // due to issues with leaving the edit blank (required us to add a space), we will fill // the edit with the number, not the name, and change the code to handle either a number or a name i = utils.GetArrayIndex(dlg_lstStyles, dlg_strStyleNameList); //trace('DCSL symbol list i = ' & i); if (i < 0) { return False; // no change } arr = SplitString(dlg_strStyleNameList, '-'); dlg_strStyleNameEdit = TrimBlanks('' & arr[0]); // the number field } } } Sibelius.RefreshDialog(); return True;}" dlg_strStyleNameEdit "Technique" _msgInvalidNoteheadStyle "The notehead style chosen is not present in this score. Please type or select a different style." _msgNumProcessed "Number of objects processed of type: " ProcessGraceNotes "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = ((obj.Type = 'NoteRest') and (obj.GraceNote)); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" _strBarlineNormal "Normal" _dlg_lstBarline { "All special barlines" "StartRepeat" "EndRepeat" "Dashed" "Double" "Final" "Invisible" "BetweenStaves" "Normal" "Tick" "Short" } dlg_fTraceLocation "false" ProcessSpecialBarlines "(score, selection) { str = TrimBlanks(dlg_strStyleNameEdit); if (str != '') { styleId = GetBarlineIdFromList(score, str); } else { styleId = GetBarlineIdFromList(score, dlg_strStyleNameList); } num = 0; numUnselected = 0; if (selection.IsPassage and (selection.IsSystemPassage = False)) { ok = MyYesNoMessageBox(_msgNeedsSystemSelection); if (ok) // ok means change to system selection { selection.SelectSystemPassage(selection.FirstBarNumber, selection.LastBarNumber, selection.FirstBarSr, selection.LastBarSr); } else { return -1; } } for each obj in selection { fDesired = ((obj.Type = 'SpecialBarline') and ((styleId = _strAllSpecialBarlines) or (obj.BarlineInternalType = styleId))); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { n = 'obj' & num; @n = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { n = 'obj' & i; obj = @n; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" DoTraceObj "(score, obj) { if (dlg_fTraceLocation = False) { return False; } //trace('DoTraceObj type = ' & obj.Type); bar = obj.ParentBar; staff = bar.ParentStaff; if (staff.IsSystemStaff) { strStaff = _strSystemStaff; } else { strStaff = staff.StaffNum & ' - ' & staff.FullInstrumentName; } strExtra = ''; if (obj.Type = 'SpecialBarline') { strExtra = ' - ' & obj.BarlineType; } if ((obj.Type = 'Text') or (obj.Type = 'SystemTextItem') or (obj.Type = 'LyricItem')) { strExtra = ' - ' & obj.StyleAsText; } if (obj.Type = 'Note') { strExtra = ' - ' & obj.NoteStyleName; } if ((obj.Type = 'SymbolItem') or (obj.Type = 'SystemSymbolItem')) { strExtra = ' - ' & obj.Name; } strPos = PositionAsBeat(score, bar, obj.Position); trace(_strTraceType & ': ' & obj.Type & strExtra & _strTraceBar & ': ' & bar.ExternalBarNumberString & _strTracePosition & ': ' & strPos & _strTraceStaff & ': ' & strStaff); return True;}" PositionAsBeat "(score, b, pos) { // returns string representing position as beat (1-based) sysstaff = score.SystemStaff; ts = sysstaff.CurrentTimeSignature(b.BarNumber); // simple or compound meter? fCompound = False; if (ts.Numerator > 3 and ((ts.Numerator % 3) = 0)) { fCompound = True; } if (fCompound = False) // simple or imperfect { durBeat = 0 + (Whole / ts.Denominator); // duration of beat } else { durBeat = 0 + (DottedBreve / ts.Denominator); // (3 * whole note)/ Denom } strPosAsBeat = 1 + ((1.0 * pos) / durBeat); return strPosAsBeat; }" _strSystemStaff "0 - System Staff" _strTraceLabel "Object, bar, position, staff = " _strAllSpecialBarlines "All special barlines" GetBarlineIdFromList "(score, str) { if (str = _strAllSpecialBarlines) { return '' & _strAllSpecialBarlines; } id = utils.GetArrayIndex(_dlg_lstBarline, str) - 1; return id; // -1 if invalid }" _strTraceType "Object type" _strTraceBar " bar" _strTracePosition " position" _strTraceStaff " staff" ProcessNoteSlideProperties "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { if (obj.Type != 'NoteRest') // not desired object { fDesired = False; if (dlg_fDoDeselect) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; } } else // NoteRest { for each n in obj { if (n.Selected) { fDesired = n.Slide; if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = n; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" g_strBlank _strInstructionsStyle2 "Type in a style name (case-sensitive) or number, or choose one from the list. User-defined styles will not be in the list." zg_Sib52Version "5200" IsSelectionEmpty "(selection) { for each obj in selection { return False; } return True;}" _msgNeedsSelection "Please select something and run the plugin again." ProcessCueSize "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = (obj.CueSize); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" ProcessHidden "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = (obj.Hidden); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" dlg_fDoSelect "true" dlg_fDoDeselect "false" DoSelect "() { dlg_fDoSelect = True; dlg_fDoDeselect = False;}" DoDeselect "() { dlg_fDoSelect = False; dlg_fDoDeselect = True;}" _msgNeedsSystemSelection "This object requires a system (double purple box) selection, which selects all staves in the system. Choose Yes to change the selection to a system selection, or No to cancel the plugin." MyYesNoMessageBox "(string) { ok = Sibelius.YesNoMessageBox(_PluginMenuName & ': ' & string); return ok;}" _msgNoneProcessed ". Original selection is unchanged." _msgStaffTextOnly "Please note that only staff text will be filtered. If you want to filter for system text as well, you must make a system (double purple box) selection." IsSystemText "(styleId) { lenPrefix = Length(g_strPrefixSystemText); str = Substring(styleId, 0 ,lenPrefix); return (str = g_strPrefixSystemText);}" g_strPrefixSystemText "text.system" dlg_iNotePitches "4" _dlg_lstNotePitches { "Cbb" "Cb" "C" "C#" "Cx" "Dbb" "Db" "D" "D#" "Dx" "Ebb" "Eb" "E" "E#" "Ex" "Fbb" "Fb" "F" "F#" "Fx" "Gbb" "Gb" "G" "G#" "Gx" "Abb" "Ab" "A" "A#" "Ax" "Bbb" "Bb" "B" "B#" "Bx" } _strInstructionsPitch "Type in a pitch name (case-sensitive) or choose one from the list. Quartertones will not be handled correctly." _msgInvalidNotePitch "The note pitch chosen is not present in the list. Please type or select a different pitch." ProcessNotePitches "(score, selection) { str = TrimBlanks(dlg_strStyleNameEdit); if (str = '') { str = '' & dlg_strStyleNameList; } arrPitches = CreateArray(); i = utils.GetArrayIndex(_dlg_lstNotePitches, str); // we validated this so we should never get -1 here MapINameToChromDiat(i, arrPitches); pitchNormDesiredChrom = 0 + arrPitches[0]; pitchNormDesiredDiat = 0 + arrPitches[1]; g_iNotePitchLast = i; num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { if (obj.Type != 'NoteRest') // not desired object { fDesired = False; if (dlg_fDoDeselect) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; } } else // NoteRest { for each n in obj { if (n.Selected) // need to handle separately from noterest selection { pitchChrom = n.Pitch % 12; pitchDiat = n.DiatonicPitch % 7; fDesired = (pitchChrom = pitchNormDesiredChrom) and (pitchDiat = pitchNormDesiredDiat); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = n; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } } } } //trace('ProcessNoteheads indexNotestyle, num = ' & indexNotestyle & ', ' & num); if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" MapINameToChromDiat "(iName, arrPitches) { chrom = 0 + g_lstDiatChromIString[iName]; diat = RoundDown (iName / 5); arrPitches[0] = chrom; arrPitches[1] = diat; return True; }" g_lstDiatChromIString { "10" "11" "0" "1" "2" "0" "1" "2" "3" "4" "2" "3" "4" "5" "6" "3" "4" "5" "6" "7" "5" "6" "7" "8" "9" "7" "8" "9" "10" "11" "9" "10" "11" "0" "1" } g_iNotePitchLast "2" dlg_fShowResults "true" dlg_iColored "0" ProcessColored "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { fDesired = (obj.Color != 0); if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" ProcessNoteBracketProperties "(score, selection) { num = 0; numUnselected = 0; for each obj in selection // collect selected items in list so we can clear selection { if (obj.Type != 'NoteRest') // not desired object { fDesired = False; if (dlg_fDoDeselect) { name = 'obj' & num; @name = obj; num = num + 1; } else { numUnselected = numUnselected + 1; } } else // NoteRest { for each n in obj { if (n.Selected) { fDesired = n.Bracketed; if ((dlg_fDoSelect and fDesired) or (dlg_fDoDeselect and (not fDesired))) { name = 'obj' & num; @name = n; num = num + 1; } else { numUnselected = numUnselected + 1; if (fDesired and dlg_fDoDeselect) { DoTraceObj(score, obj); } } } } } } if ((num > 0) or dlg_fDoDeselect) { selection.Clear(); } for i = 0 to num { name = 'obj' & i; obj = @name; obj.Select(); if (dlg_fDoSelect) { DoTraceObj(score, obj); } } if (dlg_fDoSelect) { return num; } return numUnselected; }" dlg_iNoteBracketProperty "7" }