text
stringlengths 0
15.7k
| source
stringlengths 6
112
|
---|---|
set rgb_colors to rgb_colors & {row} | launchpad-for-maschine.applescript |
return rgb_colors | launchpad-for-maschine.applescript |
end getMaschinePatternColors | launchpad-for-maschine.applescript |
on getMaschineScenes() | launchpad-for-maschine.applescript |
set active_scene to 0 | launchpad-for-maschine.applescript |
set s2_exists to 0 | launchpad-for-maschine.applescript |
set x to x + 20 | launchpad-for-maschine.applescript |
set y to y - 30 | launchpad-for-maschine.applescript |
set sizex to 2 * dx # wide enough to scan scenes 1 and 2 – we don't care about any further scenes | launchpad-for-maschine.applescript |
set sizey to 1 # we only need one row for the scenes | launchpad-for-maschine.applescript |
set output to pixelStream(1, 1, sizex, sizey, {25, dx - 25, 1, 0}) | launchpad-for-maschine.applescript |
set s1_pixels to paragraphs 1 thru 25 of output | launchpad-for-maschine.applescript |
set s2_pixels to paragraphs 26 thru 50 of output | launchpad-for-maschine.applescript |
set scenes_pixels to {s1_pixels, s2_pixels} | launchpad-for-maschine.applescript |
set hex to item 1 of item i of scenes_pixels | launchpad-for-maschine.applescript |
if hex is "ff4f4f4f" then set active_scene to i | launchpad-for-maschine.applescript |
repeat with hex in items of s2_pixels | launchpad-for-maschine.applescript |
if (r is not g) or (g is not b) then set s2_exists to 1 | launchpad-for-maschine.applescript |
return {active_scene, s2_exists} | launchpad-for-maschine.applescript |
end getMaschineScenes | launchpad-for-maschine.applescript |
on clickMaschinePattern(patx, paty) | launchpad-for-maschine.applescript |
set LPcolor to item patx of item paty of mas_pattern_colors | launchpad-for-maschine.applescript |
set create_new to false | launchpad-for-maschine.applescript |
set active_pattern to 0 | launchpad-for-maschine.applescript |
if intensity is 0 then | launchpad-for-maschine.applescript |
set LPcolor to item patx of item iy of mas_pattern_colors | launchpad-for-maschine.applescript |
if getLPintensity(LPcolor) is active then set active_pattern to iy | launchpad-for-maschine.applescript |
if drums_pad is true then set create_new to true | launchpad-for-maschine.applescript |
set clicks to "" | launchpad-for-maschine.applescript |
set x to x + maschine_x + (patx - 1) * dx | launchpad-for-maschine.applescript |
set y to y + maschine_y + (paty - 1) * dy | launchpad-for-maschine.applescript |
set y to y + maschine_y + (active_pattern - 1) * dy | launchpad-for-maschine.applescript |
if intensity is 0 and active_pattern > 0 then | launchpad-for-maschine.applescript |
if item 1 of selected_pattern is patx then | launchpad-for-maschine.applescript |
set clicks to clicks & " c:" & x & "," & y | launchpad-for-maschine.applescript |
set clicks to clicks & " c:" & x & "," & y & " c:" & x & "," & y | launchpad-for-maschine.applescript |
if create_new is true then set clicks to clicks & " dc:" & x & "," & y | launchpad-for-maschine.applescript |
if intensity is inactive then set clicks to clicks & " c:" & x & "," & y | launchpad-for-maschine.applescript |
if intensity is active and item 1 of selected_pattern is not patx then set clicks to clicks & " c:" & x & "," & y | launchpad-for-maschine.applescript |
do shell script cliclick & " " & clicks | launchpad-for-maschine.applescript |
set selected_pattern to {patx, paty} | launchpad-for-maschine.applescript |
return create_new | launchpad-for-maschine.applescript |
end clickMaschinePattern | launchpad-for-maschine.applescript |
on clickMaschineRow(rowy) | launchpad-for-maschine.applescript |
set commands to "" # we'll store the cliclick mouse click commands here | launchpad-for-maschine.applescript |
set {basex, basey} to getMaschinePatternsPosition() # starting coordinates for clicks | launchpad-for-maschine.applescript |
set basex to basex + maschine_x | launchpad-for-maschine.applescript |
set basey to basey + maschine_y | launchpad-for-maschine.applescript |
set previously_selected to selected_pattern | launchpad-for-maschine.applescript |
set pattern_intensity to getLPintensity(item ix of item rowy of mas_pattern_colors) | launchpad-for-maschine.applescript |
set any_in_group_active to false | launchpad-for-maschine.applescript |
set active_y to 0 | launchpad-for-maschine.applescript |
if getLPintensity(item ix of item iy of mas_pattern_colors) = active then | launchpad-for-maschine.applescript |
set any_in_group_active to true | launchpad-for-maschine.applescript |
set active_y to iy | launchpad-for-maschine.applescript |
if pattern_intensity is inactive then | launchpad-for-maschine.applescript |
set x to basex + (ix - 1) * dx | launchpad-for-maschine.applescript |
set y to basey + (rowy - 1) * dy | launchpad-for-maschine.applescript |
set commands to commands & " c:" & x & "," & y | launchpad-for-maschine.applescript |
set selected_pattern to {ix, rowy} | launchpad-for-maschine.applescript |
if pattern_intensity is 0 and any_in_group_active is true then | launchpad-for-maschine.applescript |
set y to basey + (active_y - 1) * dy | launchpad-for-maschine.applescript |
if item 1 of selected_pattern is ix then | launchpad-for-maschine.applescript |
set commands to commands & " c:" & x & "," & y & " c:" & x & "," & y | launchpad-for-maschine.applescript |
set selected_pattern to {ix, active_y} | launchpad-for-maschine.applescript |
if item 1 of selected_pattern is not item 1 of previously_selected then | launchpad-for-maschine.applescript |
set x to basex + ((item 1 of previously_selected) - 1) * dx | launchpad-for-maschine.applescript |
set item 1 of selected_pattern to item 1 of previously_selected | launchpad-for-maschine.applescript |
do shell script cliclick & commands | launchpad-for-maschine.applescript |
end clickMaschineRow | launchpad-for-maschine.applescript |
on switchScene(row) | launchpad-for-maschine.applescript |
set x to basex | launchpad-for-maschine.applescript |
set y to basey - dy # above the pattern grid | launchpad-for-maschine.applescript |
if s2_exists is 0 then | launchpad-for-maschine.applescript |
set clicks to " c:" & x + dx & "," & y | launchpad-for-maschine.applescript |
set s2_exists to 1 | launchpad-for-maschine.applescript |
set active_scene to 2 | launchpad-for-maschine.applescript |
set clicks to " kd:ctrl c:" & x + (active_scene mod 2) * dx & "," & y & " ku:ctrl c:+50,+60" | launchpad-for-maschine.applescript |
set active_scene to (active_scene mod 2) + 1 # swap 1 to 2 or other way around | launchpad-for-maschine.applescript |
if row is 0 then | launchpad-for-maschine.applescript |
if getLPintensity(item ix of item iy of mas_pattern_colors) is active then | launchpad-for-maschine.applescript |
set y to basey + (iy - 1) * dy | launchpad-for-maschine.applescript |
set selected_pattern to {ix, iy} | launchpad-for-maschine.applescript |
if row > 0 then | launchpad-for-maschine.applescript |
set iy to row | launchpad-for-maschine.applescript |
if getLPintensity(item ix of item iy of mas_pattern_colors) is not 0 then | launchpad-for-maschine.applescript |
end switchScene | launchpad-for-maschine.applescript |
if {144, 176, 153} does not contain item 1 of message then return {} | launchpad-for-maschine.applescript |
if (maschine_app or (maschine_plug > 0)) is false then findMaschineInstances() | launchpad-for-maschine.applescript |
if (maschine_app or (maschine_plug > 0)) then | launchpad-for-maschine.applescript |
if item 1 of message is 153 and item 2 of message < 16 then | launchpad-for-maschine.applescript |
if sinceLastTime(false) > 500 then | launchpad-for-maschine.applescript |
set masColors to getMaschinePatternColors(8, 8, 0, 0) | launchpad-for-maschine.applescript |
set rgb to item ix of item iy of masColors | launchpad-for-maschine.applescript |
set message to message & setLPcolor(ix, iy, rgbToLPcolor(item 1 of rgb, item 2 of rgb, item 3 of rgb)) | launchpad-for-maschine.applescript |
if (item 1 of message = 176) and (item 2 of message = item 5 of ctrlButtons) and (item 3 of message > 0) then | launchpad-for-maschine.applescript |
set session_pad to true | launchpad-for-maschine.applescript |
set message to showControlButtons() | launchpad-for-maschine.applescript |
findMaschineInstances() | launchpad-for-maschine.applescript |
getMaschineInnerPosition() | launchpad-for-maschine.applescript |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.