Microtonal Plugin - Help needed

• Jan 8, 2023 - 15:43

Hello everyone!

EDIT: This plugin is complete & ready to use, however, the data entry task still stands at 44% complete.

I want to announce that I am working on a plugin to eventually support microtonal playback, transposition, enharmonic respelling & midi export for as many tunings as possible. The main features would include: custom nominal tunings, custom number of nominals (letters) within an 'equave', custom octave size, and combining multiple accidental symbols. This plugin is currently written for 3.6, but will be ported to 4.x once the plugin API and MuseSounds stabilizes.

However, this is a super huge task and I will need as much help as I can get.

If there are any microtonal composers, or curious onlookers who want to help speed up development, there's a simple, but tedious, data entry task that I need help with regarding the tabulating and grouping together of similar-looking accidentals on a Google Spreadsheet that is quarter-done.

You don't need to know how to code to help! Read more about it here: https://github.com/euwbah/musescore-ji-rtt-plugin#help-needed.

Cheers!


Komentāri

re: screencaping to build that table

i'm not sure but may be possible to find unicode using this
https://github.com/w3c/smufl/blob/gh-pages/metadata/glyphnames.json

print sym using a plugin
https://musescore.org/en/node/320673#iconsym

WIP use a plugin to print out a table of symbols

import QtQuick 2.0
import MuseScore 3.0
 
MuseScore {
      menuPath: "Plugins.pluginName"
      description: "Description goes here"
      version: "1.0"
      onRun: {
 
      for(var i in Accidental) {
            if(i.indexOf('_')!=0) 
                  console.log(i,Accidental[i])}
      for(var j in SymId){
            if(j.indexOf('_')!=0 &&
                ( ~j.indexOf('lat') || ~j.indexOf('harp')  )
            )
                  console.log(j,SymId[j])}
 
 
      }
 }

In reply to by msfp

Thanks for the tip. Though, some accidentals look very similar/have identical function and I wish to group these symbols together as one logical symbol to prevent confusion, so I won't be using around 20% of the symbols as they are duplicates.

Do you have any tips for where I could go to look up whether if certain accidentals have a similar appearance?

(edit: In Q1 I made a careless mistake assuming the tuning profile is a circle connected with a hidden enharmonic question solved thank you @matt28 for explaining)

I think I understand the reasoning behind a few tuning systems, namely meantone, just (common just and pythagorean). After studying your well written project overview, i think you're upgrading a regular(one-size-semitone) EDO plugin to include irregular tuning systems, and adopting a generalized nominal + accidental chain system, am I correct? https://en.xen.wiki/w/Nominal-accidental_chain

I have questions about how a microtonal score should be notated, i've never read one or know any musician uses one, except on youtube, i'm still figuring out johnston's https://www.kylegann.com/BJNotation.html

Q1
re: https://github.com/euwbah/musescore-ji-rtt-plugin#help-needed

...
A4: 440
Chooses the 12edo nominal A4 as the reference note, sets A4 to 440hz.
...

Are nominals white keys/ C major notes?
Seems to me the plugin need to separate :
1 the reference pitch/ concert pitch , used to play along with other instruments
2 the fundamental pitch (tonal center), to build nominals on
eg F major , can i use the above A4=440 tuning? does the nominals include a Bnat or Bb ?
fmajor.png
ie for a given concert pitch, am i correct to suggest that 11 set of nominals are needed? Amajor A4 440, Bbmajor A4 440, Bmajor A4 440 etc

Q2 will the parsing work correctly on the Bb on measure 2 beat 3 ?

i'm not sure coz I'm still wrapping head around how your plugin work, and I know very poorly about accidental-chain usage.

In reply to by msfp

Thanks for having a look :)

You are right - I'm implementing custom nominals and "accidental chains". I don't know whether if there's any proper word for "accidental chains" and I just made it up. However, this idea is very similar and hugely influenced by HEJI (Helmholtz-Ellis Just Intonation), HEWM (Helmholtz-Ellis-Wolf-Monzo), and Sagittal notation systems.

The idea is that, instead of declaring every note/pitch class one by one, you can declare a "multiplication table" of accidentals. Instead of just having one 'chain' which represents sharpness and flatness in only one dimension, you can add more dimensions which represent other important microtonal intervals and commas like the syntonic (meantone) comma (81/80), septimal comma (63/64) etc... So now, you can access notes in just intonation like C + apotome (2187/2048) = C#. C# - syntonic comma (81/80) = C#v. In Just intonation, C#v is the classic major third of A, such that C# is 5/4 the frequency of A, forming a sweet consonance. This is in contrast to C# and A, which forms a (81/64) interval.

This way, if you're dealing with tunings with many distinct notes, you don't need to manually specify the tunings of each one. You simply specify which accidental-chains there are, and the accidentals from different chains can combine. E.g. let's say you declare 5 different accidental degrees in the flats-to-sharps dimension ranging from double flats to double sharps. Then, you declare 5 accidental degrees in the syntonic comma 'dimension'. The result is that you get a tuning system where each nominal has 25 unique accidental spellings that you can apply. Cbbvv Cbbv, Cbb, Cbb^, Cbb^^, Cbvv, Cbv, Cb, Cb^, Cb^^, Cvv, Cv, etc....

This aspect of just intonation notation systems influence the choice to implement 'accidental chains'. Each chain is a unique dimension of pitch offsets that no other 'dimension'/'chain' of accidental can access. Of course, the user can specifically tune accidental chains to eventually coalesce such that one sharp becomes the same interval as three syntonic commas, and this will allow you to notate different regular temperaments. (https://en.xen.wiki/w/Regular_temperament).

> Are nominals white keys:

Yes. The definition of 'nominals' here represent notes without accidental, aka the 'alphabets'. There are also other notation systems with more than 7 'alphabets', such as Bohlen-Pierce. This plugin is designed to allow support for such notations as well.

> Transposed vs Concert pitch

This plugin does not intend to support toggling between concert and transposed modes. Only concert is supported. However, you can still write for transposing instruments in the transposed key by stating so in the tuning configuration text. E.g. if you're writing for Eb alto sax, then you can write A4: 261.625 instead of A4: 440.

Of course, this may result in weird playback timbres. However, I intend to address that by also modifying the PlayEvents of a note, so that the MIDI note played is closer to the re-tuned pitch. This will be for a later update.

> Tonal center

There's not really a concept of 'tonal center'. The reference tuning note is to just denote that a white-key nominal is to be tuned at a particular frequency. Because this plugin allows for non-octave tunings with more or less than 7 nominals (apart from A to G), I implemented an abstraction layer over how musescore represents its notes that represents notes in the microtonal context instead.

For example, if I'm in a tuning system with only 5 nominals, and I choose A4: 440 as my reference pitch, this means: on the written score, the note A4 will sound exactly as per normal. However, the note C4 is now considered to be 'one equave' below A4, because C4 is 5 white keys below A4. "Equave" is a more general word for "octave".

> Will parsing work on bar 2 beat 3

Yes. I intend to account for all accidentals and follow how musescore updates/modifies/lays out accidentals. (Incl adding explicit accidentals when needed, or removing redundant non-courtesy accidentals)

In reply to by matt28

Wow, thank you very much for taking time to explain.

Yes I noticed your plan to include ability to extend over a equave: " ..The last number sets equave to 1200c.... " It's such a clever idea and brilliant attention to details, it is possible to create a tuning that eliminates wolf fifths using your system, am i right?

I think it's fair to not mess up the nominal logic with idea of tonal centers, but it seems to me the implication
that "accidentals = marked = tempered white note" is emphasized, I cannot help but think the Bb in the F major example is a tempered version of B, it may be counterintuitive to read / may output a wrong tuning value, but maybe i'm overthinking coz I haven't think it through and adapt to it yet.

In reply to by msfp

I'm not sure if I understand what you mean by this.

in JI, the interval from F to B is 6 fifths up, 3 octaves down. That is, 729/512. That is the Pythagorean tritone.

Then applying the apotome downwards to flatten B, we get Bb = 729/512÷(2187/2048) = 4/3.

4/3 is the perfect fourth.

F-Bb represents the same interval either way you choose to think about it

In reply to by matt28

> F-Bb
Yes that's what I meant. My calculation matches your calculations.
But you miss my point : nominal = white key could cause problem , please see below

I'm not 100% sure but I think you should think deeply when upgrading the EDO based plugin to include other relative /ratio tuning systems such as Just, because a tonal center is inevitable. By definition their intervals are irregular and is built on one starting point (fundamental) . And because intervals are irregular, you may get wrong tuning values if you accidentally force everything to calculate from white notes and thus force assign (see below) a tonal center

If I understand tuning systems correctly, when you
* decide a system that nominals use some defined notes, and
* make a system of 1200cents=octave
you get
* inadvertently hardcode a tonal center and a mode, and
* the 1200cents=octave creates one non pure fifth (i'm sure you understand) and contribute to uncertainty

for example your "case study tuning profile" https://github.com/euwbah/musescore-ji-rtt-plugin#case-studyexample says
...
0 203.91 294.13 498.04 701.96 792.18 996.09 1200
Sets a cycle of 7 nominals extending upwards/downwards from A4.
...
you
* defined nominals = white key (plugin global logic)
* make a system of 1200cents=octave (this tuning)
you get

  • one non-pure fifth hidden inbetween 701.96 and 792.18:
    • E: 701.96 is calculated up from 0 (1xfifth 3:2)
    • F: 792.18 is calculated down from 1200 (4xfifths 2:3 )
    • which means in this case you cannot be certain E,F has ratio relationship: calculations involving across note E , F could be non pure/ non ratio
  • set A as fundamental because you "Sets a cycle of 7 nominals extending upwards/downwards from A4.",
  • set aeolian as mode because nominals defined as white keys.

To get Bb:

A reallife section of performance in just intonation eg string quartet F major, depending on musical context, one possible way to play a Bb on a violin:
Start from a ratio referenced note. eg F, add 498cs (4:3) to F to get Bb so that these two notes has a ratio relationship.
The referenced note could be F or any other notes depending on musical context / partner / adjacent notes / conductor.
Here F is chosen imgagining it is tonic music and the situation requires IV.
(This point is not the main focus: ) the freq. of F and thus all notes could be obtained from A 440 or A 415 etc (in real life, the tuning section at beginning of a performance)

A suspicious logic according to "case study tuning profile":
Start from A because "Sets a cycle of 7 nominals extending upwards/downwards from A4."
Add 203.91 cents to A to get B , minus accidental "b" 113.685 cents to get Bb
what we get:
* The only ratio relationship that we are 100% certain is A-Bb , which is a pure interval that plugin users will not acknowledge
* force A as the only ratio reference onto every notes using this tuning because the tuning profile is built on it, ie A is the fundamental
* cannot choose any other meaningful ratio reference note, eg tonal music IV F, pure fifth Eb etc
If we need F, to get F:
Start from A because "Sets a cycle of 7 nominals extending upwards/downwards from A4."
Add 792.18 cents to A to get F
* The only ratio relationship that we are 100% certain includes also F-A , which is * a pure third *( correction: Pythagorean Ditones, thanks @matt28) that plugin users will not acknowledge
the suspicion:
* Cannot be 100% certain F-Bb or Eb-Bb or others have a ratio relationship because of the underlining indirect calc logic and the hidden non-pure across E , F. if you work out F to A to B to Bb, it might be the same as F to Bb obtained earlier, but you cannot be certain because Just is a irregular system, unlike EDO.

I hope my writing makes sense and not sound aggressive as I'm really fond of your ambitious microtonal project.

In reply to by msfp

Don't worry, it is not aggressive at all. Thanks for putting in the effort to try explain --- it seems you have found an issue I have not seen, though, I'm struggling to understand the issue.

> Hardcode tonal center & mode

Yes, if the nominals are not part of some equal-temperament, there is a sense of mode & 'tonal center' based around it.

> one non-pure fifth between E and F

I don't understand what you mean by this. E and F are not connected by fifths. The nominals i have chosen are a chain of fifths. Let me show you the calculation in ratios instead of cents. If we say A is 1/1, then my tuning example I have chosen yields these nominals:

A: 1/1
B: 9/8
C: 32/27
D: 4/3
E: 3/2
F: 128/81
G: 16/9

This in from the frame of perspective of A = 1/1.

Then, we can sort these nominals in pure fifths:

F: 128/81
C: 32/27
G: 16/9
D: 4/3
A: 1/1
E: 3/2
B: 9/8

The apotome is defined to be 2187/2048, which means this chain of pure fifths can extend indefinitely:

Ab: 4096/2187 = 1/1 * 2048/2187 * 2
Eb: 1024/729 = 3/2 * 2048/2187
Bb: 256/243 = 9/8 * 2048/2187
F: 128/81
C: 32/27
...
B: 9/8
F#: 27/16 = 128/81 * 2187/2048
... etc

With the tuning case study/example I provided, every fifth that is spelt like a fifth should sound like a pure fifth.

As you have stated, F and Bb is 4/3.

> Force A as the only ratio reference

This is not necessary. Any one of the nominals can be used as the reference. This is especially true if you decide to construct an equal-temperament using this plugin. In just intonation, A4 is just chosen to be the represent the nominals, but we can also reframe our calculations to use any other note as reference without respecifying what the reference note is. For example, we can reframe C = 1/1 as our reference instead of A = 1/1, but still keep A4 = 440 hz.

F: 4/3
C: 1/1
G: 3/2
D: 9/8
A: 27/16
E: 81/64
B: 243/128

However, the cents between the nominals are still the same as the tuning config.

> A suspicious logic according to 'case study'

I don't really understand the issue brought forward here. Let me rephrase it in my own words and using ratios instead of cents. Could you help me point out what I may be understanding wrong?

Start from A: 1/1

Add 203 cents = 9/8 from A to get B: 9/8
Subtract 113 cents = 2048/2187 from B to get Bb: 256/243

> Cannot choose any other meaningful reference note:

I don't understand why we can't do this yet.

> To get F

Add 128/81 to A to get F: 128/81 (down 4 fifths)

> The only ratio relationship that we are 100% certain includes also F-A , which is a pure third

F-A is not a "pure third" in the sense of the classic major third (5/4). It is a 3-limit Pythagorean Ditone (81/64) which is a harsher sound. Though, yes, it is still considered 'pure' because it is "justly tuned", but I just want to clarify and make sure that 81/64 and 5/4 are not being confused/conflated here.

Because you brought up Ben Johnston's notation system, I want to clarify that this example tuning configuration is not the same as Johnston's. Johnston's notation attempts to make just intonation easier for performers to read by basing the nominals off of 5-limit intervals for thirds based on C major, instead of defaulting all thirds to 3-limit.

In Johnston notation C-E is 5/4, F-A, G-B is 5/4.
But, D-F# is 100/81, but, A-C# is 5/4. The purity of the thirds depend on which note you're using.

The reason why I didn't want to use Johnston's system for the example is because of this irregularity that will make the example harder to understand.

However, in all other JI notations, All Pythagorean Ditones ("fake major thirds") like C-E, D-F#, Eb-G, F-A, etc... all default to 81/64. This is to ensure regularity so that it is easier to read/learn.

If you want to specify 5/4 in this notation system, you will need to reduce a third by a syntonic comma.

E.g. C-E\, D-F#\, Eb-G\, F-A all represent 5/4 classic major thirds.

> if you work out F to A to B to Bb, it might be the same as F to Bb obtained earlier

That's right.

> you cannot be certain because Just is a irregular system, unlike EDO.

This is not true. In the tuning example I provided:

  • all intervals that are spelt like a fifth is 3/2
  • all intervals that are spelt like a fourth is 4/3
  • all flats and sharps will increase/decrease 7 fifths and decrease/increase 4 octaves respectively.

The nominals and accidental sizes I've chosen ensures this regularity according to Helmholtz-Ellis notation standards.

E-F & B-C & C-Db & Db Ebb are pythagorean limmas = 5 fifths apart. 256/243
C-C# & C#-Cx & Cx-C#x are apotomes = 7 fifths apart.
F-C, C-G, C#-G#, Bbb-Fb, B#-Fx are all fifths: 3/2

As long as the notes are spelt right, they will have the correct interval.

Perhaps I'm understanding you wrong? Are you talking about how it is difficult for the user to know what nominals to choose and what step sizes for the accidentals to use?

If so, you are right. The average hobbyist interested in exploring microtonality will not know what cent sizes to use for nominals and accidentals, and this information is quite hard to find on the internet. The user will have to do some calculations on their own to figure out what cent values to key in.

However, one of the goals is to have a collection of copy-paste tuning texts for beginner users that allows this plugin to emulate common microtonal notation standards like HEJI, George Secor's Sagittal, and Kite Giedraitis' Ups-and-downs in EDOs, JI subgroups and rank-2 temperaments that are commonly used by the microtonal/xenharmonic community.

Also, your point about possible uncertainty and confusion could also be related to Johnston's notation being irregular.

This plugin definitely allows & supports Johnston notation. However, a user who does not already know Johnston's notation will have a hard time figuring out which intervals need to be altered with a syntonic comma/diesis and which don't. So I wouldn't recommend starting off JI with this system unless you have already studied his notation.

In the tuning example I am using (perhaps the way the majority would write JI today), I use the more regular and predictable HEJI/Sagittal method of tuning the circle of fifths to strictly 3-limit instead of a combination of 3 and 5 limit intervals.

I want to clarify, I'm not saying that Johnston's notation is bad. It was a notation that was personalised for his and the Kepler Quartet's use, and if they found it easier to read JI that way, then they should use it. Anyone is free to choose what nominals they want to tune to.

Also, if you're pointing out the uncertainty and confusion regarding how many different notation systems there are, then, I will have to agree with you. There are too many different notation systems in the world. This plugin doesn't offer a "new universal standard" (https://xkcd.com/927/) of notation. Instead, it offers the flexibility for users to work in whichever notation system they wish to use.

Once this plugin is done, I will do a poll of what common tunings/notations should be supported, and write a script to auto-generate tuning configurations (e.g. generate all EDO, ED3, ED5s from 1 to 1000 using Stein, Up/Downs, and Arrow notation systems; generate all MOSs from Dicot, Porcupine, Meantone, Superpyth, etc..). Then, the user will just copy a tuning configuration instead of having to calculate themselves manually.

In reply to by msfp

Now that I've read and slept on it, I realise you are correct that i wrongly approached from a nonmicrotonal or Johnston notation reader POV. The mistake is I unconciously scrutinized every note based on tonality, context, voiceleading etc REGARDLESS of its notation (accidentals or not), which is a wrong habit and wrong assumption in the micortonal realm. The correct way is to force oneself to read and perform the notes and accidentals AS IS. The E and F in the example A based tuning are simply not connected secretly thru a enharmonic note hidden somewhere unseen, because while the intervals defined in the tuning profile can be extended in both direction, they will not meet and make a circle with a enharmonic. Everything is connected thru nominals only thus correct calc is ensured if this makes sense to newcomers to microtonal notation and to this thread. Now that I think more about it, I see nominals = white keys is the only way possible to code a sensible universal notation system. It may sound silly but seriously the burden of creating a performance with correct pitches relies heavily on the composer / copyist , and how well versed the performer is in microtonal symbols rather than in harmony and to get every pitch notated is the point.

Thank you very much for generously sharing your wealth of microtonal knowledge.

A score to illustrate the mistake https://musescore.org/en/node/342128

> F-A is not a "pure third" in the sense of the classic major third (5/4). It is a 3-limit Pythagorean Ditone (81/64).
You're right those are Pythagorean Ditones thanks, calling them pure third is wrong, I corrected the post.

> reframe C = 1/1 as our reference instead of A = 1/1, but still keep A4 = 440 hz.
I've done some ratio calc, now I understand why which intermediate reference note to use does not really matter, see above.
EDIT: upon reading on HEJI I discovered the symbol heji0c.PNG which offers a way to notates 0c, but it is not related to the original intention of my question (to discuss coding logic of nominals and possible error) so I'm not discussing it further.

> difficult for the user to know
Yes nice spotting out the real issue is instead how to know which, if any, accidentals are needed at each moment of the music.

In reply to by msfp

No worries. It is my pleasure.

A tuning that eliminates wolf fifths is technically a temperament. The idea of a 'wolf fifth' stems from the fact that a circle of purely tune fifths won't ever cycle back to the exact same starting note. However, as you have stated correctly, one can change the size of a fifth. The act of changing a size of an interval to make it fit some other important interval (e.g. forcing12 fifths = 7 octaves, even when it originally isn't) is called 'tempering'.

In fact, 12 edo is a temperament that eliminates wolf fifths. In this plugin, you are also able to use other tunings that temper x number of fifths to equal y number of octaves. Any pythagorean temperament does this. Also, 19edo, 22edo, 31edo, etc... You control the size of the fifth indirectly by specifying the apotome size. The apotome is the size of a 'sharp', and is defined by going up 7 fifths (C, G, D, A, E, B, F#, C#), and down 4 octaves. This results in the Just interval 2187/2048 = 113.685 cents. However, you can change this size to indirectly change the size of a fifth. The simplest example would be changing it to 100 cents, and you get your classic 12 edo, which is a pythagorean temperament that tempers out wolf fifths.

> accidentals = tempered

Regarding this, I agree that some people may initially find this confusing, because we're taught that music has 12 equally spaced notes and we place equal importance on all 12 of them. Hence, you see any of the 12 'normally spelt' notes as '12 edo' by default.

However, it hasn't always been like this. If you go back to the Renaissance and early Baroque times, all theorists & written treatises time would agree more with the way this plugin treats accidentals.

To very loosely summarize, the origins of notation stems from Greek Genera > Byzantine > Monodic Chant > Church Modes + Musica Ficta. The 'equalness' between Bb and B is a really new concept in the big picture history of music.

This same justification is also used in discussions about the necessity of double flats and double sharps. These accidentals are still prevalent because of the history of tuning and temperament.

If I dare say, the historical view on tuning and temperament is much more functionally sound and allows one to grasp functional harmony, even modern harmony, easier. I apply musica ficta, guidonian hand, and concepts of temperaments to jazz improvisation all the time.

In reply to by matt28

I meant to suggest thinking more about relative / ratio / pure systems. EDOs are on the contrary consist of only non-pure fifths (forcing 12 fifths = 1 octave). I meant a system that eliminate wolf fifths by making all fifths pure and extending overtones up and down indefinitely, octaves further way will get increasingly out of tune.

In reply to by msfp

I see, you're talking about stretched-octave tunings. You're right, this plugin can increase the size of the equave so that fifths are now pure 3/2 intervals. You can also get pure fifths in this plugin by declaring pure 3-limit nominals + pure 3-limit accidentals for the flat/sharp chain.

Though, it's not really technically possible to get unlimited number of overtones notated. The more accidentals/nominals you add, the larger the plugin's internal tuning lookup table, and at some point, the computer will run out of RAM. There's some O(n log n) and O(n^2) size complexity data structures being used so its not recommended to go beyond 10000 notes per equave.

In reply to by msfp

Thanks! I actually just found a way to go around that issue. This shouldn't be a problem any more.

      onScoreStateChanged: {
        if (state.selectionChanged && curScore) {
            var elems = curScore.selection.elements;
            var el = elems[0];
            var name = el ? el.name : null;
            if (elems.length == 1 && 
                (name == "SystemText" || name == "StaffText" || name == "TBox" || name == "Text")) {
                // allow the user to use up/down arrow keys to navigate text
                Fns.setUpDownFallthrough(false);
                upShortcut.enabled = false;
                downShortcut.enabled = false;
                enharmonicShortcut.enabled = false;
            } else {
                // If no notes are selected, allow up/down arrow keys to move elements.
                Fns.setUpDownFallthrough(true);
                upShortcut.enabled = true;
                downShortcut.enabled = true;
                enharmonicShortcut.enabled = true;
            }
        }
      }

Do you still have an unanswered question? Please log in first to post your question.