denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] respelling and simplifying accidentals


From: Bric
Subject: Re: [Denemo-devel] respelling and simplifying accidentals
Date: Mon, 08 Dec 2014 09:58:37 -0500
User-agent: PlutoMail 2.0

On 11/29/2014 03:05 PM, Bric wrote:
On 11/29/2014 01:20 PM, Richard Shann wrote:
On Sat, 2014-11-29 at 18:09 +0000, Richard Shann wrote:
  It's spelling the
notes as G#, C#, D#, etc. (instead of Ab, Db, Eb, etc)
I should have mentioned that having transposed to the wrong key, you can
always make a further transposition to correct your error. In the case
you mention here, you need to transpose upwards by a diminished second
(the code is d2 for the "Arbitrary transpose up" command).

My brain is not working at the moment. (Not enough to understand your explanation) But I applied the "d2" transposition, and the problem went away.

If the error was mine, then there's no need for the "simplify" function I mentioned. Perhaps. It would/could have been a more generalized function, used to correct mis-spelled sharps/flats regardless of how they came about (whether through "transpose" or some other way). But if these problems don't occur, then, obviously, no need. Thanks for helping

I came upon a situation that could use a "force re-spell" function ... this one could simply force the FIRST occurrence of a spelling upon all the subsequent variants (deviations) from the first occurrence...

Here is a screen shot of the "misspelled" notes.... I arrived at them by copying and pasting sets of quadruplets and then transposing them a minor third, then a tritone, then a major sixth up... The key signature is D major.

See attached/embedded png. I want the Ab to be spelled as G#, and certainly the C double sharp to be spelled as a D.

Here is a sketch of the basic algorithm in Perl. I realize there can be a different algorithm, not based on first-occurrence, but on some other, absolute normalization:

foreach my $spelled (@lily_notes) {

my $pitch=&MidiValue($spelled) % 12; # the MidiValue function computes the midi index...

    if(exists $pitch_spelling{$pitch}) {  # if repeat occurrence

        push @respelled_notes, $pitch_spelling{$pitch};

    } else {

        push @respelled_notes, $spelled; # (first occurrence)
# grab the first occurrence, to force all subsequent variations to be spelled as the first occurrence...
        $pitch_spelling{$pitch}=$spelled;

    }

}

#---------------------

I don't know how one would do associative arrays in, say, scheme, but that's my thinking...





(In case you are struggling to analyse that, it is a second because you
are taking G-sharp to A-flat so counting the note steps starting at 1
you get 1 for G and 2 for A, so it's a second - you always have to start
counting a 1 so that g-g is a unison, and g-g' is an 8 or octave. Then
for the quality of the interval, a major second is a tone, a minor
second is a semitone, so this is a diminished second, being one semitone
smaller than that).

Please don't be insulted if you knew all that!

Richard




_______________________________________________
Denemo-devel mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/denemo-devel


Attachment: misspelled.png
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]