This forum is read-only. Please post new topics in our Q&A forum.

Pattern Scene Matrix Variables

General discussion about MIDI Translator

Moderators: florian, DvlsAdvct

Post Reply
bobbyquine
Power User
Posts: 20
Joined: Mon Nov 12, 2012 3:36 pm

Pattern Scene Matrix Variables

Post by bobbyquine » Tue Nov 20, 2012 1:32 pm

Hi Jared,

OK another quick question....

If I'm going to set up a 'matrix memory' in MT storing the pattern states (1-8) of 8 tracks for 8 scenes, is there any way to NOT use up 64 globals, some clever formulae or technique....
Actually just realized you could double up in the variables if your working with only 8's, so 32 globals spoken for... Still I'd like to know if I'm missing something...

Thanks again for all your help, even quick confirmations of things like this really help to not waste time and start working on the right things.

Cheers

B

DvlsAdvct
Bome Software: Partner
Posts: 1351
Joined: Fri May 09, 2008 5:07 pm

Re: Pattern Scene Matrix Variables

Post by DvlsAdvct » Tue Nov 20, 2012 1:59 pm

Well, you can use 8 variables, one for each track in each scene.

Instead of g1=1, g2=2, g3=1, etc. you can use g1=1, g1=2, g1=3, g1=4, etc. and then just use 8 to store each track's current value.

Make sense?

bobbyquine
Power User
Posts: 20
Joined: Mon Nov 12, 2012 3:36 pm

Re: Pattern Scene Matrix Variables

Post by bobbyquine » Tue Nov 20, 2012 2:07 pm

Ok, I'm not sure If I'm getting it...

Will this mean that the matrix is still storing all pattern combinations for all scenes, not just the current state? Sorry If I wasn't clear.

I need to do this in order to keep Maschine LED states consistent with Geist, which doesn't provide feedback.

If it does still do that I need to get my head around it!

Thanks again

B

metastatik
Power User
Posts: 61
Joined: Wed Sep 26, 2007 6:02 pm

Re: Pattern Scene Matrix Variables

Post by metastatik » Tue Nov 20, 2012 6:54 pm

It’s possible to have a variable store more than one value or state (on/off), but this is somewhat complex as it involves bit manipulation. In short, the value a variable stores can be represented as a series of bits (like 0 0 0 0 1 0 0 0), which we can manipulate individually. Here’s an example of storing the first state in a multiple state variable.

Code: Select all

ga=ga^1
This toggles the first state/bit in ga’s value.

From other translators you can check if the first state/bit has been set like so:

Code: Select all

rr=ga&1
if rr!=1 then exit rules, skip Outgoing Action
The rules for the successive states look very similar. The values used in each state will be double that of the previous state. So the third state would look like this:

Code: Select all

ga=ga^4
And this:

Code: Select all

rr=ga&4
if rr!=4 then exit rules, skip Outgoing Action
As a side note, it’s always a good idea to initialize your global variables at the start of a project, but it’s absolutely essential here. To do that, create a translator with input type Special and select the project load option. In the rules, just list each variable you use and give it a default value (like ga=0).
Last edited by metastatik on Wed Nov 21, 2012 4:12 am, edited 1 time in total.

bobbyquine
Power User
Posts: 20
Joined: Mon Nov 12, 2012 3:36 pm

Re: Pattern Scene Matrix Variables

Post by bobbyquine » Tue Nov 20, 2012 7:15 pm

Wow...ok,

Im only a couple of weeks into MT so this is very challenging stuff, but I'm going to try and digest that.

Again, thanks for your time, I needed to know if that was possible as I'm still working out what I want to do and just how deep MT is...

Thanks

B

metastatik
Power User
Posts: 61
Joined: Wed Sep 26, 2007 6:02 pm

Re: Pattern Scene Matrix Variables

Post by metastatik » Tue Nov 20, 2012 7:38 pm

I’ve used MT for years and still find bit manipulation tricky, so don’t feel bad. Luckily though, MT has lots of variables on offer, so the need to resort to storing multiple values/states in a single variable isn’t all that common. It’s really just needed for storage intensive stuff like sequencers.

Post Reply