![]() |
![]() ![]() ![]() ![]() ![]()
|
next newest topic | next oldest topic |
Author | Topic: arays of arrays in InputOutputCharacteristic |
HectorBenard Member |
![]() ![]() ![]() In the OutValues field of an InputOutputCharacteristic I would like to be able to have several arrays with different tunings such as the following: {(1 to: 14) collect: [ :i | (((i * 1/8) + (!Offset - 24)) / 12.0) twoExp - 1]} " 16ths of a tone"
{#(0 2 4 5 5 5 7 9 9 9 11 12 13 13) collect: [ :i | (((i ) + (!Offset - 24)) / 12.0) twoExp - 1]}" "Major, biased subdominant"
{!Mode of: #( {first array above}
[This message has been edited by HectorBenard (edited 19 April 2006).] IP: Logged |
SSC Administrator |
![]() ![]() ![]() You can do it, but you have to turn the arrays around: create one array of 14 where each element selects one of the three possibilities. Here is one possible solution (not tested in Kyma, so there may be small syntax errors): {| a1 a2 a3 | a1 := (1 to: 14) collect: [ :i | (((i * 1/8) + (!Offset - 24)) / 12.0) twoExp - 1]. "16ths of a tone" a2 := #(0 0 2 4 4 4 5 7 7 7 9 11 12 12) collect: [ :i | ((i + (!Offset - 24)) / 12.0) twoExp - 1]}. "Major, biased Tonic" a3 := #(0 2 4 5 5 5 7 9 9 9 11 12 13 13) collect: [ :i | ((i + (!Offset - 24)) / 12.0) twoExp - 1]. "Major, biased subdominant" (1 to: a1 size) collect: [ :i | !Mode of: (Array with: (a1 at: i) with: (a2 at: i) with: (a3 at: i))]}
IP: Logged |
HectorBenard Member |
![]() ![]() ![]() Thanks! I thought it might require something like that. I understand what the idea is, but It still doesn't work, and I can't figure out why... Oh wait, I just found it! Just an extra curly bracket in the second line. Works like a charm now! Thanks so much, this is great! I'll upload the final patch in the twiki eventually. H IP: Logged |
All times are CT (US) | next newest topic | next oldest topic |
![]() ![]() |
This forum is provided solely for the support and edification of the customers of Symbolic Sound Corporation.