Skip to content

Commit

Permalink
Remove 960 ticks upper limit for tpq. (#122)
Browse files Browse the repository at this point in the history
* Remove 960 ticks upper limit for tpq.

Remove 960 ticks upper limit for tpq, add tpq keyword argument for `Notes()` constructor function.

* Update note.jl

* add changelog entry
  • Loading branch information
CNelias authored and Datseris committed Dec 16, 2019
1 parent 0c2aa1e commit cf99e27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
# v1.7.0
* Notes constructor allows values of `tpq` greater than `960`.
# v1.6.0
* New function `testnotes()` that returns a test set of human-played notes.
# v1.5.2
Expand Down
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.6.0"
version = "1.7.0"

[compat]
julia = "1"
Expand Down
6 changes: 3 additions & 3 deletions src/note.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ end

# Constructors for Notes:
function Notes(notes::Vector{N}, tpq::Int = 960) where {N <: AbstractNote}
if tpq < 1 || tpq > 960
throw(ArgumentError("Ticks per quarter note (tpq) must ∈ [1, 960]"))
if tpq < 1
throw(ArgumentError("Ticks per quarter note (tpq) must be >= 1"))
end
Notes{N}(notes, tpq)
end

Notes() = Notes{Note}(Vector{Note}[], 960)
Notes(; tpq = 960) = Notes{Note}(Vector{Note}[], tpq)

# Iterator Interface for notes:
Base.iterate(n::Notes) = iterate(n.notes)
Expand Down

2 comments on commit cf99e27

@Datseris
Copy link
Member

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/6790

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.7.0 -m "<description of version>" cf99e27a519ccbbf729c6ca078a8fed94a6137e5
git push origin v1.7.0

Please sign in to comment.