Hi all, I have build a custom controller with the brain2 and i m modifying amounra`s script. I m no programmer.
session = SessionComponent(15, 3)
session.name = 'Session_Control'
session.set_track_bank_buttons(right_button, left_button)
session.set_scene_bank_buttons(down_button, up_button)
matrix = ButtonMatrixElement()
matrix.name = 'Button_Matrix'
scene_launch_notes = [31,47,63]
scene_launch_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, scene_launch_notes[index]) for index in range(3) ]
#track_stop_buttons = [ ButtonElement(is_momentary, MIDI_NOTE_TYPE, index, 52) for index in range(8) ]
for index in range(len(scene_launch_buttons)):
scene_launch_buttons[index].name = 'Scene_'+ str(index) + '_Launch_Button'
#for index in range(len(track_stop_buttons)):
# track_stop_buttons[index].name = 'Track_' + str(index) + '_Stop_Button'
#stop_all_button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, 0, 81)
#stop_all_button.name = 'Stop_All_Clips_Button'
#self._session.set_stop_all_clips_button(stop_all_button)
#self._session.set_stop_track_clip_buttons(tuple(track_stop_buttons))
#self._session.set_stop_track_clip_value(2)
#button_notes = [15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63]
for scene_index in range(3):
scene = session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(scene_launch_buttons[scene_index])
#scene.set_triggered_value(2)
for track_index in range(8):
button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, (track_index * 3) + scene_index)
button.name = str(track_index) + '_Clip_' + str(scene_index) + '_Button'
Can someone point me in the right direction? Thanks in advance !
Comments
I think you're probably using the Ohm_64 script, which I didn't actually write....I think Michael Chenetz wrote that one. Regardless, though, the magic you're looking for happens in the second to last line there, where the buttons are assigned. Basically its saying:
No problem.
A, when you say it, it sounds amazing, (:
for scene_index in range(3):
scene = session.scene(scene_index)
scene.name = 'Scene_' + str(scene_index)
button_row = []
scene.set_launch_button(scene_launch_buttons[scene_index])
#scene.set_triggered_value(2)
for track_index in range(16):
button = ButtonElement(is_momentary, MIDI_NOTE_TYPE, CHANNEL, button_notes[(track_index * 3) + scene_index])
The problem I see there is that you're setting up the second recursion for 16 times, instead of 15....so if your array is only 45 elements, long, it's running out of numbers at the end of the array. Change it to:
Yes, you are right, but that's because i change the matrix to be 163 (instead of the 153) and my list has 48 elements. So the grammar is ok? Is still not working.
Couple of things: make sure you haven't autoupdated to 9.13....you'll need a new script for that, since they changed a bunch of stuff in the _Framework (see my other post from today, or my blog....).
I m sure is 9.12.
I sent you a PM with my email addy. You're welcome to send me stuff there, I prefer to keep this sort of thing on the forums though as it may help others that are trying to do the same sort of thing ;)
Ok, cool. I have copied the Mono_Framework and now i can load the other scripts to. Nice!.
There's only a few changes Ableton made in the _Framework that are of any consequence to plain-jane scripts and they only required very straightforward changes to the scripts to get everything working. The only area I'm not sure about is using mods with the scripts that support them....if you're not using mods, the scripts will work fine (and probably will work fine even if you do, but I haven't had time to test everything yet). I would update and start using the most current versions that I pointed you to, it will save you time in the longrun.