Skip to content

Commit

Permalink
add copy(::Note), remove undocumented +/-
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Jun 28, 2019
1 parent de46f16 commit 9b1b461
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MIDI"
uuid = "f57c4921-e30c-5f49-b073-3f2f2ada663e"
repo = "https://github.com/JuliaMusic/MIDI.jl.git"
version = "1.4.0"
version = "1.4.1"

[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Expand Down
9 changes: 3 additions & 6 deletions src/note.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,16 @@ end

import Base.+, Base.-, Base.==

+(n::Note, i::Integer) = Note(n.pitch + i, n.duration, n.position, n.channel, n.velocity)
+(i::Integer, n::Note) = n + i

-(n::Note, i::Integer) = Note(n.pitch - i, n.duration, n.position, n.channel, n.velocity)
-(i::Integer, n::Note) = n - i

==(n1::Note, n2::Note) =
n1.pitch == n2.pitch &&
n1.duration == n2.duration &&
n1.position == n2.position &&
n1.channel == n2.channel &&
n1.velocity == n2.velocity

Base.copy(n::N) where {N<:AbstractNote} =
N(n.pitch, n.velocity, n.position, n.duration, n.channel)

"""
Notes{N<:AbstractNote}
Data structure describing a collection of "music notes", bundled with a ticks
Expand Down

4 comments on commit 9b1b461

@Datseris
Copy link
Member Author

Choose a reason for hiding this comment

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

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/1620

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:

git tag -a v1.4.1 -m "<description of version>" 9b1b46170fcae893596c170f54256a5d6f8bdcfc
git push origin v1.4.1

Also, note the warning: Version 1.4.1 skips over 1.4.0
This can be safely ignored. However, if you want to fix this you can do so. Call register() again after making the fix. This will update the Pull request.

@JeffBezanson
Copy link

Choose a reason for hiding this comment

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

+ and - are tested. This breaks this package's tests.

@Datseris
Copy link
Member Author

Choose a reason for hiding this comment

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

Ops, sorry about this sloppiness. Fixed here: 93e2e4f

Please sign in to comment.