Anyone interested in trying out my code, here is my branch on GitHub:

https://github.com/MarcSabatella/MuseScore/tree/12179-handle-unrecognized-chords

I have attached the files you will need to use the new "wysiwyg" mode. Stick the two MSS files in your MuseScoreDevelopment/Styles directory, and the two XML files in the styles directory within your installation. To turn on the wysiwyg mode for any given score after creating/opening it, go to Style -> Load Style and select one of the two MSS files. wysiwyg.mss lets you use whatever font you have set up for Chordname in your text styles. wysiwyg_muse automatically uses MuseJazz. The fancy superscripting and so forth is only available with wysiwyg_muse, although a sufficiently motivated person could probably tweak the other version to do at least a little of that.

Here's an updated screenshot showing the results you can expect:

https://docs.google.com/file/d/0B2tbTbSnPCzbc3JmQ1JzSTdyOG8/edit

If you don't load one of these two MSS files, you'll still get the thing where you can type anything you want (within reason!) and it is automatically converted into the form used by your selected chord description file. That much was merged into the master a week or so ago.

Marc

<?xml version="1.0" encoding="UTF-8"?>

<!--
=====================================================================
    MuseScore
    Linux Music Score Editor
    $Id: mscore.cpp 1850 2009-05-25 07:44:35Z wschweer $

    Copyright (C) 2009 Werner Schweer and others

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

=====================================================================
    This file describes how chord symbols are parsed and rendered
    in MuseScore
=====================================================================
-->

<museScore version="1.11">

<!--
      Part I: font list
            associate symbols (code points) with names
      If no font family is given or font family is "default" then the
      configured text style font family is used.
-->

  <font>
    <sym code="0x0394" name="triangle"/>
    <sym code="0x03bf" name="circle"/>
    <sym code="0x00f8" name="oslash"/>
    <sym code="0x266f" name="#"/>
    <sym code="0x266d" name="b"/>
  </font>

<!--
      Part II: token list
            define how the various tokens within a chord symbol should be rendered

         name     ordinary text name of token
                  multiple names may be listed to allow mseveral different tokens to render the same way
         render   this is a script that contains render commands
                  see Part III for details
-->

  <token>
    <name>t</name>
    <name>^</name>
    <render>triangle</render>
  </token>

  <token>
    <name>0</name>
    <render>oslash</render>
  </token>

  <renderRoot>:n m:0:-1 :a m:.5:1</renderRoot>
  <renderBase>m:-0.2:1 / m:0.2:1 :n :a m:0:-2</renderBase>

<!--
      Part III: chord list
            declare a list of chords to be explicitly recognized
            any chord recognized as matching something on this list
            will be rendered according to the definition in this list,
            as opposed to being rendered directly from the chord symbol as typed
            thus, it provides the ability to define overrides for rendering specific chord symbols

         id       internal chord number
                  may be omitted if you don't need compatibility with older chord description files
         name     ordinary text name of chord
                  multiple names can be used to allow several different representations of the same chord
                  but there is no need to list the most common variations like "CMaj7" versus "Cma7"
                  the need for multiple names comes in if you want
                  significantly different ways of entering the same chord
                  so listing "mi7b5" and "07" as aliases for the same (half-diminished) chord
                  would allow them to be recognized as equivalent
         render   this is a script which contains render commands
                  commands:
                        xxx         draw symbol name xxx
                        m:x:y       add x:y (point) to current position
                        :push
                        :pop
                        :n          root or base note
                        :a          accidental
                  if omitted, chord will be rendered directly from the first name listed above
                  so you can get all major seventh chords to render as "ma7" by creating a chord definition
                  with no id or render tag, and just the single name "ma7"
-->

  </museScore>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE museScore [

<!--
=====================================================================
    MuseScore
    Linux Music Score Editor
    $Id: mscore.cpp 1850 2009-05-25 07:44:35Z wschweer $

    Copyright (C) 2009 Werner Schweer and others

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License version 2.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

=====================================================================
    This file describes how chord symbols are parsed and rendered
    in MuseScore
=====================================================================
-->

<!-- MuseJazz extensions are already superscripted; this is how much to move them back down -->
  <!ENTITY ext "2">
<!-- MuseJazz modifier digits are already superscripted; this is how much to move everything else up to match -->
  <!ENTITY mod "4.5">
<!-- this is additional superscripting to apply to modifier digits -->
  <!ENTITY modn "1">

  ]>

<museScore version="1.24">

<!--
      Part I: font list
            associate symbols (code points) with names
      If no font family is given or font family is "default" then the
      configured text style font family is used.
-->

  <font family="MuseJazz">

    <sym code="0xe180" name="ma"/>
    <sym code="0xe181" name="mi"/>
    <sym code="0xe182" name="s11"/>
    <sym code="0xe183" name="s13"/>
    <sym code="0xe184" name="dim"/>
    <sym code="0xe185" name="sus"/>
    <sym code="0xe186" name="+"/>
    <sym code="0xe187" name="degree"/>
    <sym code="0xe188" name="sb"/>
    <sym code="0xe189" name="s#"/>
    <sym code="0xe18a" name="triangle"/>
    <sym code="0xe18b" name="sadd"/>
    <sym code="0xe18c" name="sadd11"/>
    <sym code="0xe18d" name="sus4"/>
    <sym code="0xe18e" name="circle"/>
    <sym code="0xe18f" name="oslash"/>

    <sym code="0xe190" name="s0"/>
    <sym code="0xe191" name="s1"/>
    <sym code="0xe192" name="s2"/>
    <sym code="0xe193" name="s3"/>
    <sym code="0xe194" name="s4"/>
    <sym code="0xe195" name="s5"/>
    <sym code="0xe196" name="s6"/>
    <sym code="0xe197" name="s7"/>
    <sym code="0xe198" name="s8"/>
    <sym code="0xe199" name="s9"/>

    <sym code="0x266d" name="b"/>
    <sym code="0x266e" name="natural"/>
    <sym code="0x266f" name="#"/>

    </font>

  <font family="MuseJazz">
    <mag>0.85</mag>

    <sym code="0x28" name="("/>
    <sym code="0x29" name=")"/>

    <sym code="0x4d" name="M"/>

  </font>

  <font family="MuseJazz">
    <mag>1.3</mag>

    <sym code="0xe190" name="e0"/>
    <sym code="0xe191" name="e1"/>
    <sym code="0xe192" name="e2"/>
    <sym code="0xe193" name="e3"/>
    <sym code="0xe194" name="e4"/>
    <sym code="0xe195" name="e5"/>
    <sym code="0xe196" name="e6"/>
    <sym code="0xe197" name="e7"/>
    <sym code="0xe198" name="e8"/>
    <sym code="0xe199" name="e9"/>

    <sym code="0xe18b" name="add"/>
    <sym code="0xe18c" name="add11"/>

    </font>

  <font family="MuseJazz">
    <mag>0.75</mag>

    <sym code="0x28" name="s("/>
    <sym code="0x29" name="s)"/>
    <sym code="0x2c" name="s,"/>

    <sym code="0xe18a" name="striangle"/>

    <sym code="0x61" name="a"/>
    <sym code="0x62" name="letterb"/>
    <sym code="0x63" name="c"/>
    <sym code="0x64" name="d"/>
    <sym code="0x65" name="e"/>
    <sym code="0x66" name="f"/>
    <sym code="0x67" name="g"/>
    <sym code="0x68" name="h"/>
    <sym code="0x69" name="i"/>
    <sym code="0x6a" name="j"/>
    <sym code="0x6b" name="k"/>
    <sym code="0x6c" name="l"/>
    <sym code="0x6d" name="m"/>
    <sym code="0x6e" name="n"/>
    <sym code="0x6f" name="o"/>
    <sym code="0x70" name="p"/>
    <sym code="0x71" name="q"/>
    <sym code="0x72" name="r"/>
    <sym code="0x73" name="s"/>
    <sym code="0x74" name="t"/>
    <sym code="0x75" name="u"/>
    <sym code="0x76" name="v"/>
    <sym code="0x77" name="w"/>
    <sym code="0x78" name="x"/>
    <sym code="0x79" name="y"/>
    <sym code="0x7a" name="z"/>

    </font>

<!--
      Part II: token list
            define how the various tokens within a chord symbol should be rendered

         name     ordinary text name of token
                  multiple names may be listed to allow mseveral different tokens to render the same way
         render   this is a script that contains render commands
                  see Part III for details
-->

  <token>
    <name>t</name>
    <name>^</name>
    <render>triangle</render>
  </token>

  <token class="modifier">
    <name>t</name>
    <name>^</name>
    <render>m:0:-&mod; striangle m:0:&mod;</render>
  </token>

  <token>
    <name>Ma</name>
    <render>M a</render>
  </token>

  <token>
    <name>Maj</name>
    <render>M a j</render>
  </token>

  <token>
    <name>maj</name>
    <render>m a j</render>
  </token>

  <token class="modifier">
    <name>M</name>
    <render>m:0:-&mod; M m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>Ma</name>
    <render>m:0:-&mod; M a m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>ma</name>
    <render>m:0:-&mod; ma m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>Maj</name>
    <render>m:0:-&mod; M a j m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>maj</name>
    <render>m:0:-&mod; m a j m:0:&mod;</render>
  </token>

  <token>
    <name>min</name>
    <render>m i n</render>
  </token>

  <token>
    <name>dim</name>
    <render>d i m</render>
  </token>

  <token>
    <name>o</name>
    <render>degree</render>
  </token>

  <token>
    <name>0</name>
    <render>m:0:-4 oslash m:0:4</render>
  </token>

  <token>
    <name>aug</name>
    <render>a u g</render>
  </token>

  <token>
    <name>69</name>
    <render>m:1:-2 s6 m:-4:7 s9 m:0:-5</render>
  </token>

  <token class="quality">
    <name>add</name>
    <render>m:0:1.5 sadd m:0:-1.5</render>
  </token>

  <token class="modifier">
    <name>add</name>
    <render>m:0:-0.5 sadd m:0:0.5</render>
  </token>

  <token class="modifier">
    <name>alt</name>
    <render>m:-1:0 a l t</render>
  </token>

  <token class="modifier">
    <name>no</name>
    <render>m:0:-&mod; n o m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>omit</name>
    <render>m:0:-&mod; o m i t m:0:&mod;</render>
  </token>

  <token class="extension">
    <name>(</name>
    <render>m:1:-&ext; m:0:-2 ( m:0:2 m:-0:&ext;</render>
  </token>

  <token class="extension">
    <name>)</name>
    <render>m:0:-&ext; m:0:-2 ) m:0:2 m:0:&ext;</render>
  </token>

  <token class="modifier">
    <name>(</name>
    <render>m:1:-&mod; s( m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>)</name>
    <render>m:0:-&mod; s) m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>,</name>
    <render>m:0:-&mod; s, m:0:&mod;</render>
  </token>

  <token class="modifier">
    <name>b</name>
    <render>sb</render>
  </token>

  <token class="modifier">
    <name>#</name>
    <render>s#</render>
  </token>

  <token class="extension">
    <name>0</name>
    <render>m:0:&ext; e0 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>1</name>
    <render>m:0:&ext; e1 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>2</name>
    <render>m:0:&ext; e2 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>3</name>
    <render>m:0:&ext; e3 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>4</name>
    <render>m:0:&ext; e4 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>5</name>
    <render>m:0:&ext; e5 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>6</name>
    <render>m:0:&ext; e6 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>7</name>
    <render>m:0:&ext; e7 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>8</name>
    <render>m:0:&ext; e8 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>9</name>
    <render>m:0:&ext; e9 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>10</name>
    <render>m:0:&ext; e1 e0 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>11</name>
    <render>m:0:&ext; e1 e1 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>12</name>
    <render>m:0:&ext; e1 e2 m:0:-&ext;</render>
  </token>

  <token class="extension">
    <name>13</name>
    <render>m:0:&ext; e1 e3 m:0:-&ext;</render>
  </token>

  <token class="modifier">
    <name>0</name>
    <render>m:0:-&modn; s0 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>1</name>
    <render>m:0:-&modn; s1m:0:&modn; </render>
  </token>

  <token class="modifier">
    <name>2</name>
    <render>m:0:-&modn; s2 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>3</name>
    <render>m:0:-&modn; s3 m:0:&modn;</render>
  </token>
<!-- kludge: 4 used with sus mostly, so lower it accordingly -->
  <token class="modifier">
    <name>4</name>
    <render>m:0:0 s4 m:0:0</render>
  </token>

  <token class="modifier">
    <name>5</name>
    <render>m:0:-&modn; s5 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>6</name>
    <render>m:0:-&modn; s6 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>7</name>
    <render>m:0:-&modn; s7 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>8</name>
    <render>m:0:-&modn; s8 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>9</name>
    <render>m:0:-&modn; s9 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>10</name>
    <render>m:0:-&modn; s1 s0 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>11</name>
    <render>m:0:-&modn; s1 s1 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>12</name>
    <render>m:0:-&modn; s1 s2 m:0:&modn;</render>
  </token>

  <token class="modifier">
    <name>13</name>
    <render>m:0:-&modn; s1 s3 m:0:&modn;</render>
  </token>

  <renderRoot>:n :a </renderRoot>
  <renderBase>/ m:0:1 :n :a m:0:-1</renderBase>

<!--
      Part III: chord list
            declare a list of chords to be explicitly recognized
            any chord recognized as matching something on this list
            will be rendered according to the definition in this list,
            as opposed to being rendered directly from the chord symbol as typed
            thus, it provides the ability to define overrides for rendering specific chord symbols

         id       internal chord number
                  may be omitted if you don't need compatibility with older chord description files
         name     ordinary text name of chord
                  multiple names can be used to allow several different representations of the same chord
                  but there is no need to list the most common variations like "CMaj7" versus "Cma7"
                  the need for multiple names comes in if you want
                  significantly different ways of entering the same chord
                  so listing "mi7b5" and "07" as aliases for the same (half-diminished) chord
                  would allow them to be recognized as equivalent
         render   this is a script which contains render commands
                  commands:
                        xxx         draw symbol name xxx
                        m:x:y       add x:y (point) to current position
                        :push
                        :pop
                        :n          root or base note
                        :a          accidental
                  if omitted, chord will be rendered directly from the first name listed above
                  so you can get all major seventh chords to render as "ma7" by creating a chord definition
                  with no id or render tag, and just the single name "ma7"
-->

  </museScore>
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="1.24">
  <Style>
    <chordsXmlFile>0</chordsXmlFile>
    <chordDescriptionFile>wysiwyg.xml</chordDescriptionFile>
    </Style>
  </museScore>
<?xml version="1.0" encoding="UTF-8"?>
<museScore version="1.24">
  <Style>
    <chordsXmlFile>0</chordsXmlFile>
    <chordDescriptionFile>wysiwyg_muse.xml</chordDescriptionFile>
    <TextStyle>
      <halign>left</halign>
      <valign>baseline</valign>
      <offsetType>spatium</offsetType>
      <name>Chordname</name>
      <family>MuseJazz</family>
      <size>15</size>
      <sizeIsSpatiumDependent>1</sizeIsSpatiumDependent>
    </TextStyle>
  </Style>
</museScore>
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to