mirror of
https://github.com/cyberboy666/r_e_c_u_r.git
synced 2025-12-12 19:30:11 +01:00
Merge branch 'feature_plugins' into feature_plugins_shader_gadgets
This commit is contained in:
47
plugins/LFOModulation.py
Normal file
47
plugins/LFOModulation.py
Normal file
@@ -0,0 +1,47 @@
|
||||
import data_centre.plugin_collection
|
||||
from data_centre.plugin_collection import ActionsPlugin, SequencePlugin, DisplayPlugin
|
||||
from plugins.frame_manager import Frame
|
||||
|
||||
class LFOModulationPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin):
|
||||
disabled = False
|
||||
|
||||
stop_flat = True
|
||||
pause_flag = False
|
||||
def __init__(self, plugin_collection):
|
||||
super().__init__(plugin_collection)
|
||||
|
||||
#self.PRESET_FILE_NAME = "ShaderLoopRecordPlugin/frames.json"
|
||||
|
||||
self.pc.shaders.root.after(1000, self.run_automation)
|
||||
|
||||
def get_display_modes(self):
|
||||
return ['LFOMODU','NAV_LFO']
|
||||
|
||||
def show_plugin(self, display, display_mode):
|
||||
from tkinter import Text, END
|
||||
#super(DisplayPlugin).show_plugin(display, display_mode)
|
||||
display.display_text.insert(END, '{} \n'.format(display.body_title))
|
||||
display.display_text.insert(END, "test from LFOModulationPlugin!\n")
|
||||
|
||||
@property
|
||||
def parserlist(self):
|
||||
return [ ]
|
||||
"""( r"run_automation", self.run_automation ),
|
||||
( r"stop_automation", self.stop_automation ),
|
||||
( r"toggle_pause_automation", self.toggle_pause_automation ),
|
||||
( r"pause_automation", self.pause_automation ),"""
|
||||
|
||||
def run_sequence(self, position):
|
||||
import time
|
||||
now = time.time()
|
||||
|
||||
if self.pc.data.plugins is None:
|
||||
return
|
||||
|
||||
print("run_automation position %s!"%position)
|
||||
|
||||
import math
|
||||
self.pc.actions.call_method_name("modulate_param_0_to_amount_continuous", math.sin(position*math.pi)) #(now*100)%300)
|
||||
self.pc.actions.call_method_name("modulate_param_1_to_amount_continuous", math.cos(position*math.pi)/math.pi)
|
||||
self.pc.actions.call_method_name("modulate_param_2_to_amount_continuous", math.atan(position*math.pi)/math.pi)
|
||||
self.pc.actions.call_method_name("modulate_param_3_to_amount_continuous", math.sin(math.sin(position*math.pi)*math.pi))
|
||||
@@ -16,6 +16,18 @@ class WJSendPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin,ModulationReceiver
|
||||
rtscts=True, # TODO : test without this one
|
||||
timeout=timeout)"""
|
||||
|
||||
"""self.commands = {
|
||||
'VCG:': {
|
||||
'name': 'Colour Corrector Gain',
|
||||
'cmd': 'VCG:',
|
||||
},
|
||||
'VCC:': {
|
||||
'name': 'Colour Corrector XY',
|
||||
'cmd': 'VCC',
|
||||
'callback': self.set_colour
|
||||
}
|
||||
}"""
|
||||
|
||||
THROTTLE = 1 # milliseconds to wait between refreshing parameters
|
||||
|
||||
def __init__(self, plugin_collection):
|
||||
@@ -32,7 +44,7 @@ class WJSendPlugin(ActionsPlugin,SequencePlugin,DisplayPlugin,ModulationReceiver
|
||||
|
||||
def set_modulation_value(self, param, value):
|
||||
# take modulation value and throw it to local parameter
|
||||
print("||||| wjsend set_modulation_value!")
|
||||
print("||||| wjsend set_modulation_value for param %s with value %s!" % (param, value))
|
||||
if param==0:
|
||||
self.set_mix((0.5+value)/2)
|
||||
elif param==1:
|
||||
|
||||
Reference in New Issue
Block a user