Skip to content

Commit

Permalink
put Rectangle in function
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Nov 12, 2019
1 parent dafe426 commit d5c7192
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MusicVisualizations"
uuid = "8e838768-4b4f-4130-9d6d-43f7b35ca0d6"
repo = "https://github.com/JuliaMusic/MusicVisualizations.jl.git"
version = "0.2.0"
version = "0.2.1"

[deps]
DefaultApplication = "3f0dd361-4fe0-5fc6-8523-80b14ec94d85"
Expand All @@ -14,7 +14,7 @@ Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
julia = "1.1"
MusicManipulations = "1.0"
DefaultApplication = "0.1"
PyPlot = "2.8.1"
PyPlot = "2.8.2"
Reexport = "0.2, 0.3, 1.0"


Expand Down
4 changes: 2 additions & 2 deletions src/MusicVisualizations.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module MusicVisualizations

using PyPlot, DefaultApplication
using Reexport
@reexport using MusicManipulations
using PyPlot, DefaultApplication

include("musescore.jl")
include("noteplotter.jl")
include("musescore.jl")

end
7 changes: 4 additions & 3 deletions src/noteplotter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ export noteplotter
maxnotevel(::Note) = 127
maxnotevel(::MoreVelNote) = 157

Rectangle = PyPlot.matplotlib.patches.Rectangle
function plotpianonote!(ax, note, cmap)
r = Rectangle((note.position, note.pitch - 0.5), note.duration, 1,
color = cmap(note.velocity/maxnotevel(note)))
r = PyPlot.matplotlib.patches.Rectangle(
(note.position, note.pitch - 0.5), note.duration, 1,
color = cmap(note.velocity/maxnotevel(note))
)
ax.add_artist(r)
return note.pitch
end
Expand Down

2 comments on commit d5c7192

@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/5325

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 v0.2.1 -m "<description of version>" d5c719217ec8614dd91afee36a8f58bff981d240
git push origin v0.2.1

Please sign in to comment.