Page 1 of 1

turn on/off a module thru script

Posted: Wed Nov 26, 2008 3:35 pm
by undone
hey all,
id like to know if it is possible to turn off a running module
(example bpm router_master) thru the modul8 scripting utility.

id like to push a key,(or receive a midi message) the new media gets loaded and bpm_router master stops!, when i release the key(midi message stops) the bpm_router_master continues.

is this possible or am i dreaming about a future gadget :)?

also i would like to call a function from the filter(layer) module
for example: activate "dot screen" thru another module by clicking on a button/toggle.

any suggestions and help is apprechiated.
cheers alot
reto

Posted: Tue Dec 02, 2008 10:12 am
by zoophar
Hello there !!!

I'm not shure if this works but should try...

the m8m is an xml textfile doc...
each modules has the line:
<key>SCRIPT_STATE</key>

for this line, the statement is:
<string>STOPPED</string>
<string>PLAYING</string>

in the module tutorial, (VS) talks about loading a file....

python allows to manipulate textfiles with some precompiler functions:
ob_fichier= open(filename,'r') (opens a file in read mode, filename as the path)
ob_fichier= open(filename,'w') (opens a file in write mode, filename as the path)

obFichier.readlines() (reads one line at a time)
obFichier.write('the string to write in the file')


ob_fichier.replace( 'STOPPED', 'PLAYING' ) (replace 'STOPPED' BY 'PLAYING')


hopr this will help

Posted: Tue Dec 02, 2008 10:15 am
by zoophar
for french modul8ters:
here is a hansdy little pdf file that helps when programming python....

http://www.framasoft.net/article1971.html

enjoy