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

Remove 960 ticks upper limit for tpq. #122

Merged
merged 3 commits into from
Dec 16, 2019
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
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