Skip to content

GuitarPrometheus::Profiles

GuitarPrometheus::Profiles

Classes

Name
structGuitarPrometheus::Profiles::ArticulationMod
Optional per-note articulation adjustments attached to a technique.
classGuitarPrometheus::Profiles::ClipboardPort
Thin seam around the system clipboard so ProfileStore can be tested without touching real OS state.
classGuitarPrometheus::Profiles::DefaultProfiles
Accessor for the compiled-in bundled default profiles.
classGuitarPrometheus::Profiles::DiagnosticReport
Formats a list of ProfileIssues into a human-readable report.
structGuitarPrometheus::Profiles::GmDrumPiece
One row of the General MIDI percussion key map.
classGuitarPrometheus::Profiles::Profile
A VST keyswitch and articulation profile.
structGuitarPrometheus::Profiles::ProfileFormState
Plain form-state mirror of a [Profile](/api-reference/classes/classguitarprometheus_1_1profiles_1_1profile/).
structGuitarPrometheus::Profiles::ProfileIssue
A single validation finding produced by [ProfileValidator]().
structGuitarPrometheus::Profiles::ProfileLoadResult
Aggregate result of [ProfileStore::loadAll()]().
classGuitarPrometheus::Profiles::ProfileSchema
Accessor for the compiled-in v1 Profile JSON Schema.
classGuitarPrometheus::Profiles::ProfileStore
Central store for VST keyswitch profiles.
classGuitarPrometheus::Profiles::ProfileValidator
Validates a parsed JSON value against the v1 Profile schema and builds a [Profile](/api-reference/classes/classguitarprometheus_1_1profiles_1_1profile/) with sanitized field values, producing a list of [ProfileIssue](/api-reference/classes/structguitarprometheus_1_1profiles_1_1profileissue/)s describing everything that was adjusted.

Types

Name
enum classIssueSeverity { Error, Warning}
Severity of a ProfileIssue.

Functions

Name
intgmDrumDefaultNote(std::string_view name)
Look up the GM default MIDI note for a canonical drum name.
boolisGmDrumName(std::string_view name)
Whether name is one of the 47 canonical GM percussion names.
boolshouldStoreDrumOverride(int gmDefault, int userValue)
Whether to persist an override for a GM piece.
std::stringnextCustomDrumName(const std::map< std::string, int > & existing)
Generate the next unused placeholder name for a custom drum.
std::stringformatKeyswitchLabel(int midiNote)
Format a MIDI note number as a human-readable label like “C2 (36)” or “C#4 (61)“.
booloperator==(const ArticulationMod & lhs, const ArticulationMod & rhs)
booloperator!=(const ArticulationMod & lhs, const ArticulationMod & rhs)
ProfileFormStatetoFormState(const Profile & source)
Capture a Profile’s current values into a mutable form-state.
ProfileapplyProfileEdits(const Profile & source, const ProfileFormState & form)
Build a new Profile from the source Profile’s identity and the supplied form state.
nlohmann::jsonformStateToJson(const ProfileFormState & form)
Serialize a ProfileFormState to JSON.
ProfileFormStateformStateFromJson(const nlohmann::json & j)
Inverse of formStateToJson.
std::vector< Profile >filterProfiles(const std::vector< Profile > & profiles, const std::function< bool(const Profile &)> & predicate)
Return profiles that match predicate, preserving the input order.
boolisDrumProfile(const Profile & profile)
Convenience predicate: drum profiles (any profile whose drumMap is populated).
boolisPitchedProfile(const Profile & profile)
Convenience predicate: pitched profiles (the inverse — drumMap absent).
boolisBundledDefault(const Profile & profile)
True when the profile’s UUID matches a bundled default.
intinterpolateBetweenDynamics(const std::map< MusicModels::Dynamic, int > & map, double fractionalDynamic)
Interpolate a velocity for a fractional dynamic position from a sparse velocityForDynamic map.

Attributes

Name
constexpr std::array< GmDrumPiece, 47 >kGeneralMidiDrumKit
The 47 General MIDI percussion pieces covering notes 35-81.

Types Documentation

enum IssueSeverity

EnumeratorValueDescription
Error
Warning

Severity of a ProfileIssue.

  • Error: the profile could not be loaded. Only structural failures produce an Error (see Phase 4 design for the exhaustive list).
  • Warning: the profile loaded with a sanitized field value; the original was out of spec.

Functions Documentation

function gmDrumDefaultNote

inline int gmDrumDefaultNote(
std::string_view name
)

Look up the GM default MIDI note for a canonical drum name.

Parameters:

  • name Exact-match canonical name from kGeneralMidiDrumKit.

Return: The default MIDI note when name is in the GM kit; -1 when it is not.

function isGmDrumName

inline bool isGmDrumName(
std::string_view name
)

Whether name is one of the 47 canonical GM percussion names.

Used by the drum-profile editor to route entries from the form-state drumMap into the Standard GM Drum Kit section (this returns true) versus the Custom Names section (this returns false).

function shouldStoreDrumOverride

inline bool shouldStoreDrumOverride(
int gmDefault,
int userValue
)

Whether to persist an override for a GM piece.

Parameters:

  • gmDefault The piece’s default MIDI note (from kGeneralMidiDrumKit).
  • userValue The value the user typed into the override field.

Return: true when an entry should be inserted into drumMap.

The drum-profile editor stores drumMap sparsely: an override is only recorded when it materially differs from the GM default. The rules are

  • userValue <= 0 → no (treat as “clear override”)
  • userValue == gmDefault → no (matching the default is a no-op)
  • 1..127 ≠ gmDefault → yes

function nextCustomDrumName

inline std::string nextCustomDrumName(
const std::map< std::string, int > & existing
)

Generate the next unused placeholder name for a custom drum.

Parameters:

  • existing The current drum map keyed by piece name.

Return: A name guaranteed not to collide with any key in existing.

Used by the “Add piece” button in the Custom Names section: produces piece-1, piece-2, … skipping any names already present in existing. The numbering starts at 1 and increments until a free name is found.

function formatKeyswitchLabel

std::string formatKeyswitchLabel(
int midiNote
)

Format a MIDI note number as a human-readable label like “C2 (36)” or “C#4 (61)”.

Negative or out-of-range values (outside 0..127) render as “(none)” — useful as a sentinel for “not configured” in profile UIs. The integer is included alongside the note name so users still see the raw value they’d type in a fallback text field.

Octave numbering follows the MIDI convention where middle C is C4 (MIDI 60); this matches Logic, Cubase and most modern plugins. Some VSTs use the Yamaha convention where middle C is C3 — those users should add 12 to the displayed octave.

function operator==

inline bool operator==(
const ArticulationMod & lhs,
const ArticulationMod & rhs
)

function operator!=

inline bool operator!=(
const ArticulationMod & lhs,
const ArticulationMod & rhs
)

function toFormState

ProfileFormState toFormState(
const Profile & source
)

Capture a Profile’s current values into a mutable form-state.

Identity (uuid + salt) is not part of the form-state; it is taken from the source Profile when applying edits.

function applyProfileEdits

Profile applyProfileEdits(
const Profile & source,
const ProfileFormState & form
)

Build a new Profile from the source Profile’s identity and the supplied form state.

The returned Profile reuses source’s UUID and salt — the identity is preserved across edits so on-disk filename derivation stays stable. Name and content come entirely from form.

function formStateToJson

nlohmann::json formStateToJson(
const ProfileFormState & form
)

Serialize a ProfileFormState to JSON.

Used by Project::profileOverrides (Phase 10 F10.2) so per-file overrides persist alongside the project. Mirrors [ProfileStore::serializeToJson](/api-reference/classes/classguitarprometheus_1_1profiles_1_1profilestore/#function-serializetojson) minus the identity fields (uuid, salt) — overrides derive their identity from the part they’re attached to, not from a UUID of their own.

function formStateFromJson

ProfileFormState formStateFromJson(
const nlohmann::json & j
)

Inverse of formStateToJson.

Lenient on missing fields: any field absent from the JSON falls through to the default-constructed [ProfileFormState](/api-reference/classes/structguitarprometheus_1_1profiles_1_1profileformstate/).

function filterProfiles

std::vector< Profile > filterProfiles(
const std::vector< Profile > & profiles,
const std::function< bool(const Profile &)> & predicate
)

Return profiles that match predicate, preserving the input order.

Used by UI panels to filter the ProfileStore for context-appropriate options — e.g. “drum profiles only” for a drum part’s combo. Pure free function so it can be unit-tested without a JUCE Component.

function isDrumProfile

bool isDrumProfile(
const Profile & profile
)

Convenience predicate: drum profiles (any profile whose drumMap is populated).

function isPitchedProfile

bool isPitchedProfile(
const Profile & profile
)

Convenience predicate: pitched profiles (the inverse — drumMap absent).

function isBundledDefault

bool isBundledDefault(
const Profile & profile
)

True when the profile’s UUID matches a bundled default.

Used by the editor to grey out the Delete button — bundled defaults aren’t deletable from disk in a meaningful way (they reload on next ProfileStore::loadAll), and the UX is clearer when the button disables on those rows.

function interpolateBetweenDynamics

int interpolateBetweenDynamics(
const std::map< MusicModels::Dynamic, int > & map,
double fractionalDynamic
)

Interpolate a velocity for a fractional dynamic position from a sparse velocityForDynamic map.

Parameters:

  • map A velocityForDynamic map with at least one entry. Empty maps return 80 (engine default).
  • fractionalDynamic A real number; clamped to the range of declared dynamics in the map.

Return: Interpolated velocity, clamped to [1, 127].

The velocity-curve editor draws a graph with one control point per declared dynamic (ppp .. fff). The curve between control points is a straight-line interpolation in (dynamic-index, velocity) space — dynamicIndex is the integer enum value, fractionalDynamic is a real number in [0, kNumDynamics-1] that lets callers query “what would mp+0.5 look like?”. Used by the curve UI to render the line between dynamics; export behaviour still snaps to the nearest declared dynamic.

Pure: no allocation, no global state. Tested in isolation.

Attributes Documentation

variable kGeneralMidiDrumKit

constexpr std::array< GmDrumPiece, 47 > kGeneralMidiDrumKit;

The 47 General MIDI percussion pieces covering notes 35-81.

Lifted verbatim from the GM 1 standard’s Percussion Key Map. Used by the drum-profile editor’s Standard GM Drum Kit section to present a fixed reference list of canonical names + default MIDI notes; the user can store per-piece override notes in Profile.drumMap against the canonical names listed here.

The array is sorted by note ascending so it can drive a stable UI layout without an extra sort step.


Updated on 2026-05-29 at 07:39:52 +0000