Advertisement
rhuntington

colorChanger.lua

Jul 24th, 2020
1,275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | None | 0 0
  1. -- This script will take user defined midi notes and velocities outside of the script and run a color change pattern on each note while a specified DMX address is active
  2. -- Declare some local vars for later use
  3. local getDMX = gma.show.getdmx
  4. local colorChange = {note81, note82};
  5. function colorChange.note81()
  6.     gma.echo("This is the return color for note 81");
  7. end
  8.  
  9. function colorChange.note82()
  10.     gma.echo("This is the return color for note 82");
  11. end
  12.  
  13. function getDmxOfNote(note)
  14.     local universe = 24;
  15.     local channels = 512;
  16.     local address = ((universe - 1) * channels) + note;
  17.     return address;
  18. end
  19.  
  20. function verifyDmxHasValue(address, note, velocity)
  21.     -- change the value of this below once you go to deploy
  22.     if(getDMX(address) == 0) then
  23.         gma.echo("working")
  24.         colorChange.note81()
  25.     end
  26. end
  27. function getMidiNote(note, velocity)
  28.     local address = getDmxOfNote(note);
  29.     verifyDmxHasValue(address, note, velocity);
  30. end
  31.  
  32. return getMidiNote
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement