[Fluxus] task

Dave Griffiths dave at pawfal.org
Thu Aug 9 09:07:56 PDT 2007


Hi Ivan

>>> >> New to fluxus
>>> >>
>>> >> I try running fluxus from a distant
>>> >> machine. How i could run the appli
>>> >> as the F5 key is not working on the distant machine
>>> >
>>> > What do you mean by distant? Are you trying to run a fluxus script
>>> over a
>>> > network? Nik has done some stuff like this, you can write a script to
>>> poll
>>> > OSC and listen for bits of scheme code to execute. I have the code
> somewhere, I'll dig it out if you need it.
>>> >
>>> usually i log via ssh -X on pdp apps and PD
>>> works very well patch appear on my hand and pdp(glx-opengl)on the other
> hand
>>> as i work on severals machines running different applications
>>> they are all on control from one master
>>> each on different statement (sound, sensoring, video, filtering) I find
> a ssh way for fluxus by the export DISPLAY=0:0 who
>>> should be on "localhost". but no F5 key for running
>>
>> I see...
>>
>> I've not tried this - is it a problem with the f key specifically, not
> getting passed on by X? If we added another key - ctrl-x for instance,
> would that help?
>
> yes i think
> where are the key function
> scratchpad-boot.scm
> or src ...
>
> did you have example on ~/.fluxus.scm

unfortunately no, the key mappings are in the C++ source, see
FluxusMain.cpp, line 119.
try mapping it to something easy first, eg:

else if ((key=='#' || special==GLUT_KEY_F5) && m_CurrentEditor<9)
m_Script=m_Editor[m_CurrentEditor]->GetText();

the ctrl key combinations are in the previous if block, and they aren't
ascii, so I've had to print them out to find out what they are first, and
put the raw code in - which is platform specific and not pretty.

> get difficulty with osc
> "you have to poll, so you have to make sure you clear the message queues"
> did you mean push-pop
> (clear)
> or (grab ) (ungrab)

ok, so if you want to pick up a message called /foo, you'd write:

(if (osc-msg "/foo")
    (display (osc 0)))

osc-msg serves two purposes, one to let you know if a message has been
received (in which case it will return #t), the other to "switch" to /foo
as the current message for which (osc) returns arguments from. (I want to
change this so osc-msg just returns a list of the arguments, but I
digress)

the trick is that if the code above is called once per frame, and the
message send rate is higher than frame rate, fluxus will accumulate
messages as only one is being dealt with per frame. it accumulates them so
you don't miss any, which can be a problem in some applications.

the answer is to keep calling osc-msg until it returns #f, then you know
you have all the messages that have been sent so far, e.g to ignore all
but the last message and keep up to date you can do something like this:

(define (read-osc msg-name arg-number default-value)
    (if (not (osc-msg msg-name))
        default-value
        (read-osc msg-name arg-number (osc arg-number))))

which should drain all the waiting messages and return the value from the
latest one.

cheers,

dave





More information about the Fluxus mailing list