First time here? Check out the FAQ!
x

Create an array using transposebySteps: ScaleIndex: tonic:

0 votes
449 views

Hi

I'm trying to generate an array of 64 values where each value is either a 1 or 0 based on whether the note number is within a scale or not.  

My plan was to use the following:

{(1 to: 64) collect: [:i | i eq: (i transposeBySteps: !TransposeBy scaleIndex: !ScaleIndex012 tonic: !Tonic)]} 

But this throws the hotvariable cannot perform transposePitchBySteps error.  I also tried with i eq: i nn transposeBySteps but this also doesn't work. 

If i use the evaluate function on the "!aPitch transposeBySteps: !TrspScaleSteps0 scaleIndex: !ScaleIndex012 tonic: !aNoteNumber" capytalk help function and substitue !aPitch with values that would be represented by i (e.g. 1, 2, 3, 4, 5 ....) it does work as I'd expect.  

Where am I going wrong please?

PS. My plan is to use this to send 64 values to my monome Arc ring LEDs so that as i change !ScaleIndex012 value different segment LEDs light up to indicate the values that are in or out of the scale.

Edit: Ok, I figured out that I can't use 'i' as the variable for transposeBySteps, it has to be a hotvalue or a number.  So I tried:

{(1 to: 64) collect: [:i| 
i eq: ((!Pitch suffix: i) transposeBySteps: 0 scaleIndex: !ScaleIndex012 tonic: 0)]}

Chaging the generated !Pitch fader values to matching number (e.g. !Pitch 4 to 4) should then work (it does in the capytalk help).  

 

asked Jul 28, 2020 in Capytalk & Smalltalk by ghood (Master) (3,060 points)
edited Jul 28, 2020 by ghood
Assuming you have an array of 1's and 0's how are you planning to send this to the Monome Arc? I suspect you might need 64 SoundToGlobalControllers.
Hi Alan, I'm using the NEL Send OSC prototype in this instance that lets me put this array directly into the input.  I suspect internally it works by generating 64 STGC but it's a neat encapsulated way of working.  These 64/128 messages required by monome Arc/Grid to turn on their lights work well with the WireFrame approach also so there are lots of cool ways of visualising your sounds/frames (I'm a sucker for flashing lights!)

1 Answer

+1 vote

Thanks, there was a problem in transposeBySteps:.. where it would not work when sent to a constant. This has been fixed and you will see it in the next software update (soon). You should change it to removeUnits, so you can compare it to the value of i. You should use 0 as the value of !TransposeBy.

{(1 to: 64) collect: [:i | i eq: (i transposeBySteps: !TransposeBy scaleIndex: !ScaleIndex012 tonic: !Tonic) removeUnits]} 

Thanks for the report.

answered Jul 29, 2020 by ssc (Savant) (128,000 points)
Aha! Fantastic, glad it wasn't me then!  Look forward to the fix.  
Cheers
...