Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Dev mailing list
LGTM


https://codereview.appspot.com/547610043/diff/567190043/scm/define-note-names.scm
File scm/define-note-names.scm (right):

https://codereview.appspot.com/547610043/diff/567190043/scm/define-note-names.scm#newcode302
scm/define-note-names.scm:302: (heh . ,(ly:make-pitch -1 6 SEMI-FLAT))
What about providing an alias for the old name 'beh' for backward
compatibility?

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

David Kastrup
Reviewers: lemzwerg,

Message:
On 2020/02/09 22:08:11, lemzwerg wrote:
> LGTM
>
>
https://codereview.appspot.com/547610043/diff/567190043/scm/define-note-names.scm
> File scm/define-note-names.scm (right):
>
>
https://codereview.appspot.com/547610043/diff/567190043/scm/define-note-names.scm#newcode302
> scm/define-note-names.scm:302: (heh . ,(ly:make-pitch -1 6 SEMI-FLAT))
> What about providing an alias for the old name 'beh' for backward
compatibility?

I'd rather not since it so glaringly wrong.  All other names of kind
"-eh" are _lowered_ by a quarternote, but this one is raised.  Even if
you wanted to start it off b, it would have to be called bih (assuming
quarternote enharmonicity).

Description:
Fix and align musicxml and input language "deutsch"

Has commits:

In \language "deutsch" use b only to replace hes

The quartertone names should all be derived from h instead of b since
beh was being used inconsistently.


Fix deutsch language of musicxml2py

Use b only for hes and nothing else.  Also use asas and asah instead
of ases and aseh.

Please review this at https://codereview.appspot.com/547610043/

Affected files (+5, -3 lines):
  M python/musicexp.py
  M scm/define-note-names.scm


Index: python/musicexp.py
diff --git a/python/musicexp.py b/python/musicexp.py
index c8ff05288deb84f3c39924e78fd92295efff20d7..6daf583f0d834e29ae913afa521da7b0b6e081ce 100644
--- a/python/musicexp.py
+++ b/python/musicexp.py
@@ -321,11 +321,13 @@ def pitch_nederlands (pitch):
 
 def pitch_english (pitch):
     str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'b'], ['f', 'qf', 'qs', 's'])
-    return str.replace ('aes', 'as').replace ('ees', 'es')
+    return str
 
 def pitch_deutsch (pitch):
     str = pitch_generic (pitch, ['c', 'd', 'e', 'f', 'g', 'a', 'h'], ['es', 'eh', 'ih', 'is'])
-    return str.replace ('hes', 'b').replace ('aes', 'as').replace ('ees', 'es')
+    if str == 'hes':
+        return 'b'
+    return str.replace ('aes', 'as').replace ('ase', 'asa').replace ('ees', 'es')
 
 def pitch_norsk (pitch):
     return pitch_deutsch (pitch)
Index: scm/define-note-names.scm
diff --git a/scm/define-note-names.scm b/scm/define-note-names.scm
index 461b78b939cade3a69cccaf14cfb21fa74c2e20a..16ecd72489b85addb582c84ae5199f2692f598e7 100644
--- a/scm/define-note-names.scm
+++ b/scm/define-note-names.scm
@@ -299,7 +299,7 @@
                 (heses . ,(ly:make-pitch -1 6 DOUBLE-FLAT))
                 (heseh . ,(ly:make-pitch -1 6 THREE-Q-FLAT))
                 (b . ,(ly:make-pitch -1 6 FLAT))
-                (beh . ,(ly:make-pitch -1 6 SEMI-FLAT))
+                (heh . ,(ly:make-pitch -1 6 SEMI-FLAT))
                 (h . ,(ly:make-pitch -1 6 NATURAL))
                 (hih . ,(ly:make-pitch -1 6 SEMI-SHARP))
                 (his . ,(ly:make-pitch -1 6 SHARP))



Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Dev mailing list
In reply to this post by Dev mailing list
> > What about providing an alias for the old name 'beh'
> for backward compatibility?
>
> I'd rather not since it so glaringly wrong.  [...]

OK, but then we need either a NEWS entry or a convert-ly rule (or both)
IMHO.

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

David Kastrup
In reply to this post by Dev mailing list
On 2020/02/09 22:27:55, lemzwerg wrote:
> > > What about providing an alias for the old name 'beh'
> > for backward compatibility?
> >
> > I'd rather not since it so glaringly wrong.  [...]
>
> OK, but then we need either a NEWS entry or a convert-ly rule (or
both) IMHO.

git log -S '\<beh\>' --pickaxe-regex -- Documentation

does not show any documented German usage.  Language-specific conversion
rules are pretty heavy-handed (basically, a file needs to contain
\language "deutsch" but no other \language to have them apply, and the
string "beh" is also a common element of words like "behalten" so one
needs to prune carefully).  I am comparatively leery assuming that any
preexisting detected use that isn't a false positive in the first place
has worked as intended.  But on the other hand, there was no other way
to enter heh, and it's been around like this for a long time.  I'd
rather have this done proper in 2.20.

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Torsten Hämmerle
In reply to this post by Dev mailing list
We still have issues with English THREE-Q-* pitches (never worked,
though).

Please see my comment in musicexp.py

Torsten


https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py
File python/musicexp.py (right):

https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py#newcode324
python/musicexp.py:324: return str
does not work for quartertones yet: THREE-Q-FLAT will come out as -fqf,
but it should be -tqf (like "three quarter flat").

fqf, (F SEMI-FLAT), however, must remain fqf, etc.
So, a substring-recplacement of fqf will not generally work.
It's a mess...

The same holds true for -fqs (THREE-Q-SHARP).

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Torsten Hämmerle
In reply to this post by Dev mailing list
Proposed solution for English
(I know that this issue is about German only, but as English has been
touched, too, by removing a pointless replace statement).



https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py
File python/musicexp.py (right):

https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py#newcode324
python/musicexp.py:324: return str
Proposal:
keep 1st character and replace 'fq' by 'tq' in the suffix:

  return str[:1] + str[1:].replace ('fq', 'tq')

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

David Kastrup
In reply to this post by Dev mailing list

https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py
File python/musicexp.py (right):

https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py#newcode324
python/musicexp.py:324: return str
On 2020/02/11 20:39:14, Be-3 wrote:
> Proposal:
> keep 1st character and replace 'fq' by 'tq' in the suffix:
>
>   return str[:1] + str[1:].replace ('fq', 'tq')

Your proposal does not work for sqs.  Did an independent fix, as I have
not seen your proposal in time.  Please test since this should also
still make it into 2.20.

https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Torsten Hämmerle
In reply to this post by Dev mailing list
On 2020/02/11 20:54:19, dak wrote:
>
https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py
> File python/musicexp.py (right):
>
>
https://codereview.appspot.com/547610043/diff/557380043/python/musicexp.py#newcode324
> python/musicexp.py:324: return str
> On 2020/02/11 20:39:14, Be-3 wrote:
> > Proposal:
> > keep 1st character and replace 'fq' by 'tq' in the suffix:
> >
> >   return str[:1] + str[1:].replace ('fq', 'tq')
>
> Your proposal does not work for sqs.  Did an independent fix, as I
have not seen
> your proposal in time.  Please test since this should also still make
it into
> 2.20.

Yep, I forgot about the quarter tone sharps.

I've now successfully tested your English solution with a complete set
of all notes ranging from c to b using all accidentals in quarter tone
steps from double-flat to double-sharp.

Having a quick look at the other languages, espanol import is still
completely missing out quarter tones, even if there are Spanish quarter
note names. And portugues is completely missing.


def pitch_espanol (pitch):
    str = pitch_generic (pitch, ['do', 're', 'mi', 'fa', 'sol', 'la',
'si'], ['b', 'cb', 'cs', 's'])
    return str.replace ('bc', 'tc').replace ('sc', 'tc')

and

def pitch_portugues (pitch):
    str = pitch_generic (pitch, ['do', 're', 'mi', 'fa', 'sol', 'la',
'si'], ['b', 'bqt', 'sqt', 's'])
    return str.replace ('bbqt', 'btqt').replace ('ssqt', 'stqt')

would do the trick, tested with the complete set.

Torsten


https://codereview.appspot.com/547610043/

Reply | Threaded
Open this post in threaded view
|

Re: Fix and align musicxml and input language "deutsch" (issue 547610043 by dak@gnu.org)

Torsten Hämmerle
In reply to this post by Dev mailing list
German and English successfully tested.

proposal for espanol (missing quarter notes) and portuques (still
completely missing) added (as it is about 2.20)


https://codereview.appspot.com/547610043/