General

Rotate stepnote patterns

Started by ChiLam on .

Sign in or create an account to join the conversation.

13 posts

Topic starter
Hi,

I'm wondering if it is possible to shift/rotate the stepnote patterns using a script?

I'm looking to add a button which will move the entire stepnote pattern one step to the right/left but don't seem to find a way to achieve this - any ideas guys? ;)

I'm guessing that the StepNote object is built as an array but I can't find any details in the editor relating to this!
Wow, thank you so much! I shall study this immediatley - i'm guessing from your advice that I will need to modify to allow the pattern to "wrap-around" without falling off?

Again, thank you very much!

Ok! Have tested and understood - great work - unfortunatley I cannot seem to fathom the way to "rotate" the steps so they don't dissappear!?
OOf - I tried all night to find a way to make the pattern wrap-around on itself with no joy :cry:

Its pretty darn hard for a total newb to understand all the programming jargon. Thanks to ndivuyo i'm tantalisingly close to realising the step-sequencer I desire but I need to get this wrap-around business done - desperatley! Hey, i'd be more than happy to pay for someone to help me out on this - I realise that it takes time and effort and brains to be good at this programming lark and i'm failing miserably.

I found this script posted by another Lemur master called Macciza but cannot for the life of me make it work!


Heres a script for shifting
shift(array, val) Manual Trigger

decl len = sizeof(array);
val = val % len;
if(val>0) array={subarray(array,len-val,val),subarray(array,0,len-val)};
if(val<0) array={subarray(array,abs(val),len-abs(val)),subarray(array,0,abs(val))};
return array;
Hey ,
I'll take a look at it in a bit, so you need the pattern to repeat starting at the opposite end it moves off of (wrapping around)?
Unless another kind user helps you out, I'll see if I can put something together later, I'm not sure but if the StepNote object had a 'z' value it would probably be easier, I haven't thought about it much yet.
expect to hear back..
Hey big thanks for helping!

I have nearly managed - would you believe it! It works but only when going to the left! I can't seem to make it work going to the right though, which is strange since the script for both is identical apart from one plus/minus sign?

here is the template - massive thanks again, this is killing me it is so close!

RotateStepNote.jzml
Thanks - much appreciated! Ill take a look and see but I doubt ill be able to solve this puzzler alone, Im too much of a newb unfortunately but ill give it a go.

Seems odd that it goes ok in one direction but not the other?

Thanks again kind sir!
Nice one! Solved!

Thanks so much for your help - I enjoyed seeing the template come back noticeably more streamlined and of a smaller size he he!

It all got fixed by changing the line from:

StepNote.x = subarray(vals,1-i,N);

to:

StepNote.x = subarray(vals,abs(1-i),N);

I have no idea what this means but it worked and I am a happy happy man! Could not have done it without your help so thanks a million! :D


AAAArghhh! No it doesn't work! I should have tested more - back to it then :cry:
Hi
Here is a version using the above shift script,
Just read through the logic of the script
If it larger then 0 the script subarrays the array one way ,if less then 0 it does it differently
If you look at the subarray stuff you will see it is merely reassembling the original array based on the input number
In the switches i have merely used 1 and -1 but it could be any number to shift larger amounts ..

Cheers

RotateStepNote_mac.jzml