-
Notifications
You must be signed in to change notification settings - Fork 22
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
Save pitch name in Note
struct.
#165
Comments
I don't think this helps. There is a simple function for obtaining the pitch name out of the pitch field. The note structure should remain as is to directly parallelize the actual MIDI information which are these UInt8 numbers. |
It is important to associate note pitch and note name. Notes(" G♭ A♭ B♭ C♭ D♭ E♭ F") But if we want to print this melody pitch, it will print F sharp scale "F♯ G♯ A♯ B C♯ D♯ E♯". This makes music analysis very difficult. |
Okay, I see your point. Yes, I agree with the suggestion of a new struct |
My question is: Now we have written so many useful functions for |
well all functions that have been written for |
Sometimes converting between |
Yes, I think so... I will think carefully. |
abstract type AbstractNote end
abstract type AbstractExtendNote <: AbstractNote end
struct Note <: AbstractNote
# note fields
nf::nf_type
end
struct NamedNote <: AbstractExtendNote
n::Note
name:: String
end
struct WhatEverNote <: AbstractExtendNote
n::Note
p::p_type
end
#existed functions
f!(x::AbstractNote) = ...
f!(x::AbstractExtendNote) = f!(x.n)
julia> Cflat4 = Note("Cb4")
#B3 print
julia> namedCflat4 = NamedNote(Note("Cb4"), "Cb4")
#Cflat4 print What do you think? |
|
Is your feature request related to a problem? Please describe.
If we initialize a Note with pitch name with flat:
But in some cases, we want to save exact pitch name
Bb4
/Describe the solution you'd like
Add field pitch name in Note struct and change implementation in some constructors.
If you like this idea I will open a PR.
The text was updated successfully, but these errors were encountered: