Skip to content

# Resolve Issue #2538: Implement Chromatic Pitch Spelling #4693

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JaySoni1
Copy link
Contributor

Resolve Issue #2538

The issue was about determining how to spell chromatic notes (notes outside the main scale) correctly. For example, when we have a note between C# and D#, should we write it as Cx (double sharp) or D natural? So the answer to this depends on where the melody is going - if it is moving up to D# then we will write Cx and if it is moving down then we will write D natural.

To solve this issue I have done following steps :-

  1. I have added ChromaticSpeller class for pitch spelling that will :-

-Handles chromatic note spelling based on melodic direction .
-Manages edge cases like B# vs C .
-Uses private fields for better encapsulation .

  1. I have added PitchUtils for MIDI calculations that will :-

-Converts between note names and MIDI pitches .
-Calculates intervals between pitches .
-Provides letter class utilities .

  1. I have added comprehensive test suite that will -:

-Tests for ChromaticSpeller functionality
-Tests for PitchUtils methods
-Mock Scale implementation for testing
-Screenshot of test cases passed successfully :-
Screenshot 2025-05-19 232602

-All tests passing successfully

  1. I have implemented example usage with Romza piece, this will :-

-Demonstrates the spelling logic with real musical example
-Shows how to handle ascending/descending chromatic notes
-For example : G# G# G# G# F# E , E D# D# D# Cx D#

Resolve Issue #2538

- Added ChromaticSpeller class for pitch spelling
- Added PitchUtils for MIDI calculations
- Added comprehensive test suite
- Implemented example usage with Romza piece
- Depends on sugarlabs#2537
Copy link

✅ All Jest tests passed! This PR is ready to merge.

@JaySoni1
Copy link
Contributor Author

Hi @walterbender , @pikurasa
I have implemented the chromatic pitch spelling logic for issue #2538. Please review it when possible .
Thanks !

@walterbender
Copy link
Member

Thanks for working on this. I am not sure where exactly we want to integrate this into MB itself. @pikurasa where does this issue manifest itself?

@pikurasa
Copy link
Collaborator

The referenced issue is from 2020.

I'll need to retest this in order to better understand where we're at now compared to where we were at the time. Please give me some time to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants