Black Friday Deal!
Get Control Surface Studio for $55 with code: black2022
Time left to get it...
mailtimers.com
Your shopping cart is empty.

change hightlighted clip slot

Submitted by bbulkow on Sat, 04/30/2022 - 22:54
bbulkow
Control Surface Studio User

Using the highlighted clip slot seems easier and more natural than creating a scene box that is 1,1. In particular, most of the things I want to do - like add clip and delete clip and fire - are naturally on a single clip.

Thus it is really nice to:
self.song().view.highlighted_clip_slot.fire()
which also works groove with delete_clip(), and between fire (in toggle mode) and delete I don't need much more for live performance.

I've also figured out how to set the highlighted clip slot with an absolute value:


self.song().view.highlighted_clip_slot = self.song().view.selected_track.clip_slots[1]

sets it to the second slot (0 index of course)

To fully generalize it, though, I'd want a button to move to the next or previous one. Then I can fire and delete to my heart's content.

I've tried doing things like using a global variable, but that doesn't seem to work - how might I create a variable across invocations? I could maybe hang it off self....


global bb_slot
bb_slot = bb_slot + 1
self.song().view.highlighted_clip_slot = self.song().view.selected_track.clip_slots[ bb_slot ]

I notice the MAX documentation of the LOM states there is an id on every object. The right idea, is probably to iterate through the clip_slots to find which id matches, then I can find the index I am currently at, then I can set to the next one.


self.song().view.highlighted_clip_slot = self.song().view.highlighted_clip_slot.id - 1

but that didn't work either.

I'd love the following:

An example of how to print things. I know there is a message thing, but the messages aren't super clear about whether you need to fully cast to a str as well as enclosing in " ".

A discussion of creating global variables

how to move the highlighted clip slot

Thanks in advance
-brian

Topic Category: 

2 Responses

Comments

bbulkow
Control Surface Studio User
#1

Oh, and you should really look at your Reaction Reference Guide. You've placed ads along the side but over the text because it's wide. I get putting ads keeps the product cheap, but when I literally can't read your reference guide it's gone a bit too far.

bbulkow
Control Surface Studio User
#2

This does work, although it's ugly.

if not hasattr(self, 'bb_clip'):
self.bb_clip = 0
self.bb_clip = self.bb_clip + 1
self.song().view.highlighted_clip_slot = self.song().view.selected_track.clip_slots[ self.bb_clip ]