Commit b43abe5
committed
BREAKING CHANGE: Change behaviour of invert_chord
This commit does two things:
a) Guards against an error calling rings with out of range index
ranges
b) Makes a breaking change to the behaviour of negative inversions
Prior to this, the implementation of `invert_chord`, when given an
argument of say -1 for the no. of inversions would do this:
```
puts invert_chord([60, 64, 67], -1) # => [64,67,48]
puts invert_chord([60, 64, 67], -2) # => [67,48,52]
```
Musically speaking, it makes more sense to move the top voice down an
octave first, so that the chord is voiced as closely together as
possible i.e. `[:g3, :c4, :e4]` - this voicing is skipped over by the
previous implementation.
See added tests for more details.1 parent 61a8dd4 commit b43abe5
File tree
2 files changed
+46
-2
lines changed- app/server/sonicpi
- lib/sonicpi/mods
- test
2 files changed
+46
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2723 | 2723 | | |
2724 | 2724 | | |
2725 | 2725 | | |
2726 | | - | |
| 2726 | + | |
2727 | 2727 | | |
2728 | | - | |
| 2728 | + | |
2729 | 2729 | | |
2730 | 2730 | | |
2731 | 2731 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
0 commit comments