diff --git a/Shaders/1-input/displace.frag b/Shaders/1-input/displace.frag new file mode 100644 index 0000000..34473cf --- /dev/null +++ b/Shaders/1-input/displace.frag @@ -0,0 +1,76 @@ +precision mediump float; +// template : glsl.ergonenous-tones.com + +varying vec2 tcoord; // location +uniform sampler2D tex; // texture one +uniform sampler2D tex2; // texture two +uniform vec2 tres; // size of texture (screen) +uniform vec4 fparams; // 4 floats coming in +uniform ivec4 iparams; // 4 ints coming in +uniform float ftime; // 0.0 to 1.0 +uniform int itime; // increases when ftime hits 1.0 +//f0:: +//f1:: +//f2:: +float f0 = mix(0.0, 1.0, fparams[0]); +float f1 = mix(0.0, 1.0, fparams[1]); +float f2 = mix(0.0, 1.0, fparams[2]); + +float time = float(itime) + ftime; +vec2 resolution = tres; + +#define PI 3.1415926538979323846 +#define TWO_PI 2*PI + +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + + + +vec4 displace(sampler2D tex, vec2 pos){ + vec4 texColourZoom; + vec2 center; + + vec4 color = texture2D(tex, pos); + vec3 hsv = rgb2hsv(color.rgb); + float hueR = (floor(hsv.x*10.0)/10.0); + float angle = (6.28 * hueR) + 6.28 * f1 ; + float length = f2*0.05; + + if(hsv.z > 0.5){ + pos.x = pos.x + length* cos(angle); + pos.y = pos.y + length* sin(angle); + } + if((pos.x < 0.0)||(pos.y < 0.0)||(pos.x > 1.0)||(pos.y > 1.0)){ + texColourZoom = vec4(0.0); + } + else{ + texColourZoom = texture2D(tex, pos); + } + return texColourZoom; +} + +void main( void ) { + vec4 texColour0; + + vec4 colour; + + colour = displace(tex, tcoord); + gl_FragColor = colour; + +} diff --git a/Shaders/2-input/chroma_key.frag b/Shaders/2-input/chroma_key.frag new file mode 100644 index 0000000..689aa0a --- /dev/null +++ b/Shaders/2-input/chroma_key.frag @@ -0,0 +1,71 @@ +//2-input +#ifdef GL_ES +precision mediump float; +#endif + +varying vec2 v_texcoord; +uniform sampler2D u_tex0; +uniform sampler2D u_tex1; +uniform vec2 u_resolution; +uniform float u_time; +uniform float u_x0; +uniform float u_x1; +uniform float u_x2; +uniform float u_x3; + + +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +vec4 mixChroma0(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb); + + if(u_x2 - u_x0 < hsvTexColour0.x && hsvTexColour0.x < u_x2 + u_x0){colour = texColour0;} + else {colour = texColour1;} + return colour; +} + +vec4 mixChroma1(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb); + + if(u_x2 - u_x0 < hsvTexColour1.x && hsvTexColour1.x < u_x2 + u_x0){colour = texColour1;} + else {colour = texColour0;} + return colour; +} + + +void main() { + + vec2 pos = v_texcoord; + vec4 texColour0; + vec4 texColour1; + + texColour0 = texture2D(u_tex0, v_texcoord); + texColour1 = texture2D(u_tex1, v_texcoord); + + + vec4 colour; + + if(u_x1 > 0.5){colour = mixChroma0(texColour0, texColour1);} + else{colour = mixChroma1(texColour0, texColour1);} + + gl_FragColor = colour; + +} diff --git a/Shaders/2-input/displace2in.frag b/Shaders/2-input/displace2in.frag new file mode 100644 index 0000000..fa417d7 --- /dev/null +++ b/Shaders/2-input/displace2in.frag @@ -0,0 +1,91 @@ +precision mediump float; +// template : glsl.ergonenous-tones.com + +varying vec2 tcoord; // location +uniform sampler2D tex; // texture one +uniform sampler2D tex2; // texture two +uniform vec2 tres; // size of texture (screen) +uniform vec4 fparams; // 4 floats coming in +uniform ivec4 iparams; // 4 ints coming in +uniform float ftime; // 0.0 to 1.0 +uniform int itime; // increases when ftime hits 1.0 +//f0:: +//f1:: +//f2:: +float f0 = mix(0.0, 1.0, fparams[0]); +float f1 = mix(0.0, 1.0, fparams[1]); +float f2 = mix(0.0, 1.0, fparams[2]); + +float time = float(itime) + ftime; +vec2 resolution = tres; + +#define PI 3.1415926538979323846 +#define TWO_PI 2*PI + +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + + + +vec4 displace(sampler2D tex, vec2 pos){ + vec4 texColourZoom; + vec2 center; + + vec4 color = texture2D(tex, pos); + vec3 hsv = rgb2hsv(color.rgb); + float hueR = (floor(hsv.x*10.0)/10.0); + float angle = (6.28 * hueR) + 6.28 * f1 ; + float length = f2*0.05; + + if(hsv.z > 0.5){ + pos.x = pos.x + length* cos(angle); + pos.y = pos.y + length* sin(angle); + } + if((pos.x < 0.0)||(pos.y < 0.0)||(pos.x > 1.0)||(pos.y > 1.0)){ + texColourZoom = vec4(0.0); + } + else{ + texColourZoom = texture2D(tex, pos); + } + return texColourZoom; +} + +vec4 mixBlend(vec4 texColour0, vec4 texColour1) { + vec4 colour; + colour = texColour0; + colour.xyz = (1.0 - f0) * texColour0.xyz + f0 * texColour1.xyz; + + return colour; +} + +void main( void ) { + vec4 texColour0; + vec4 texColour1; + + texColour0 = texture2D(tex, tcoord); + texColour1 = displace(tex2, tcoord); + + vec4 colour; + + + colour = mixBlend(texColour0, texColour1); + gl_FragColor = colour; + + +//gl_FragColor = vec4(rgb, color.a); +} diff --git a/Shaders/2-input/luma_key_black.frag b/Shaders/2-input/luma_key_black.frag new file mode 100644 index 0000000..2d33021 --- /dev/null +++ b/Shaders/2-input/luma_key_black.frag @@ -0,0 +1,71 @@ +//2-input +#ifdef GL_ES +precision mediump float; +#endif + +varying vec2 v_texcoord; +uniform sampler2D u_tex0; +uniform sampler2D u_tex1; +uniform vec2 u_resolution; +uniform float u_time; +uniform float u_x0; +uniform float u_x1; +uniform float u_x2; +uniform float u_x3; + + +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +vec4 mixLuma0(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb); + + if(hsvTexColour0.z > u_x0){colour = texColour0;} + else {colour = texColour1;} + return colour; +} + +vec4 mixLuma1(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb); + + if(hsvTexColour1.z > u_x0){colour = texColour1;} + else {colour = texColour0;} + return colour; +} + + +void main() { + + vec2 pos = v_texcoord; + vec4 texColour0; + vec4 texColour1; + + texColour0 = texture2D(u_tex0, v_texcoord); + texColour1 = texture2D(u_tex1, v_texcoord); + + + vec4 colour; + + if(u_x1 > 0.5){colour = mixLuma0(texColour0, texColour1);} + else{colour = mixLuma1(texColour0, texColour1);} + + gl_FragColor = colour; + +} diff --git a/Shaders/2-input/luma_key_white.frag b/Shaders/2-input/luma_key_white.frag new file mode 100644 index 0000000..ef17ba6 --- /dev/null +++ b/Shaders/2-input/luma_key_white.frag @@ -0,0 +1,71 @@ +//2-input +#ifdef GL_ES +precision mediump float; +#endif + +varying vec2 v_texcoord; +uniform sampler2D u_tex0; +uniform sampler2D u_tex1; +uniform vec2 u_resolution; +uniform float u_time; +uniform float u_x0; +uniform float u_x1; +uniform float u_x2; +uniform float u_x3; + + +vec3 rgb2hsv(vec3 c) +{ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); +} + +vec3 hsv2rgb(vec3 c) +{ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); +} + +vec4 mixLuma0(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour0 = rgb2hsv(texColour0.rgb); + + if(hsvTexColour0.z < u_x0){colour = texColour0;} + else {colour = texColour1;} + return colour; +} + +vec4 mixLuma1(vec4 texColour0, vec4 texColour1) { + vec4 colour; + vec3 hsvTexColour1 = rgb2hsv(texColour1.rgb); + + if(hsvTexColour1.z < u_x0){colour = texColour1;} + else {colour = texColour0;} + return colour; +} + + +void main() { + + vec2 pos = v_texcoord; + vec4 texColour0; + vec4 texColour1; + + texColour0 = texture2D(u_tex0, v_texcoord); + texColour1 = texture2D(u_tex1, v_texcoord); + + + vec4 colour; + + if(u_x1 > 0.5){colour = mixLuma0(texColour0, texColour1);} + else{colour = mixLuma1(texColour0, texColour1);} + + gl_FragColor = colour; + +} diff --git a/actions.py b/actions.py index 41eb955..10cca9e 100644 --- a/actions.py +++ b/actions.py @@ -533,16 +533,16 @@ class Actions(object): self.shaders.set_param_to_amount(3, amount, layer_offset=2) def set_the_shader_param_0_layer_offset_3_continuous(self, amount): - self.shaders.set_param_to_amount(0, amount, layer_offset=2) + self.shaders.set_param_to_amount(0, amount, layer_offset=3) def set_the_shader_param_1_layer_offset_3_continuous(self, amount): - self.shaders.set_param_to_amount(1, amount, layer_offset=2) + self.shaders.set_param_to_amount(1, amount, layer_offset=3) def set_the_shader_param_2_layer_offset_3_continuous(self, amount): - self.shaders.set_param_to_amount(2, amount, layer_offset=2) + self.shaders.set_param_to_amount(2, amount, layer_offset=3) def set_the_shader_param_3_layer_offset_3_continuous(self, amount): - self.shaders.set_param_to_amount(3, amount, layer_offset=2) + self.shaders.set_param_to_amount(3, amount, layer_offset=3) def set_strobe_amount_continuous(self, amount): scaled_amount = int(amount * 10) @@ -981,6 +981,8 @@ class Actions(object): for i in range(1, 4): if os.path.exists('/dev/sda{}'.format(i)): subprocess.call(['sudo', 'eject', '/dev/sda{}'.format(i)]) + self.message_handler.set_message('INFO', 'usb ejected') + # TODO: make this interrogate the various components for available routes to parse # this would include eg a custom script module.. diff --git a/json_objects/midi_action_mapping.json b/json_objects/midi_action_mapping.json index e50ce45..684f086 100644 --- a/json_objects/midi_action_mapping.json +++ b/json_objects/midi_action_mapping.json @@ -42,6 +42,22 @@ "control_change 12": { "DEFAULT": ["set_strobe_amount_continuous"] }, + "control_change 16": { + "DEFAULT": ["set_the_shader_param_0_layer_offset_2_continuous"] + }, + "control_change 17": { + "DEFAULT": ["set_the_shader_param_1_layer_offset_2_continuous"] + }, + "control_change 18": { + "DEFAULT": ["set_the_shader_param_2_layer_offset_2_continuous"] + }, + "control_change 19": { + "DEFAULT": ["set_the_shader_param_3_layer_offset_2_continuous"] + }, + "control_change 20": { + "DEFAULT": ["set_strobe_amount_continuous"] + }, + "note_on 72": { "NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"], "DEFAULT": ["seek_back_on_player", "decrease_seek_time"], @@ -246,6 +262,175 @@ "note_on 54": { "DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"], "PLAY_SHADER": ["play_shader_9","confirm_shutdown"] + }, + + "control_change 58": { + "NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"], + "DEFAULT": ["seek_back_on_player", "decrease_seek_time"], + "NAV_SETTINGS": ["move_settings_selection_up", "move_settings_selection_page_up"], + "NAV_SHADERS": ["move_shaders_selection_up", "move_shaders_selection_page_up"], + "LENGTH_SET": ["return_to_default_control_mode"], + "CONFIRM": ["return_to_default_control_mode"], + "SHADER_PARAM": ["decrease_this_param", "decrease_shader_param"], + "PLAY_SHADER": ["decrease_this_param", "decrease_shader_param"] + }, + "control_change 59": { + "NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"], + "DEFAULT": ["seek_forward_on_player", "increase_seek_time"], + "NAV_SETTINGS": ["move_settings_selection_down", "move_settings_selection_page_down"], + "NAV_SHADERS": ["move_shaders_selection_down", "move_shaders_selection_page_down"], + "LENGTH_SET": ["return_to_default_control_mode"], + "CONFIRM": ["return_to_default_control_mode"], + "SHADER_PARAM": ["increase_this_param", "increase_shader_param"], + "PLAY_SHADER": ["increase_this_param", "increase_shader_param"] + }, + "control_change 43": { + "NAV_BROWSER": ["move_browser_selection_up", "move_browser_selection_page_up"], + "DEFAULT": ["seek_back_on_player", "decrease_seek_time"], + "NAV_SETTINGS": ["move_settings_selection_up", "move_settings_selection_page_up"], + "NAV_SHADERS": ["move_shaders_selection_up", "move_shaders_selection_page_up"], + "LENGTH_SET": ["return_to_default_control_mode"], + "CONFIRM": ["return_to_default_control_mode"], + "SHADER_PARAM": ["decrease_this_param", "decrease_shader_param"], + "PLAY_SHADER": ["decrease_this_param", "decrease_shader_param"] + }, + "control_change 44": { + "NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"], + "DEFAULT": ["seek_forward_on_player", "increase_seek_time"], + "NAV_SETTINGS": ["move_settings_selection_down", "move_settings_selection_page_down"], + "NAV_SHADERS": ["move_shaders_selection_down", "move_shaders_selection_page_down"], + "LENGTH_SET": ["return_to_default_control_mode"], + "CONFIRM": ["return_to_default_control_mode"], + "SHADER_PARAM": ["increase_this_param", "increase_shader_param"], + "PLAY_SHADER": ["increase_this_param", "increase_shader_param"] + }, + "control_change 42": { + "NAV_BROWSER": ["enter_on_browser_selection"], + "DEFAULT": ["toggle_action_on_player","toggle_show_on_player"], + "NAV_SETTINGS": ["enter_on_settings_selection"], + "NAV_SHADERS": ["enter_on_shaders_selection", "map_on_shaders_selection"], + "LENGTH_SET": ["record_fixed_length"], + "SHADER_PARAM": ["return_to_default_control_mode"], + "CONFIRM": ["perform_confirm_action"], + "NAV_DETOUR": ["toggle_detour_play"], + "PLAY_SHADER": ["toggle_shaders", "toggle_shader_speed"] + }, + "control_change 41": { + "DEFAULT": ["switch_to_next_player", "toggle_player_mode"], + "NAV_DETOUR": ["toggle_detour_record", "toggle_detour_record_loop"] + }, + "control_change 61": { + "DEFAULT": ["set_playing_sample_start_to_current_duration", "clear_playing_sample_start_time"], + "SHADER_PARAM": ["decrease_param_focus"], + "PLAY_SHADER": ["decrease_param_focus"], + "NAV_DETOUR": ["decrease_mix_shader"] + }, + "control_change 62": { + "DEFAULT": ["set_playing_sample_end_to_current_duration", "clear_playing_sample_end_time"], + "SHADER_PARAM": ["increase_param_focus"], + "PLAY_SHADER": ["increase_param_focus"], + "NAV_DETOUR": ["increase_mix_shader"] + }, + "control_change 45": { + "DEFAULT": ["toggle_capture_preview", "toggle_capture_recording"]}, + "control_change 46": { + "DEFAULT": ["cycle_display_mode", "cycle_display_mode_back"] + }, + "control_change 60": { + "DEFAULT": ["toggle_function"] + }, + "control_change 32": { + "DEFAULT": ["load_slot_0_into_next_player","previous_bank"], + "PLAY_SHADER": ["play_shader_0","previous_shader_layer"], + "NAV_SHADERS": ["play_shader_0","previous_shader_layer"], + "NAV_DETOUR": ["switch_to_detour_0", "set_the_detour_mix_0"] + }, + "control_change 33": { + "DEFAULT": ["load_slot_1_into_next_player","next_bank"], + "PLAY_SHADER": ["play_shader_1","next_shader_layer"], + "NAV_SHADERS": ["play_shader_1","next_shader_layer"], + "NAV_DETOUR": ["switch_to_detour_1", "set_the_detour_mix_1"] + }, + "control_change 34": { + "DEFAULT": ["load_slot_2_into_next_player","clear_all_slots"], + "PLAY_SHADER": ["play_shader_2","clear_shader_bank"], + "NAV_SHADERS": ["play_shader_2","clear_shader_bank"], + "NAV_DETOUR": ["switch_to_detour_2", "clear_this_detour"] + }, + "control_change 35": { + "DEFAULT": ["load_slot_3_into_next_player"], + "PLAY_SHADER": ["play_shader_3"], + "NAV_DETOUR": ["switch_to_detour_3"] + }, + "control_change 36": { + "DEFAULT": ["load_slot_4_into_next_player"], + "PLAY_SHADER": ["play_shader_4"] + }, + "control_change 37": { + "DEFAULT": ["load_slot_5_into_next_player","toggle_screen_mirror"], + "PLAY_SHADER": ["play_shader_5", "toggle_screen_mirror"] + }, + "control_change 38": { + "DEFAULT": ["load_slot_6_into_next_player","toggle_shaders"], + "PLAY_SHADER": ["play_shader_6","toggle_shaders"] + }, + "control_change 39": { + "DEFAULT": ["load_slot_7_into_next_player", "toggle_detour_mode"], + "PLAY_SHADER": ["play_shader_7","toggle_detour_mode"] + }, + "control_change 48": { + "DEFAULT": ["load_slot_8_into_next_player", "toggle_feedback"], + "PLAY_SHADER": ["play_shader_8", "toggle_feedback"] + }, + "control_change 49": { + "DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"], + "PLAY_SHADER": ["play_shader_9","confirm_shutdown"] + }, + + + + "control_change 51": { + "DEFAULT": ["toggle_x3_as_speed"] + }, + "control_change 52": { + "DEFAULT": ["toggle_feedback"] + }, + "control_change 53": { + "DEFAULT": ["toggle_shader_layer_0"] + }, + "control_change 54": { + "DEFAULT": ["toggle_shader_layer_1"] + }, + "control_change 55": { + "DEFAULT": ["toggle_shader_layer_2"] + }, + "control_change 64": { + "DEFAULT": ["play_shader_0"] + }, + "control_change 65": { + "DEFAULT": ["play_shader_1"] + }, + "control_change 66": { + "DEFAULT": ["play_shader_2"] + }, + "control_change 67": { + "DEFAULT": ["play_shader_3"] + }, + "control_change 68": { + "DEFAULT": ["play_shader_4"] + }, + "control_change 69": { + "DEFAULT": ["play_shader_5"] + }, + "control_change 70": { + "DEFAULT": ["play_shader_6"] + }, + "control_change 71": { + "DEFAULT": ["play_shader_7"] } + } + + + diff --git a/json_objects/osc_action_mapping.json b/json_objects/osc_action_mapping.json index 48a3b24..6689334 100644 --- a/json_objects/osc_action_mapping.json +++ b/json_objects/osc_action_mapping.json @@ -15,6 +15,34 @@ "DEFAULT": ["set_the_shader_param_3_layer_offset_0_continuous"], "NAV_DETOUR": ["set_detour_end_continuous"] }, + "/shaderparam4": { + "DEFAULT": ["set_the_shader_param_0_layer_offset_1_continuous"] + }, + "/shaderparam5": { + "DEFAULT": ["set_the_shader_param_1_layer_offset_1_continuous"] + }, + "/shaderparam6": { + "DEFAULT": ["set_the_shader_param_2_layer_offset_1_continuous"] + }, + "/shaderparam7": { + "DEFAULT": ["set_the_shader_param_3_layer_offset_1_continuous"] + }, + "/shaderparam8": { + "DEFAULT": ["set_the_shader_param_0_layer_offset_2_continuous"] + }, + "/shaderparam9": { + "DEFAULT": ["set_the_shader_param_1_layer_offset_2_continuous"] + }, + "/shaderparam10": { + "DEFAULT": ["set_the_shader_param_2_layer_offset_2_continuous"] + }, + "/shaderparam11": { + "DEFAULT": ["set_the_shader_param_3_layer_offset_2_continuous"] + }, + "/shaderparam12": { + "DEFAULT": ["set_strobe_amount_continuous"] + }, + "a": { "NAV_BROWSER": ["move_browser_selection_down", "move_browser_selection_page_down"], "DEFAULT": ["seek_forward_on_player", "increase_seek_time"], @@ -118,6 +146,53 @@ "DEFAULT": ["load_slot_9_into_next_player","confirm_shutdown"], "PLAY_SHADER": ["play_shader_9","confirm_shutdown"] }, + "toggle_x3": { + "DEFAULT": ["toggle_x3_as_speed"] + }, + "feedback": { + "DEFAULT": ["toggle_feedback"] + }, + "shader_layer_0": { + "DEFAULT": ["toggle_shader_layer_0"] + }, + "shader_layer_1": { + "DEFAULT": ["toggle_shader_layer_1"] + }, + "shader_layer_2": { + "DEFAULT": ["toggle_shader_layer_2"] + }, + "play_shader_0": { + "DEFAULT": ["play_shader_0"] + }, + "play_shader_1": { + "DEFAULT": ["play_shader_1"] + }, + "play_shader_2": { + "DEFAULT": ["play_shader_2"] + }, + "play_shader_3": { + "DEFAULT": ["play_shader_3"] + }, + "play_shader_4": { + "DEFAULT": ["play_shader_4"] + }, + "play_shader_5": { + "DEFAULT": ["play_shader_5"] + }, + "play_shader_6": { + "DEFAULT": ["play_shader_6"] + }, + "play_shader_7": { + "DEFAULT": ["play_shader_7"] + }, + "play_shader_8": { + "DEFAULT": ["play_shader_8"] + }, + "play_shader_9": { + "DEFAULT": ["play_shader_9"] + }, + + "/volume": { "DEFAULT": ["modulate_param_0_to_amount_continuous"] }, diff --git a/user_input/midi_input.py b/user_input/midi_input.py index 1e23e71..580ae14 100644 --- a/user_input/midi_input.py +++ b/user_input/midi_input.py @@ -121,7 +121,7 @@ class MidiInput(object): self.actions.call_method_name(method_name, norm_message_value) except TypeError: ## to support using cc-0 as button presses - if norm_message_value == 0: + if norm_message_value: self.actions.call_method_name(method_name, None) ## only update screen if not continuous - seeing if cc can respond faster if not refreshing screen on every action if 'continuous' not in message_name: diff --git a/video_centre/shaders.py b/video_centre/shaders.py index 0511afc..358c447 100644 --- a/video_centre/shaders.py +++ b/video_centre/shaders.py @@ -197,7 +197,7 @@ class Shaders(object): def set_param_layer_to_amount(self, param, layer, amount): if self.data.settings['shader']['X3_AS_SPEED']['value'] == 'enabled' and param == 3: - self.set_speed_to_amount(amount, layer) #layer_offset=layer-self.data.shader_layer) + self.set_speed_layer_to_amount(layer, amount) #layer_offset=layer-self.data.shader_layer) else: self.selected_param_list[layer][param] = amount self.update_param_layer(param,layer)