[DRAFT] Add Community Feature: Note Color Mapping (Chromatic/Harmonic)#3979
[DRAFT] Add Community Feature: Note Color Mapping (Chromatic/Harmonic)#3979mylesdebastion wants to merge 2 commits intoSynthstromAudible:release/1.2from
Conversation
This community feature allows users to choose between different color mapping algorithms for note display in instrument clips: - Off: Default behavior (no color mapping) - Chromatic: Maps notes to colors based on their chromatic position - Harmonic: Maps notes to colors based on harmonic relationships Features: - Runtime configurable via Community Features menu - Persistent settings stored in XML configuration - Full localization support (English + 7-segment display) - Integrates with existing InstrumentClip color system - Maintains backward compatibility with existing clips The feature enhances visual feedback for musicians by providing intuitive color coding that helps identify note relationships and improves workflow efficiency during composition and performance. Files changed: - Added harmonic color mapping implementation - Extended runtime feature settings system - Added localization strings for UI elements - Integrated color mapping into instrument clip rendering
…ument clips header Add customizable note color mapping system for instrument clips This community feature allows users to choose between different color mapping algorithms for note display in instrument clips: - Off: Default behavior (no color mapping) - Chromatic: Maps notes to colors based on their chromatic position - Harmonic: Maps notes to colors based on harmonic relationships Features: - Runtime configurable via Community Features menu - Persistent settings stored in XML configuration - Full localization support (English + 7-segment display) - Integrates with existing InstrumentClip color system - Maintains backward compatibility with existing clips The feature enhances visual feedback for musicians by providing intuitive color coding that helps identify note relationships and improves workflow efficiency during composition and performance. Files changed: - Added harmonic color mapping implementation - Extended runtime feature settings system - Added localization strings for UI elements - Integrated color mapping into instrument clip rendering
|
Hi, new to this process, first time PR, please let me know if I overlooked a step (or multiple!). This is a small, opt‑in community feature: Note Color Mapping with Off / Chromatic / Harmonic. It keeps pitch‑class → hue fixed (octave‑invariant), so harmonious notes appear as similar colors and dissonant tones as contrasting colors. |
| {STRING_FOR_COMMUNITY_FEATURE_ALTERNATIVE_PLAYBACK_START_BEHAVIOUR, "STAR"}, | ||
| {STRING_FOR_COMMUNITY_FEATURE_ACCESSIBILITY_SHORTCUTS, "ACCE"}, | ||
| {STRING_FOR_COMMUNITY_FEATURE_GRID_VIEW_LOOP_PADS, "LOOP"}, | ||
| {STRING_FOR_COMMUNITY_FEATURE_NOTE_COLOR_MAPPING, "COLOR"}, |
| return getHarmonicNoteColor(noteInOctave); | ||
| default: | ||
| // Return default color (this shouldn't happen when feature is enabled) | ||
| return RGB::fromHue(note * -8 / 3); |
There was a problem hiding this comment.
Make this the normal case - right now you duplicate this logic in the clip render
| namespace deluge::gui::colour { | ||
|
|
||
| // Chromatic color mapping (smoother hue steps; fewer yellows & blues bunched; no grays) | ||
| const RGB NoteColorMapping::chromaticNoteColors[12] = { |
There was a problem hiding this comment.
These should go in sdram
| RGB(255, 0, 192) // B - Red-Violet (more red-weighted; less like Bb) | ||
| }; | ||
|
|
||
| // Harmonic mapping = circle-of-fifths reorder of the chromatic palette above |
There was a problem hiding this comment.
This doesn't respect the key which I would definitely expect from a harmonic mode. Ideally the first colour should be the root and not c
There was a problem hiding this comment.
Or rename to circle of fifths mode, this seems useful it just doesn't match the name
| } | ||
|
|
||
| RGB NoteColorMapping::getChromaticNoteColor(uint8_t noteInOctave) { | ||
| if (noteInOctave >= 12) { |
There was a problem hiding this comment.
This isn't needed as it's done by the caller, just put that it's unchecked as a doc comment
| static RGB getNoteColor(uint8_t note); | ||
|
|
||
| /// Get the color for a note within an octave (0-11) using chromatic mapping | ||
| static RGB getChromaticNoteColor(uint8_t noteInOctave); |
There was a problem hiding this comment.
These should be private
| class NoteColorMapping { | ||
| public: | ||
| /// Get the color for a specific note using the current mapping mode | ||
| static RGB getNoteColor(uint8_t note); |
There was a problem hiding this comment.
If you do choose to make the harmonic mode non-chromatic I'd suggest having the caller provide the key here vs. trying to grab it from the global current song
| * - Backwards‑compatible: existing songs/clips render as before when the feature is Off. | ||
| * | ||
| * ATTRIBUTION: | ||
| * - Contributed by Myles de Bastion. |
There was a problem hiding this comment.
Stick yourself as the GPL copyright holder, you don't need to assign to synthstrom
| #include "model/settings/runtime_feature_settings.h" | ||
|
|
||
| /** | ||
| * Note Color Mapping (Chromatic / Harmonic) |
There was a problem hiding this comment.
Can this block be the PR text? It'll become the commit message when we merge
| * F = Green, F# = Green-Cyan, G = Cyan, G# = Blue, A = Blue-Magenta, | ||
| * A# = Magenta, B = Violet | ||
| */ | ||
| class HarmonicColors { |
There was a problem hiding this comment.
Is this used? It looks like the functionality moved to NoteColorMapping
Summary
Adds a runtime‑configurable Note Color Mapping with modes Off / Chromatic / Harmonic.
What changed
Files touched
src/deluge/gui/colour/harmonic_colors.{h,cpp}src/deluge/model/settings/runtime_feature_settings.{h,cpp}src/deluge/gui/menu_item/runtime_feature/settings.cppsrc/deluge/model/clip/instrument_clip.cppsrc/deluge/gui/l10n/{strings.h,g_english.cpp,g_seven_segment.cpp}Test plan
Video
Docs
docs/CommunityFeatures.md(feature overview + how to enable + modes).Notes
./dbt formatand rebuilt locally.