Skip to content

Commit

Permalink
Rename note -> pitch (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpsanders authored Jan 1, 2024
1 parent 89580c2 commit 39ecef0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/MusicTheory.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module MusicTheory

export Pitch, PitchClass, Accidental, NoteNames
export Pitch, PitchClass, Accidental, PitchNames
export ♮, ♯, ♭, 𝄪, 𝄫
export accidental, octave

Expand All @@ -18,8 +18,8 @@ export Chord
export make_triad, is_triad


include("notes.jl")
include("note_names.jl")
include("pitches.jl")
include("pitch_names.jl")
include("intervals.jl")
include("scales.jl")
include("chords.jl")
Expand Down
6 changes: 3 additions & 3 deletions src/note_names.jl → src/pitch_names.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

module NoteNames
module PitchNames

using MusicTheory:
C, D, E, F, G, A, B,
Expand All @@ -23,11 +23,11 @@ const middle_C = C[4]
end


module AllNoteNames
module AllPitchNames

using MusicTheory: note_names, Pitch, PitchClass, Accidental

using MusicTheory.NoteNames
using MusicTheory.PitchNames

for note in note_names, octave in 0:9
name = Symbol(note, octave)
Expand Down
2 changes: 1 addition & 1 deletion src/notes.jl → src/pitches.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end

# default is natural:
PitchClass(name::Symbol) = PitchClass(name, ♮)
# Base.convert(::Type{PitchClass}, noteclass::NoteNames) = PitchClass(noteclass, ♮)
# Base.convert(::Type{PitchClass}, noteclass::PitchNames) = PitchClass(noteclass, ♮)

subscript(i::Int) = '' + i

Expand Down
2 changes: 1 addition & 1 deletion test/notes.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using MusicTheory.NoteNames
using MusicTheory.PitchNames

@testset "Notes" begin
note = C[4]
Expand Down
2 changes: 1 addition & 1 deletion test/triads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
end

@testset "Triads with names" begin
using MusicTheory.AllNoteNames
using MusicTheory.AllPitchNames

@test is_triad(C4, E5, A8)
end

0 comments on commit 39ecef0

Please sign in to comment.