Skip to content

Added more sweeping conformances to Sendable and Hashable; made "shortcuts" concurrency-safe #56

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

Merged
merged 21 commits into from
Jun 3, 2025

Conversation

edonv
Copy link
Contributor

@edonv edonv commented May 27, 2025

  • I added Hashable conformances to all of Tonic's types, except for ChordTable and PitchColor.
  • I added Sendable conformances to all of Tonic's types, except for ChordTable.
  • I changed static properties (described as "shortcuts") for Note, Chord, and NoteClass from static var (mutable static property) to static let (immutable static constants). This ensures that they're concurrency-safe, as they're not mutable.

This relates to my own pull requests #54 and #55.

edonv added 21 commits May 27, 2025 12:12
Added `Hashable` conformance to `Chord`.
Added `Hashable` conformance to `Key`.
Added `Sendable` conformance to `Accidental`.
Added `Sendable` conformance to `Letter`.
Added `Sendable` conformance to `NoteClass`.
Added `Sendable` conformance to `ChordType`.
Added `Sendable` conformance to `Chord`.
Added `Sendable` conformance to `Interval`.
Added `Sendable` conformance to `Scale`.
Added `Sendable` conformance to `BitSet` protocol.
Added `Sendable` conformance to `BitSetAdapter`.
Added `Sendable` conformance to `Key`.
Added `Sendable` conformance to `Note`.
Added `Sendable` conformance to `Note.MiddleCStandard`.
Added `Sendable` conformance to `Octave`.
Added `Sendable` conformance to `Pitch`.
Added `Sendable` conformance to `PitchColor`.
Changed static variable to static constant, as it shouldn't be mutable.
Changed remaining `NoteClass` static variable "shortcuts" to static constants. This ensures that they're concurrency-safe. They shouldn't be mutable anyway.
Changed remaining `Chord` static variable "shortcuts" to static constants. This ensures that they're concurrency-safe. They shouldn't be mutable anyway.
Changed remaining `Note` static variable "shortcuts" to static constants. This ensures that they're concurrency-safe. They shouldn't be mutable anyway.

/// B♭ Major
static var Bb = Chord(.Bb, type: .major)
static let Bb = Chord(.Bb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bb' (identifier_name)


/// A♭ Major
static var Ab = Chord(.Ab, type: .major)
static let Ab = Chord(.Ab, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ab' (identifier_name)


/// G♭ Major
static var Gb = Chord(.Gb, type: .major)
static let Gb = Chord(.Gb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Gb' (identifier_name)


/// F♭ Major
static var Fb = Chord(.Fb, type: .major)
static let Fb = Chord(.Fb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Fb' (identifier_name)


/// E♭ Major
static var Eb = Chord(.Eb, type: .major)
static let Eb = Chord(.Eb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Eb' (identifier_name)


/// E♯ Major
static var Es = Chord(.Es, type: .major)
static let Es = Chord(.Es, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Es' (identifier_name)


/// D♯ Major
static var Ds = Chord(.Ds, type: .major)
static let Ds = Chord(.Ds, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ds' (identifier_name)


// MARK: - Sharp Major chords

/// C♯ Major
static var Cs = Chord(.Cs, type: .major)
static let Cs = Chord(.Cs, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Cs' (identifier_name)


/// B Minor
static var Bm = Chord(.B, type: .minor)
static let Bm = Chord(.B, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bm' (identifier_name)


/// A Minor
static var Am = Chord(.A, type: .minor)
static let Am = Chord(.A, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Am' (identifier_name)


/// B♭ Major
static var Bb = Chord(.Bb, type: .major)
static let Bb = Chord(.Bb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bb' (identifier_name)


/// A♭ Major
static var Ab = Chord(.Ab, type: .major)
static let Ab = Chord(.Ab, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ab' (identifier_name)


/// G♭ Major
static var Gb = Chord(.Gb, type: .major)
static let Gb = Chord(.Gb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Gb' (identifier_name)


/// F♭ Major
static var Fb = Chord(.Fb, type: .major)
static let Fb = Chord(.Fb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Fb' (identifier_name)


/// E♭ Major
static var Eb = Chord(.Eb, type: .major)
static let Eb = Chord(.Eb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Eb' (identifier_name)


/// E♯ Major
static var Es = Chord(.Es, type: .major)
static let Es = Chord(.Es, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Es' (identifier_name)


/// D♯ Major
static var Ds = Chord(.Ds, type: .major)
static let Ds = Chord(.Ds, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ds' (identifier_name)


// MARK: - Sharp Major chords

/// C♯ Major
static var Cs = Chord(.Cs, type: .major)
static let Cs = Chord(.Cs, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Cs' (identifier_name)


/// B Minor
static var Bm = Chord(.B, type: .minor)
static let Bm = Chord(.B, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bm' (identifier_name)


/// A Minor
static var Am = Chord(.A, type: .minor)
static let Am = Chord(.A, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Am' (identifier_name)


/// B♭ Major
static var Bb = Chord(.Bb, type: .major)
static let Bb = Chord(.Bb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bb' (identifier_name)


/// A♭ Major
static var Ab = Chord(.Ab, type: .major)
static let Ab = Chord(.Ab, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ab' (identifier_name)


/// G♭ Major
static var Gb = Chord(.Gb, type: .major)
static let Gb = Chord(.Gb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Gb' (identifier_name)


/// F♭ Major
static var Fb = Chord(.Fb, type: .major)
static let Fb = Chord(.Fb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Fb' (identifier_name)


/// E♭ Major
static var Eb = Chord(.Eb, type: .major)
static let Eb = Chord(.Eb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Eb' (identifier_name)


/// E♯ Major
static var Es = Chord(.Es, type: .major)
static let Es = Chord(.Es, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Es' (identifier_name)


/// D♯ Major
static var Ds = Chord(.Ds, type: .major)
static let Ds = Chord(.Ds, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ds' (identifier_name)


// MARK: - Sharp Major chords

/// C♯ Major
static var Cs = Chord(.Cs, type: .major)
static let Cs = Chord(.Cs, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Cs' (identifier_name)


/// B Minor
static var Bm = Chord(.B, type: .minor)
static let Bm = Chord(.B, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bm' (identifier_name)


/// A Minor
static var Am = Chord(.A, type: .minor)
static let Am = Chord(.A, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Am' (identifier_name)


/// B♭ Major
static var Bb = Chord(.Bb, type: .major)
static let Bb = Chord(.Bb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bb' (identifier_name)


/// A♭ Major
static var Ab = Chord(.Ab, type: .major)
static let Ab = Chord(.Ab, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ab' (identifier_name)


/// G♭ Major
static var Gb = Chord(.Gb, type: .major)
static let Gb = Chord(.Gb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Gb' (identifier_name)


/// F♭ Major
static var Fb = Chord(.Fb, type: .major)
static let Fb = Chord(.Fb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Fb' (identifier_name)


/// E♭ Major
static var Eb = Chord(.Eb, type: .major)
static let Eb = Chord(.Eb, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Eb' (identifier_name)


/// E♯ Major
static var Es = Chord(.Es, type: .major)
static let Es = Chord(.Es, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Es' (identifier_name)


/// D♯ Major
static var Ds = Chord(.Ds, type: .major)
static let Ds = Chord(.Ds, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Ds' (identifier_name)


// MARK: - Sharp Major chords

/// C♯ Major
static var Cs = Chord(.Cs, type: .major)
static let Cs = Chord(.Cs, type: .major)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Cs' (identifier_name)


/// B Minor
static var Bm = Chord(.B, type: .minor)
static let Bm = Chord(.B, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Bm' (identifier_name)


/// A Minor
static var Am = Chord(.A, type: .minor)
static let Am = Chord(.A, type: .minor)
Copy link

Choose a reason for hiding this comment

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

Identifier Name Violation: Variable name should be between 3 and 40 characters long: 'Am' (identifier_name)

@aure aure merged commit f09391f into AudioKit:main Jun 3, 2025
4 checks passed
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