Page 1 of 1

Modifying Radial Step Sequencer draw() function

Posted: 30 Oct 2014 22:35
by Traxus
I'm re purposing the radial step sequencer factory template, to play like a monophonic pad setup.

I've done all the easy stuff, it tracks multi touch successfully, has a memory bank to revert to the last held pad in order etc... (try holding several pads, then release one finger at a time)

However I'm learning that I can't (yet) draw to save my life.

As it stands, the steps/pads generate starting from the 3 oclock position, going clockwise. So, pad 0 starts at 3 oclock.

I want pad 0 to be at the top, starting from 12 oclock; I can't quite sort how the draw() function decides to start where it does nor how to adjust it 90 degrees counter clockwise...


EDIT, also can't attach the file to the forum, ('Sorry, the board attachment quota has been reached.') do a right click and save link as below:

http://traxusinteractive.com/modded_radial_3.jzml

Re: Modifying Radial Step Sequencer draw() function

Posted: 31 Oct 2014 05:50
by Macciza
Hi
I may have a solute somewhere from the ARC stuff i did a while back . .
Or may be able to nut something out . . . Cant recall exactly what i did ...
You can't just rotate the canvas because you also need to rotate the logic...
Will have a look and get back to you . . .
MM

Re: Modifying Radial Step Sequencer draw() function

Posted: 31 Oct 2014 15:53
by Traxus
Yeah i was fooling around with the sin and cos values, ended up with a lot of concave polygons etc...

It is sloppy, but for now I just wrote some parser logic...

I was able to calculate that, regardless of the number of switches, the switch at the 12 oclock position was typically this value:

Code: Select all

offset = floor(Steps.s_switches *.75)
with that in mind using some conditionals and math, I wrote two functions, translateRawToOffset() to change the output such that 12 oclock pad would feed 0, and translateOffsetToRaw() which would do the inverse in case i wanted to set a value from outside the object.