diff --git a/example/regieNico.html b/example/regieNico.html new file mode 100644 index 00000000..ab465478 --- /dev/null +++ b/example/regieNico.html @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + +
+
Load
       +
Save
+
+
Fullscreen
+ + +
+ +
+ + + + + + + + + + +
+
+
+ + + diff --git a/example/regieNico.html~ b/example/regieNico.html~ new file mode 100644 index 00000000..ab465478 --- /dev/null +++ b/example/regieNico.html~ @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + +
+
Load
       +
Save
+
+
Fullscreen
+ + +
+ +
+ + + + + + + + + + +
+
+
+ + + diff --git a/example/regieNico.preset b/example/regieNico.preset new file mode 100644 index 00000000..f9a55f95 --- /dev/null +++ b/example/regieNico.preset @@ -0,0 +1,8 @@ +Gain Drums 0.023 +Gain Basses 0.898 +Gain Guitars 0.937 +Gain MxSynths 0.817 +Gain MxDrums 0.817 +Gain Vocals 0.826 +Gain Acoustics 0.912 +Gain FOH 0.851 diff --git a/example/regieNico.preset~ b/example/regieNico.preset~ new file mode 100644 index 00000000..be7504cb --- /dev/null +++ b/example/regieNico.preset~ @@ -0,0 +1,15 @@ +Gain Drums 0 +Gain Basses 0.907 +Gain Guitars 0.559 +Gain MxSynths 0.749 +Gain MxDrums 0.747 +Gain Vocals 0.745 +Gain Acoustics 0.912 +Gain FOH 0 +Gain mjMainMix 0.921 +Gain mjDrums 0 +Gain mjVocals 0 +Gain mjGuitars 0 +Gain mjBasses 0.158 +Gain mjMetronome 0.794 +Gain MonitorsJeannot 0.8 diff --git a/example/sebkha.html b/example/sebkha.html index 96a89cf9..faa12fa4 100644 --- a/example/sebkha.html +++ b/example/sebkha.html @@ -119,7 +119,7 @@ function toggleFullscreen(e){
-
diff --git a/example/sebkha.html~ b/example/sebkha.html~ new file mode 100644 index 00000000..96a89cf9 --- /dev/null +++ b/example/sebkha.html~ @@ -0,0 +1,251 @@ + + + + + + + + + + + + + + +
+
Load
+
Save
+
+
Fullscreen
+ + +
+ +
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+
+ + + + + + + +
+
+
+ + + + + +
+
+
+ + + + + +
+
+
+ + + + + +
+
+
+ + + + + + + + +
+
+
+ + + + + + + + +
+
+
+ + + + + + + + +
+
+
+ + + diff --git a/example/sebkha.preset b/example/sebkha.preset index 3cc00007..6df3fab3 100644 --- a/example/sebkha.preset +++ b/example/sebkha.preset @@ -1,192 +1,21 @@ -Pan Drums 0 -Gain Drums 0.921 -Pan Basses 0 -Gain Basses 0.921 -Pan Guitars 0 -Gain Guitars 0.921 -Pan MxSynths 0 -Gain MxSynths 0.921 -Pan MxDrums 0 -Gain MxDrums 0.921 -Pan Vocals 0 -Gain Vocals 0.921 -Pan Kick 0 -Gain Kick 0.921 -Pan Snare 0 -Gain Snare 0.921 -Pan Toms 0 -Gain Toms 0.921 -Pan OH-L 0 -Gain OH-L 0.921 -Pan OH-R 0 -Gain OH-R 0.921 -Pan Drums 0 -Gain Drums 0.921 -Pan Bass_ORL 0 -Gain Bass_ORL 0.921 -Pan FX_ORL 0 -Gain FX_ORL 0.921 -Pan Bass_Dag 0 -Gain Bass_Dag 0.921 -Pan Basses 0 -Gain Basses 0.921 -Pan Guitar_ORL 0 -Gain Guitar_ORL 0.921 -Pan Guitar_Dag 0 -Gain Guitar_Dag 0.921 -Pan Guitars 0 -Gain Guitars 0.921 -Pan MxBass 0 -Gain MxBass 0.921 -Pan MxChords 0 -Gain MxChords 0.921 -Pan MxLead 0 -Gain MxLead 0.921 -Pan MxCtLead 0 -Gain MxCtLead 0.921 -Pan MxClassical 0 -Gain MxClassical 0.921 -Pan MxSynths 0 -Gain MxSynths 0.921 -Pan MxKicks 0 -Gain MxKicks 0.921 -Pan MxSnares 0 -Gain MxSnares 0.921 -Pan MxCymbs 0 -Gain MxCymbs 0.921 -Pan MxCont 0 -Gain MxCont 0.921 -Pan MxSamples 0 -Gain MxSamples 0.921 -Pan MxDrums 0 -Gain MxDrums 0.921 -Pan Vx_ORL 0 -Gain Vx_ORL 0.921 -Pan Vx_Dag 0 -Gain Vx_Dag 0.921 -Pan Vx_Jeannot 0 -Gain Vx_Jeannot 0.921 -Pan Vocals 0 -Gain Vocals 0.921 -Pan Tom1 0 -Gain Tom1 0.921 -Pan Tom2 0 -Gain Tom2 0.921 -Pan Tom3 0 -Gain Tom3 0.921 -Pan Toms 0 -Gain Toms 0.921 -Pan FOH 0 -Gain FOH 0.921 -Pan MonitorsJeannot 0 -Gain MonitorsJeannot 0.921 -Pan MonitorsORL 0 -Gain MonitorsORL 0.921 -Pan MonitorsDag 0 -Gain MonitorsDag 0.921 Pan mjMainMix 0 -Gain mjMainMix 0.921 +Gain mjMainMix 0.895 Pan mjDrums 0 -Gain mjDrums 0.921 +Gain mjDrums 0.182 Pan mjVocals 0 -Gain mjVocals 0.921 +Gain mjVocals 0.084 Pan mjGuitars 0 -Gain mjGuitars 0.921 +Gain mjGuitars 0.344 Pan mjBasses 0 -Gain mjBasses 0.921 +Gain mjBasses 0.492 Pan mjMetronome 0 -Gain mjMetronome 0.921 +Gain mjMetronome 0.638 Pan MonitorsJeannot 0 -Gain MonitorsJeannot 0.921 -Pan moMainMix 0 -Gain moMainMix 0.921 -Pan moDrums 0 -Gain moDrums 0.921 -Pan moBassORL 0 -Gain moBassORL 0.921 -Pan moGuitarORL 0 -Gain moGuitarORL 0.921 -Pan moVxORL 0 -Gain moVxORL 0.921 -Pan moMetronome 0 -Gain moMetronome 0.921 -Pan MonitorsORL 0 -Gain MonitorsORL 0.921 -Pan mdMainMix 0 -Gain mdMainMix 0.921 -Pan mdDrums 0 -Gain mdDrums 0.921 -Pan mdBassDag 0 -Gain mdBassDag 0.921 -Pan mdGuitarDag 0 -Gain mdGuitarDag 0.921 -Pan mdVoixDag 0 -Gain mdVoixDag 0.921 -Pan mdMetronome 0 -Gain mdMetronome 0.921 -Pan MonitorsDag 0 -Gain MonitorsDag 0.921 -Mute Drums 0 -Mute Basses 0 -Mute Guitars 0 -Mute MxSynths 0 -Mute MxDrums 0 -Mute Vocals 0 -Mute Kick 0 -Mute Snare 0 -Mute Toms 0 -Mute OH-L 0 -Mute OH-R 0 -Mute Drums 0 -Mute Bass_ORL 0 -Mute FX_ORL 0 -Mute Bass_Dag 0 -Mute Basses 0 -Mute Guitar_ORL 0 -Mute Guitar_Dag 0 -Mute Guitars 0 -Mute MxBass 0 -Mute MxChords 0 -Mute MxLead 0 -Mute MxCtLead 0 -Mute MxClassical 0 -Mute MxSynths 0 -Mute MxKicks 0 -Mute MxSnares 0 -Mute MxCymbs 0 -Mute MxCont 0 -Mute MxSamples 0 -Mute MxDrums 0 -Mute Vx_ORL 0 -Mute Vx_Dag 0 -Mute Vx_Jeannot 0 -Mute Vocals 0 -Mute Tom1 0 -Mute Tom2 0 -Mute Tom3 0 -Mute Toms 0 -Mute FOH 0 -Mute MonitorsJeannot 0 -Mute MonitorsORL 0 -Mute MonitorsDag 0 +Gain MonitorsJeannot 0.927 Mute mjMainMix 0 Mute mjDrums 0 -Mute mjVocals 0 +Mute mjVocals 1 Mute mjGuitars 0 Mute mjBasses 0 Mute mjMetronome 0 Mute MonitorsJeannot 0 -Mute moMainMix 0 -Mute moDrums 0 -Mute moBassORL 0 -Mute moGuitarORL 0 -Mute moVxORL 0 -Mute moMetronome 0 -Mute MonitorsORL 0 -Mute mdMainMix 0 -Mute mdDrums 0 -Mute mdBassDag 0 -Mute mdGuitarDag 0 -Mute mdVoixDag 0 -Mute mdMetronome 0 -Mute MonitorsDag 0 diff --git a/example/style.css b/example/style.css index 76b5e841..ab0c7dcc 100644 --- a/example/style.css +++ b/example/style.css @@ -94,7 +94,7 @@ html, body { text-align: center; position:relative; display:block; - aoverflow:hidden; + overflow:hidden; } .audiostrip.main { background: rgba(70, 186, 191,0.1); @@ -119,6 +119,7 @@ html, body { .audiostrip .ui-slider { background:rgba(70, 186, 191,0.3); border: 1px solid rgba(70, 186, 191,0.1); + } .audiostrip .ui-slider-range { background:rgba(70, 186, 191,0.9); @@ -146,15 +147,15 @@ html, body { .audiostrip .ui-slider-handle:before { content:""; position:absolute; - width:46px;height:46px; + width:400px;height:10000px; left:50%; - margin-left:-23px; + margin-left:-200px; top:50%; - margin-top:-23px; + margin-top:-5000px; border-radius:50%; border-color:transparent; background:#fff; - opacity:0.1; + opacity:0; } .audiostrip .horizontal-slider { display:inline-block; diff --git a/example/style.css~ b/example/style.css~ new file mode 100644 index 00000000..56cb2915 --- /dev/null +++ b/example/style.css~ @@ -0,0 +1,273 @@ +* { + margin:0; + padding:0; + box-sizing:border-box; + text-decoration:none; + outline:0; +} +::selection { + background:transparent; +} + +body { + font-size:12px; + line-height:20px; + font-family:sans; + background:#000; + color:#fff; + position:relative; + padding:20px; +} +html, body { + height:100%; + overflow:hidden; +} + +#tabs { + position:absolute; + top:100px; + left:0; + right:0; + bottom:0; + + background:none; + border:none; + padding:0; +} +#tabs > div { + height:auto; + position:absolute; + top:50px; + bottom:0; + left:0; + right:0; + padding:0; + padding-top:10px; + border-top:1px solid rgba(70, 186, 191,0.3); +} +#tabs > ul { + background:none; + border:none; + padding:0; + display: table; + width: 100%; + border-collapse: collapse; + table-layout:fixed; +} +#tabs > ul li{ + display: table-cell; + float: none; + background:none; + border:none; + padding:4px; + width:100%; +} +#tabs > ul li a { + display:block; + float:none; + text-align:center; + background:rgba(70, 186, 191,0.1); + border: 1px solid rgba(70, 186, 191,0.3); + color:#fff; + border-radius:4px; + text-overflow:ellipsis; + overflow:hidden; + +} +#tabs > ul li.ui-tabs-active a { + background:rgba(70, 186, 191,.7); +} +.table { + width:100%; + height:100%; + border-collapse: collapse; +} +.table tr, .table td { + height:100%; +} +.table td { + padding:4px; +} +.audiostrip { + height: 100%; + width: 100%; + text-align: center; + position:relative; + display:block; + overflow:hidden; +} +.audiostrip.main { + background: rgba(70, 186, 191,0.1); +} + + .audiostrip .name { + position: absolute; + top: 0px; + left: 0px; + height:30px; + right: 0px; + text-overflow:ellipsis; + overflow:hidden; + } + .audiostrip .name .ui-button-text { + padding:5px; + } + + + + + .audiostrip .ui-slider { + background:rgba(70, 186, 191,0.3); + border: 1px solid rgba(70, 186, 191,0.1); + + } + .audiostrip .ui-slider-range { + background:rgba(70, 186, 191,0.9); + } + .audiostrip .ui-slider-handle { + border-radius:50%; + background:#fff; + color:#fff; + border-color:transparent; + opacity:0.9; + } + .audiostrip .ui-slider-handle:after { + content:""; + position:absolute; + width:26px;height:26px; + left:50%; + margin-left:-13px; + top:50%; + margin-top:-13px; + border-radius:50%; + background:#fff; + opacity:0.7; + border-color:transparent; + } + .audiostrip .ui-slider-handle:before { + content:""; + position:absolute; + width:400px;height:10000px; + left:50%; + margin-left:-200px; + top:50%; + margin-top:-5000px; + border-radius:50%; + border-color:transparent; + background:#fff; + opacity:0; + } + .audiostrip .horizontal-slider { + display:inline-block; + position: absolute; + top:60px; + left: 0px; + right:0px; + height:8px; + margin-left:0px; + } + .audiostrip .horizontal-slider:before { + content:""; + position:absolute; + height:48px;width:100%; + top:-20px; + left:0; + } + .audiostrip .horizontal-slider:after { + content:""; + position:absolute; + left:50%; + top:1px;bottom:1px; + width:1px; + background:rgba(70, 186, 191,0.4); + } + .audiostrip .horizontal-slider .ui-slider-handle { + width: 8px; + height: 8px; + top: 50%; + margin-top: -4px; + margin-left:-4px; + } + .audiostrip .horizontal-slider .value{ + position:absolute; + width:50px; + margin-left:-25px; + left:50%; + text-align:center; + top:20px; + } + + .audiostrip .vertical-slider { + position: absolute; + height:auto; + top:110px; + bottom:50px; + left:50%; + width:8px; + margin-left:-4px; + } + .audiostrip .vertical-slider:before { + content:""; + position:absolute; + width:88px;height:100%; + left:-40px; + top:0; + opacity:0; + background:#fff; + } + .audiostrip .vertical-slider:after { + content:""; + position:absolute; + bottom:92%; + left:1px;right:1px; + height:1px; + background:rgba(70, 186, 191,0.4); + } + .audiostrip .vertical-slider .ui-slider-handle { + width: 8px; + height: 8px; + left: 50%; + margin-left: -4px; + margin-bottom: -4px; + } + .audiostrip .vertical-slider .value{ + position:absolute; + left:15px; + width:100%; + margin-top:-10px; + top:50%; + } + + + .audiostrip .toggle { + position: absolute; + height:30px; + bottom:0px; + left:0px; + right:0px; + text-align:center; + background:rgba(70, 186, 191,0.1); + border: 1px solid rgba(70, 186, 191,0.3); + color:#fff; + + } + .audiostrip .toggle .ui-button-text { + padding:5px; + } + .audiostrip .toggle.enabled { + background:rgba(70, 186, 191,0.6); + } + +.audiostrip .name { + color:#fff; + background:rgba(70, 186, 191,0.1); + border: 1px solid rgba(70, 186, 191,0.3); +} +.audiostrip .name.disabled { + background:rgba(70, 186, 191,0.01); + border: 1px solid rgba(70, 186, 191,0.1); +} + + +.left {float:left;} +.right {float:right;} diff --git a/oschtmlgui.py b/oschtmlgui.py index 750bc508..4d978350 100644 --- a/oschtmlgui.py +++ b/oschtmlgui.py @@ -26,7 +26,7 @@ Html Gui: - 'Load' will recall values stored in presetName.preset and send osc messages for each value -- The html gui must contain the following javascript function (not wrapped in a document.ready() function) : +- The html gui must contain the following javascript function (/!\ not wrapped in a document.ready() function) : - setValue(param, name, value) : this is required for preset loading and for external osc control, and must be adapted to the gui's elements """ diff --git a/oschtmlgui.pyc b/oschtmlgui.pyc new file mode 100644 index 00000000..9f62d6f2 Binary files /dev/null and b/oschtmlgui.pyc differ diff --git a/oscwebgui.py b/oscwebgui.py new file mode 100644 index 00000000..0ebac59c --- /dev/null +++ b/oscwebgui.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python +#encoding=utf8 +""" +Osc Web Gui +Build your own OSC control gui with html/css/javascript ! + +# Partial doc... check the example ! + +>>> import oscwebgui +>>> gui = oscWebGui(html='/path/to/gui.html') +>>> gui.main() + +Parameters : + port, input port for external control of the gui + target, target_ip:target_port to send osc messages to, multiples targets can be specified, separated by a space + appName, name of the gui window, prefix for osc messages + presetName, user values can be saved by the gui in presetName.preset + html, path to the html gui + +Html Gui: + +- Build your html page like any other (including css stylesheets and javascript) +- You can communicate with the gui engine by changing the document's title (document.title = newtitle), here are the recognized instructions : + - 'param, name, value' will send this osc message to the target(s) : '/appName/param name value' #value must be a number, it is converted to float anyway + - 'Save, preset' will store the preset in presetName.preset, preset must be of the form 'param name value;param name value;' + - 'Load' will recall values stored in presetName.preset and send osc messages for each value + + +- The html gui must contain the following javascript function (not wrapped in a document.ready() function) : + - setValue(param, name, value) : this is required for preset loading and for external osc control, and must be adapted to the gui's elements + +""" +import gtk, webkit, gobject, liblo as _liblo + +class oscWebGui(object): + def __init__(self,port=3333, target='127.0.0.1:3334', appName='oscWebGui', presetName='oscWebGui', html=None): + + self.port = port + self.target = target.split(' ') + self.appName = appName + self.presetName = presetName + self.html = html + + if self.html == None: + raise Exception('You must specify the absolute path to the html gui file') + + self.server = _liblo.ServerThread(self.port) + self.server.register_methods(self) + self.server.start() + + self.window = gtk.Window() + self.window.set_title(appName) + self.browser = webkit.WebView() + + self.box = gtk.VBox(homogeneous=False, spacing=0) + self.window.add(self.box) + + self.box.pack_start(self.browser, expand=True, fill=True, padding=0) + + self.browser.open(self.html) + + self.window.set_default_size(800, 600) + self.window.show_all() + self.window.connect("destroy", gtk.main_quit) + + self.connect_title_changed(self.browser, self.title_changed) + + gobject.threads_init() + + def main(self): + gtk.main() + + def connect_title_changed(self, browser, callback): + def callback_wrapper(widget, frame, title): callback(title) + self.browser.connect('title-changed', callback_wrapper) + + + def title_changed(self, title): + if title != 'null': + if title.split(',')[0] == 'Load': + try: + f = open(self.presetName+'.preset','r') + except: + self.alertError(self.presetName+'.preset'+' not found !') + return + preset = f.read().split('\n') + for i in range(len(preset)-1): + self.sendOsc('/'+preset[i].split(' ')[0],preset[i].split(' ')[1],float(preset[i].split(' ')[2])) + self.setValue(preset[i].split(' ')[0],preset[i].split(' ')[1],float(preset[i].split(' ')[2])) + + elif title.split(',')[0] == 'Save': + try: + preset = title.split(',')[1] + f = open(self.presetName+'.preset','w') + f.write(preset.replace(';','\n')) + f.close() + self.alertError('Preset Saved') + except: + self.alertError('Could not save the preset...') + elif title.split(',')[0] == 'Fullscreen': + self.toggleFullscreen(title.split(',')[1]) + else: + param = title.split(',')[0] + name = title.split(',')[1] + value = float(title.split(',')[2]) + self.sendOsc(param,name,value) + + + def toggleFullscreen(self,e): + if e == '1': + self.window.fullscreen() + else: + self.window.unfullscreen() + + def sendOsc(self,param,name,value): + path = '/' + self.appName + '/' + param + for i in range(len(self.target)): + _liblo.send('osc.udp://'+self.target[i], path, name, value) + + def setValue(self,param,name,value): + self.async_gtk_msg(self.browser.execute_script)('setValue("'+param+'","'+name+'",'+str(value)+')') + + def alertError(self,error): + self.async_gtk_msg(self.browser.execute_script)('alert("'+error+'")') + + def async_gtk_msg(self, fun): + + def worker((function, args, kwargs)): + apply(function, args, kwargs) + + def fun2(*args, **kwargs): + gobject.idle_add(worker, (fun, args, kwargs)) + + return fun2 + + @_liblo.make_method(None, 'sf') + def oscIn(self, path, args): + if '/'+self.appName in path: + param = path.split('/')[-1] + name = args[0] + value = args[1] + self.setValue(param,name,value) + +# Utility : oscRouter routes incomming osc messages using a path patch and eventually a parameter patch +# port path args >> port path arg +# 3334 /appname/parameter name value >> pathPath[name][1] /pathPatch[name][0]/paramPatch[parameter] value +# pathPatch = { +# 'name':['/osc/path',target_port] +# } +class oscRouter(object): + def __init__(self, port=3334, pathPatch=None, paramPatch=None): + self.port = port + self.pathPatch = pathPatch + self.paramPatch = paramPatch + + if self.pathPatch == None: + raise Exception('No path patch provided for osc routing') + + def start(self): + if self.port is not None: + self.server = _liblo.ServerThread(self.port) + self.server.register_methods(self) + self.server.start() + + def stop(self): + if self.port is not None: + self.server.stop() + del self.server + + @_liblo.make_method(None, 'sf') + def routeosc(self, path, args): + + param = path.split('/')[-1] + + strip, value = args + + target_path, target_address = self.pathPatch[strip] + target_address = target_address.split(' ') + + if self.pathPatch != None: + target_param = '/' + self.paramPatch[param] + else: + target_param = '' + + for i in range(len(target_address)): + _liblo.send('osc.udp://'+target_address[i], target_path +target_param, args[1]) diff --git a/oscwebgui.pyc b/oscwebgui.pyc new file mode 100644 index 00000000..32059ce4 Binary files /dev/null and b/oscwebgui.pyc differ diff --git a/regieNico.py b/regieNico.py new file mode 100644 index 00000000..223f2823 --- /dev/null +++ b/regieNico.py @@ -0,0 +1,57 @@ +import oscwebgui +from os import path as os_path + +#Ports osc des clients NonMixer +targets = { + 'MainMix':'SCSon:6666', + 'Mains':'SCSon:6678', + 'qlc': 'CtrlRegie:7770', +'MonitorsJeannot':'SCSon:6676', +'Mains':'SCSon:6678', +} + +# Patch gui > NonMixer +pathPatch = { + + #MainMix + 'Drums':['/strip/Drums',targets['MainMix']], + 'Basses':['/strip/Basses',targets['MainMix']], + 'Guitars':['/strip/Guitars',targets['MainMix']], + 'MxSynths':['/strip/MxSynths',targets['MainMix']], + 'MxDrums':['/strip/MxDrums',targets['MainMix']], + 'Vocals':['/strip/Vocals',targets['MainMix']], + 'Acoustics':['/strip/Acoustics',targets['MainMix']], + 'FOH':['/strip/FOH',targets['Mains']], + 'DecoupeOrl':['/DecoupeOrl',targets['qlc']], + + #MonitorsJeannot + 'mjMainMix':['/strip/MainMix',targets['MonitorsJeannot']], + 'mjDrums':['/strip/Drums',targets['MonitorsJeannot']], + 'mjVocals':['/strip/Vocals',targets['MonitorsJeannot']], + 'mjGuitars':['/strip/Guitars',targets['MonitorsJeannot']], + 'mjBasses':['/strip/Basses',targets['MonitorsJeannot']], + 'mjMetronome':['/strip/Metronome',targets['MonitorsJeannot']], +'MonitorsJeannot':['/strip/MonitorsJeannot',targets['Mains']], + +} + +#Parametre gui > NonMixer +paramPatch = { + 'Gain':'Gain/Gain%20(dB)', + 'Pan':'Mono%20Pan/Pan', + 'Mute':'Gain/Mute' +} + + + + +example_path = os_path.dirname(os_path.abspath(__file__)) + '/example/' +html_path = example_path + 'regieNico.html' +preset_name = example_path + 'regieNico' + +gui = oscwebgui.oscWebGui(port=3333, target='127.0.0.1:3334', appName='oscWebGui', presetName=preset_name,html=html_path) + +router = oscwebgui.oscRouter(port=3334, pathPatch=pathPatch, paramPatch=paramPatch) +router.start() + +gui.main() diff --git a/sebkha.py b/sebkha.py new file mode 100644 index 00000000..1daf7555 --- /dev/null +++ b/sebkha.py @@ -0,0 +1,123 @@ +import oscwebgui +from os import path as os_path + +#Ports osc des clients NonMixer +nmPorts = { + 'MainMix':'SCSon:6666', + 'Drums':'SCSon:6667', + 'Basses':'SCSon:6668', + 'Guitars':'SCSon:6669', + 'MxSynths':'SCSon:6670', + 'MxDrums':'SCSon:6671', + 'Vocals':'SCSon:6672', + 'Toms':'SCSon:6673', + 'Acoustics':'SCSon:6674', + 'MonitorsDag':'SCSon:6675', + 'MonitorsJeannot':'SCSon:6676', + 'MonitorsOrl':'SCSon:6677', + 'Mains':'SCSon:6678', +} + +# Patch gui > NonMixer +pathPatch = { + + #MainMix + 'Drums':['/strip/Drums',nmPorts['MainMix']], + 'Basses':['/strip/Basses',nmPorts['MainMix']], + 'Guitars':['/strip/Guitars',nmPorts['MainMix']], + 'MxSynths':['/strip/MxSynths',nmPorts['MainMix']], + 'MxDrums':['/strip/MxDrums',nmPorts['MainMix']], + 'Vocals':['/strip/Vocals',nmPorts['MainMix']], + + #Drums + 'Kick':['/strip/Kick',nmPorts['Drums']], + 'Snare':['/strip/Snare',nmPorts['Drums']], + 'Toms':['/strip/Toms',nmPorts['Drums']], + 'OH-L':['/strip/OH-L',nmPorts['Drums']], + 'OH-R':['/strip/OH-R',nmPorts['Drums']], + + #Toms + 'Tom1':['/strip/Tom1',nmPorts['Toms']], + 'Tom2':['/strip/Tom2',nmPorts['Toms']], + 'Tom3':['/strip/Tom3',nmPorts['Toms']], + + #Basses + 'Bass_ORL':['/strip/Bass_ORL',nmPorts['Basses']], + 'FX_ORL':['/strip/FX_ORL',nmPorts['Basses']], + 'Bass_Dag':['/strip/Bass_Dag',nmPorts['Basses']], + + #Guitars + 'Guitar_ORL':['/strip/Guitar_ORL',nmPorts['Guitars']], + 'Guitar_Dag':['/strip/Guitar_Dag',nmPorts['Guitars']], + + #MxSynths + 'MxBass':['/strip/MxBass',nmPorts['MxSynths']], + 'MxChords':['/strip/MxChords',nmPorts['MxSynths']], + 'MxLead':['/strip/MxLead',nmPorts['MxSynths']], + 'MxCtLead':['/strip/MxCtLead',nmPorts['MxSynths']], + 'MxClassical':['/strip/MxClassical',nmPorts['MxSynths']], + + #MxDrums + 'MxKicks':['/strip/MxKicks',nmPorts['MxDrums']], + 'MxSnares':['/strip/MxSnares',nmPorts['MxDrums']], + 'MxCymbs':['/strip/MxCymbs',nmPorts['MxDrums']], + 'MxCont':['/strip/MxCont',nmPorts['MxDrums']], + 'MxSamples':['/strip/MxSamples',nmPorts['MxDrums']], + + #Vocals + 'Vx_ORL':['/strip/Vx_ORL',nmPorts['Vocals']], + 'Vx_Dag':['/strip/Vx_Dag',nmPorts['Vocals']], + 'Vx_Jeannot':['/strip/Vx_Jeannot',nmPorts['Vocals']], + + #Mains + 'FOH':['/strip/FOH',nmPorts['Mains']], + 'MonitorsJeannot':['/strip/MonitorsJeannot',nmPorts['Mains']], + 'MonitorsORL':['/strip/MonitorsORL',nmPorts['Mains']], + 'MonitorsDag':['/strip/MonitorsDag',nmPorts['Mains']], + + #MonitorsDag + 'mdMainMix':['/strip/MainMix',nmPorts['MonitorsDag']], + 'mdDrums':['/strip/Drums',nmPorts['MonitorsDag']], + 'mdBassDag':['/strip/BassDag',nmPorts['MonitorsDag']], + 'mdGuitarDag':['/strip/GuitarDag',nmPorts['MonitorsDag']], + 'mdVoixDag':['/strip/VoixDag',nmPorts['MonitorsDag']], + 'mdMetronome':['/strip/Metronome',nmPorts['MonitorsDag']], + + #MonitorsJeannot + 'mjMainMix':['/strip/MainMix',nmPorts['MonitorsJeannot']], + 'mjDrums':['/strip/Drums',nmPorts['MonitorsJeannot']], + 'mjVocals':['/strip/Vocals',nmPorts['MonitorsJeannot']], + 'mjGuitars':['/strip/Guitars',nmPorts['MonitorsJeannot']], + 'mjBasses':['/strip/Basses',nmPorts['MonitorsJeannot']], + 'mjMetronome':['/strip/Metronome',nmPorts['MonitorsJeannot']], + + #MonitorsOrl + 'moMainMix':['/strip/MainMix',nmPorts['MonitorsOrl']], + 'moDrums':['/strip/Drums',nmPorts['MonitorsOrl']], + 'moBassORL':['/strip/BassORL',nmPorts['MonitorsOrl']], + 'moGuitarORL':['/strip/GuitarORL',nmPorts['MonitorsOrl']], + 'moVxORL':['/strip/VxORL',nmPorts['MonitorsOrl']], + 'moMetronome':['/strip/Metronome',nmPorts['MonitorsOrl']], + +} + +#Parametre gui > NonMixer +paramPatch = { + 'Gain':'Gain/Gain%20(dB)', + 'Pan':'Mono%20Pan/Pan', + 'Mute':'Gain/Mute' +} + + + + +example_path = os_path.dirname(os_path.abspath(__file__)) + '/example/' +html_path = example_path + 'sebkha.html' +preset_name = example_path + 'sebkha' + +gui = oscwebgui.oscWebGui(port=3333, target='127.0.0.1:3334', appName='oscWebGui', presetName=preset_name,html=html_path) + +router = oscwebgui.oscRouter(port=3334, pathPatch=pathPatch, paramPatch=paramPatch) +router.start() + +gui.main()