Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Actually check in the modified BrokenRhythm I've been using locally f…

…or weeks.
  • Loading branch information...
commit b113637025d2780e83537fe1fdbd365a584988b7 1 parent d069718
@colomon authored
Showing with 7 additions and 8 deletions.
  1. +7 −8 lib/ABC/BrokenRhythm.pm
View
15 lib/ABC/BrokenRhythm.pm
@@ -16,20 +16,19 @@ class ABC::BrokenRhythm does ABC::Duration {
:ticks($stem1.ticks + $stem2.ticks));
}
- my method broken-factor() {
+ method broken-factor() {
1 / 2 ** $.broken-rhythm.chars.Int;
}
- my method broken-direction-forward() {
+ method broken-direction-forward() {
$.broken-rhythm ~~ /\>/;
}
- my multi sub new-rhythm(ABC::Note $note, $ticks) {
- ABC::Note.new($note.pitch, ABC::Duration.new(:$ticks), $note.is-tie);
- }
-
- my multi sub new-rhythm(ABC::Stem $stem, $ticks) {
- ABC::Stem.new($stem.notes.map({ new-rhythm($_, $ticks); }));
+ sub new-rhythm($note, $ticks) {
+ given $note {
+ when ABC::Note { ABC::Note.new($note.pitch, ABC::Duration.new(:$ticks), $note.is-tie); }
+ when ABC::Stem { ABC::Stem.new($note.notes.map({ new-rhythm($_, $ticks); })); }
+ }
}
method effective-stem1() {
Please sign in to comment.
Something went wrong with that request. Please try again.