# Resolve Issue #2538: Implement Chromatic Pitch Spelling #4693
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 :-
-Handles chromatic note spelling based on melodic direction .
-Manages edge cases like B# vs C .
-Uses private fields for better encapsulation .
-Converts between note names and MIDI pitches .
-Calculates intervals between pitches .
-Provides letter class utilities .
-Tests for ChromaticSpeller functionality

-Tests for PitchUtils methods
-Mock Scale implementation for testing
-Screenshot of test cases passed successfully :-
-All tests passing successfully
-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