-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Distinguish between 1/4, 1/2 and 1 duration. Add accidentals
- Loading branch information
Showing
3 changed files
with
59 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# MusicMakie | ||
|
||
[![Build Status](https://github.com/dpsanders/MusicMakie.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/dpsanders/MusicMakie.jl/actions/workflows/CI.yml?query=branch%3Amain) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,43 @@ | ||
using Revise, MusicTheory, MusicTheory.PitchNames | ||
using CairoMakie, MusicMakie | ||
|
||
# scale = Scale(C[4], major_scale) | ||
scale = Scale(E[3], major_scale) | ||
function draw_scale() | ||
|
||
pitches = Base.Iterators.take(scale, 3*8-1) |> collect | ||
# scale = Scale(C[4], major_scale) | ||
scale = Scale(E[3], major_scale) | ||
|
||
pitches = Base.Iterators.take(scale, 2*8-1) |> collect | ||
notes = pitches ./ 1 | ||
|
||
fig, ax = make_canvas() | ||
fig, ax = make_canvas() | ||
|
||
s = Stave(0, 30, 0, 0.5) | ||
s = Stave(0, 30, 0, 0.5) | ||
|
||
sc = StaveWithClef(s, treble_clef) | ||
sc = StaveWithClef(s, treble_clef) | ||
|
||
draw!(ax, sc) | ||
draw!(ax, sc) | ||
draw!(ax, sc, notes, x0=3, w = 1.1) | ||
|
||
@show notes | ||
|
||
draw!(ax, sc, pitches, x0=3, w = 1.1) | ||
fig | ||
end | ||
|
||
fig | ||
draw_scale() | ||
|
||
|
||
function scale_notes(p::Pitch) | ||
scale = Scale(p, natural_minor_scale) | ||
# function scale_notes(p::Pitch) | ||
# scale = Scale(p, natural_minor_scale) | ||
|
||
pitches = Base.Iterators.take(scale, 3*8-1) |> collect | ||
# pitches = Base.Iterators.take(scale, 3*8-1) |> collect | ||
|
||
return pitches | ||
end | ||
# return pitches | ||
# end | ||
|
||
# scale_notes(C[4]) | ||
|
||
scale_notes(C[4]) | ||
|
||
|
||
fig | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters