Skip to content

Add modulo to Row struct, allowing rows to have a modulo value other …#1

Open
mikowitz wants to merge 8 commits intomasterfrom
non-12-modulo
Open

Add modulo to Row struct, allowing rows to have a modulo value other …#1
mikowitz wants to merge 8 commits intomasterfrom
non-12-modulo

Conversation

@mikowitz
Copy link
Owner

@mikowitz mikowitz commented Jul 16, 2017

…than 12

Webern.row([0, 1, 2, 3, 4, 5], modulo: 9) is now valid syntax.

The modulo of a row is based on either the value passed in to the keyword list, or the highest value in the row itself. When the modulo argument is not present, it will be set to the highest value in the row + 1. This works best with integral-based rows. Rows using non-integral values (quarter tones, Hz, or other non-dodecaphonic scales) should specify their modulo to avoid unexpected transformations.

New usage:

Webern.row([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]) #=> modulo 12 (11 + 1)
Webern.row([0, 1, 2, 3, 4, 5]) #=> modulo 6 (5 + 1)
Webern.row([0, 1, 2, 3, 4, 5], modulo: 7) #=> modulo 7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant