Skip to content
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

Rename note -> pitch #8

Merged
merged 1 commit into from
Jan 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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