Skip to content

[DRAFT] Add Community Feature: Note Color Mapping (Chromatic/Harmonic)#3979

Draft
mylesdebastion wants to merge 2 commits intoSynthstromAudible:release/1.2from
mylesdebastion:harmonic-color-1.2-clean
Draft

[DRAFT] Add Community Feature: Note Color Mapping (Chromatic/Harmonic)#3979
mylesdebastion wants to merge 2 commits intoSynthstromAudible:release/1.2from
mylesdebastion:harmonic-color-1.2-clean

Conversation

@mylesdebastion
Copy link
Copy Markdown

Summary

Adds a runtime‑configurable Note Color Mapping with modes Off / Chromatic / Harmonic.

  • Invariant (Audiolux): each pitch‑class → fixed hue (octave‑invariant); harmonious notes = similar colors, dissonant tones = contrasting colors.
  • Chromatic (utility view): even 12‑step rainbow by semitone — useful for following/reading and debugging.
  • Harmonic (default for creation): circle‑of‑fifths ordering — useful for writing/improvisation.

What changed

  • New color mapping code (harmonic + chromatic).
  • Runtime feature + menu item: Community Features → Note Color Mapping.
  • Localization: English + 7‑segment abbreviations.
  • Integrates with instrument‑clip color rendering.
  • Backport target: 1.2.1 (defaults unchanged; opt‑in; backward‑compatible).

Files touched

  • Added: src/deluge/gui/colour/harmonic_colors.{h,cpp}
  • Modified:
    • src/deluge/model/settings/runtime_feature_settings.{h,cpp}
    • src/deluge/gui/menu_item/runtime_feature/settings.cpp
    • src/deluge/model/clip/instrument_clip.cpp
    • src/deluge/gui/l10n/{strings.h,g_english.cpp,g_seven_segment.cpp}

Test plan

  • Build on 1.2.1.
  • Community Features → Note Color Mapping:
    • Off: existing behavior.
    • Chromatic: 12 distinct hues by semitone; easy to follow/verify incoming notes.
    • Harmonic: hues ordered by fifths; nearby keys show similar hues; cadences are visible.
  • Verify on OLED + 7‑segment (labels/abbreviations).
  • Open existing sessions with feature Off → rendering unchanged.
  • Quick performance smoke: no regressions when editing/playing dense clips.

Video

Docs

  • To Do: Add/update docs/CommunityFeatures.md (feature overview + how to enable + modes).

Notes

  • Ran ./dbt format and rebuilt locally.
  • Design intent: align with a small, portable mapping (Audiolux Harmony) so color semantics are consistent across tools.

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
@mylesdebastion
Copy link
Copy Markdown
Author

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.
I’m targeting release/1.2 for a 1.2.1‑compatible backport; happy to retarget if you prefer community/develop. I’ll add the docs entry and upload inline screenshots next.

{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"},
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's too long

return getHarmonicNoteColor(noteInOctave);
default:
// Return default color (this shouldn't happen when feature is enabled)
return RGB::fromHue(note * -8 / 3);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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] = {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this used? It looks like the functionality moved to NoteColorMapping

@seangoodvibes seangoodvibes marked this pull request as draft August 4, 2025 13:34
@seangoodvibes seangoodvibes changed the title [Draft] Add Community Feature: Note Color Mapping (Chromatic/Harmonic) [DRAFT] Add Community Feature: Note Color Mapping (Chromatic/Harmonic) Aug 10, 2025
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.

2 participants