GSoC Progress: Scale Degree vs Nth Modal Pitch

Weeks 2-4 of Community Bonding Period: 11/05/20 – 31/05/20

At the end of Week 1, we had figured out an issue with octave calculation. This week we set some new ground rules pertaining to the behavior. Rules went on as:

  • Always use the argument as a reference for octave
  • Reference octave can be different from what you listen

This means that I may have my octave argument as 4 and I might still hear a pitch in 5th octave if that’s necessary to maintain the fluency. Given these two rules, I worked on a semitone-based implementation, where the selected key is always used as a reference, crossing B or 11th semitone on a circle of fifths always means a change in the octave you hear and an entire traversal of the circle means a change in the reference octave.

This change is hearing octave and reference octave, naturally coincides in the case of C Major.

Let’s say I’m in G major, What I hear will change at the crossing of B and C and my reference will change once I’m back at G after a whole traversal of my scale.

This behaviour finally solved the issue for us.

Issue: #2238

Patch: #2275

The next big thing we picked up during the community bonding period was the bug in accidental export to lilypond. Breaking it down in simpler terms: For instance, Gb and F# sound the same, but for someone reading sheet music, expecting one and finding the other leads to a lot of confusion.

This is something Devin pointed out during our meetings and I happened to at once (miraculously) find the piece of code that needed to be altered. So while it was easy to locate and trivial to fix a major part of this, there are certain nitpicks that still remain with this issue.

Fix was as simple as running our key selection through a series of checks to determine whether the user’s preference would be SHARP keys or FLAT keys and building the scale accordingly. The corner cases arrive with Natural tones that only differ by a semitone viz. B<–>C and E<–>F.

These are the ones I’ve bookmarked for later as there’s a lot of complexity involved in the way we handle this and fixing it might lead to breaking several other things that are in place.

Issue: #862

Patch: #2284

Last thing we managed to get done during the community bonding period (yes, we got a lot of stuff done) was complete the transition of our old scale degree block to the new n^th modal pitch block.

These changes were involved namely:

  • Make the index zero-based i.e now 0 represents the first note of the chosen scale, 1 represents second, and so on.
  • Pie-menu that goes from -7 to +7, from one octave lower to one octave higher.
  • As a last-minute addition: We wanted to extend the support to the previous project which used “scale degree” block and keeping their behavior intact.

An image of the new pie-menu of nth modal pitch block.

First and second in the upper list were mostly trivial and for supporting old projects we kept the previous block as such and kept it hidden from the palette, added our new block and whenever we detect a project is using the old block, we make some adjustments to its arguments to sustain the behaviour.

Issue: #2285

Patch: #2286

There were also a few minor bugs I took care during this time-frame. They are listed below:

These are largely just bug-fixes.

My progress can be further analysed by taking a look at the following: