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

Named note #65

Merged
merged 11 commits into from
Jun 2, 2023
Merged

Named note #65

merged 11 commits into from
Jun 2, 2023

Conversation

NeroBlackstone
Copy link
Member

Related issue

Copy link
Member

@Datseris Datseris left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of also updating the code base. I've left some comments to improve NamedNote. Note that tests fail. I suspect its because you use DataStructures but haven't added it to Project.toml.

src/namednote.jl Outdated
"""
mutable struct NamedNote <: AbstractNote
name::String
pitch::UInt8
Copy link
Member

Choose a reason for hiding this comment

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

Pitch shouldn't exist. If you ever need it to compute equallity, compute it on the spot from name.

Project.toml Outdated
@@ -1,10 +1,11 @@
name = "MusicManipulations"
uuid = "274955c0-c284-5bf7-b122-5ecd51c559de"
repo = "https://github.com/JuliaMusic/MusicManipulations.jl.git"
version = "1.6.3"
version = "1.6.4"
Copy link
Member

Choose a reason for hiding this comment

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

1.7 instead.

src/namednote.jl Outdated

NamedNotes(notes_string::String; tpq::Int = 960) = Notes([NamedNote(String(s)) for s in split(notes_string," ")], tpq)

Note(n::NamedNote) = Note(n.pitch, n.position, n.velocity, n.duration, n.channel)
Copy link
Member

Choose a reason for hiding this comment

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

same; don't use pitch, compute it on the spot.

src/scale.jl Show resolved Hide resolved
Project.toml Show resolved Hide resolved
@NeroBlackstone
Copy link
Member Author

I can't finish the test since I don't have a macos device.

NamedNote(n::Note; pitch_name::String = "") =
length(pitch_name) == 0 ? NamedNote(pitch_to_name(n.pitch), n.position, n.velocity, n.duration, n.channel) : NamedNote(name, n.position, n.velocity, n.duration, n.channel)

NamedNotes(notes_string::String; tpq::Int = 960) = Notes([NamedNote(String(s)) for s in split(notes_string," ")], tpq)
Copy link
Member

Choose a reason for hiding this comment

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

This function does not have a documentation string!

Comment on lines 17 to 19
cn = Note("C#4")
nn3 = NamedNote(cn)
@test nn3.name == "C♯4"
Copy link
Member

Choose a reason for hiding this comment

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

This test is unecessary, you already do the same test in the start of the test suite. Instead, write a test that compares a NamedNote with a Note generated from it and vice versa.

@Datseris
Copy link
Member

Datseris commented Jun 1, 2023

This test failed on windows now: https://github.com/JuliaMusic/MusicManipulations.jl/actions/runs/5146154049/jobs/9264791892?pr=65#step:7:172 and before that it failed on MacOS. Something weird is going on here...

@codecov-commenter
Copy link

codecov-commenter commented Jun 1, 2023

Codecov Report

Merging #65 (76bfa06) into master (807728e) will increase coverage by 0.56%.
The diff coverage is 62.96%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master      #65      +/-   ##
==========================================
+ Coverage   51.21%   51.78%   +0.56%     
==========================================
  Files          10       12       +2     
  Lines         410      477      +67     
==========================================
+ Hits          210      247      +37     
- Misses        200      230      +30     
Impacted Files Coverage Δ
src/MusicManipulations.jl 100.00% <ø> (ø)
src/specific_modules/drums.jl 0.00% <0.00%> (ø)
src/specific_modules/jazz.jl 0.00% <0.00%> (ø)
src/namednote.jl 65.21% <65.21%> (ø)
src/quantize.jl 82.08% <100.00%> (-0.17%) ⬇️
src/scale.jl 85.71% <100.00%> (+1.50%) ⬆️

... and 6 files with indirect coverage changes

@NeroBlackstone
Copy link
Member Author

This test failed on windows now: https://github.com/JuliaMusic/MusicManipulations.jl/actions/runs/5146154049/jobs/9264791892?pr=65#step:7:172 and before that it failed on MacOS. Something weird is going on here...

emmm... The only change in data_extraction.jl is update legacy readMIDIFile() to load()

@NeroBlackstone
Copy link
Member Author

Commit nothing try to re-run ci test, and all passed.
I think some bugs in data_extraction test, but I'm not sure it is caused by my code change.

Copy link
Member

@Datseris Datseris left a comment

Choose a reason for hiding this comment

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

Great, seems good. Can you please also add an entry in the CHANGELOG.md file?

@NeroBlackstone
Copy link
Member Author

Great, seems good. Can you please also add an entry in the CHANGELOG.md file?

Done!

If you have more time please help me review this issue, Thank you very much.

@Datseris Datseris merged commit fefe123 into JuliaMusic:master Jun 2, 2023
3 checks passed
@NeroBlackstone NeroBlackstone deleted the NamedNote branch June 2, 2023 13:05
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.

None yet

3 participants