hi list, I wrote a simple UI in tk, and i want to attach it to pd.
i tried:
[wish ui.tk( | [shell] | [route mypath ...] | ...
but i have a question: does this has sense? i see i takes about 5~10 seconds to load another instance of wish
if it could be possible to re-use the existing instance of wish used for pd-gui, the load would be immediate
is this possible? is there some ready-to-cook code that wraps a tk app into an external? that would be awesome :9
You can do that with the toxy lib, I believe [widget] and [tot] are the objects you want. They are included in Pd-extended.
.hc
On Oct 28, 2006, at 4:53 PM, Federico wrote:
hi list, I wrote a simple UI in tk, and i want to attach it to pd.
i tried:
[wish ui.tk( | [shell] | [route mypath ...] | ...
but i have a question: does this has sense? i see i takes about 5~10 seconds to load another instance of wish
if it could be possible to re-use the existing instance of wish used for pd-gui, the load would be immediate
is this possible? is there some ready-to-cook code that wraps a tk app into an external? that would be awesome :9
-- ciao Federico
PD-dev mailing list PD-dev@iem.at http://lists.puredata.info/listinfo/pd-dev
------------------------------------------------------------------------
Computer science is no more related to the computer than astronomy is related to the telescope. -Edsger Dykstra
ah! I already seen that, and forgotten about that.
In the last hour I read all available docs at: http://suita.chopin.edu.pl/~czaja/miXed/externs/
but still something isn't clear to me, also looking at the example widfiles
in addition I tried to port my app to toxy (see attached file), but it goes in an endless loop (resizing the pd window) withouth giving errors, so I am unable to debug it...
Hans-Christoph Steiner ha scritto:
You can do that with the toxy lib, I believe [widget] and [tot] are the objects you want. They are included in Pd-extended.
[wish ui.tk( | [shell] | [route mypath ...] | ...
#> table trk Tktable #. -rows 16 -cols 8 -height 16 -width 8 #. -colwidth 3 -drawmode slow -sparsearray 0 -titlerows 0 -titlecols 1 #. -selectmode extended -selecttype row -resizeborders none #. -colstretchmode unset -rowstretchmode none -rowtagcommand {t_rowtags} #. -coltagcommand {t_coltags} -autoclear 1 -command {t_command %r %c %s} #. -validate 1 -validatecommand {t_validate %S}
#. @element t_set
proc t_set {r c v} { }
array set table { rows 16 cols 8 wid .- msgid {} cmdset {element %r %c %s} cmdget {element %r %c} coltype {t1 t0 t0 t0 t0 t0 t0 t0} colw {3 3 3 3 3 3 3 3} valmin 0 valmax 127 data {} }
proc clip_val {v} { global table if {$v < $table(valmin)} {return $table(valmin)} if {$v > $table(valmax)} {return $table(valmax)} return $v } proc t_resize_data {} { global table set old $table(data) set table(data) [list] for {set x 0} {$x < $table(cols)} {incr x} { for {set y 0} {$y < $table(rows)} {incr y} { lappend table(data) "" } } } proc t_rowtags {row} { if {$row%4==0} { return oddrow } } proc t_coltags {col} { global table if {$col == [expr $table(cols)-1]} { return disabled } elseif {$col >= 1} { return [lindex $table(coltype) [expr $col-1]] } } proc t_command {r c v} { global table set index [expr $r * $table(cols) + $c] if {$v == ""} { if {$c == 0} { return [expr $r+1]; } else { .< [t_do_cmd cmdget $r $c $v] .> return [lindex $table(data) $index] } } else { .< [t_do_cmd cmdset [expr $r+1] $c $v] .> lset table(data) $index $v } } proc t_do_cmd {cmd r c v} { global table set m [list] lappend m $table(msgid) foreach vv $table($cmd) { if {"$vv" == "%r"} { lappend m $r } elseif {"$vv" == "%c"} { lappend m $c } elseif {"$vv" == "%s"} { lappend m $v } else { lappend m $vv } } return "[join $m { }];" } proc t_validate {new} { global CURRENT set clipped [clip_val $new] if {$new == {}} { return 1 } elseif {$new != $clipped} { set CURRENT $clipped return 0 } else { return 1 } }
set colw [list] ; set j 0 lappend colw 0 ; lappend colw 2 foreach {w} $table(colw) {incr j; lappend colw $j; lappend colw $w} eval $table(wid) width $colw $table(wid) tag config oddrow -bg gray -fg black $table(wid) tag config t0 $table(wid) tag config t1 -bg green $table(wid) tag config sel -bg blue -fg white $table(wid) tag config active -bg blue -fg white $table(wid) tag config disabled -state disabled grid $table(wid) -row 0 -column 0 -sticky news grid columnconfig . 0 -weight 1 grid rowconfig . 0 -weight 1
entry .cmd grid .cmd -row 1 -sticky ew
bind $table(wid) <Key-colon> {focus .cmd; break} bind $table(wid) <Key-Return> {break} bind .cmd <Key-Up> \ {focus $table(wid); event generate $table(wid) <Key-Up>; focus .cmd; break} bind .cmd <Key-Down> \ {focus $table(wid); event generate $table(wid) <Key-Down>; focus .cmd; break}
t_resize_data
On Sun, 29 Oct 2006, Federico wrote:
ah! I already seen that, and forgotten about that. In the last hour I read all available docs at: http://suita.chopin.edu.pl/~czaja/miXed/externs/ but still something isn't clear to me, also looking at the example widfiles in addition I tried to port my app to toxy (see attached file), but it goes in an endless loop (resizing the pd window) withouth giving errors, so I am unable to debug it...
Ah, btw, I need to make an external that will enable writing server-side externals in the tcl language (Toxy is client-side only).
Do you want to give me a hand making/designing this?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Mathieu Bouchard ha scritto:
On Sun, 29 Oct 2006, Federico wrote:
ah! I already seen that, and forgotten about that. In the last hour I read all available docs at: http://suita.chopin.edu.pl/~czaja/miXed/externs/ but still something isn't clear to me, also looking at the example widfiles in addition I tried to port my app to toxy (see attached file), but it goes in an endless loop (resizing the pd window) withouth giving errors, so I am unable to debug it...
Ah, btw, I need to make an external that will enable writing server-side externals in the tcl language (Toxy is client-side only).
eh me too, i discovered delays of toxy when dealing with messages that needs to be timing-accurate
Do you want to give me a hand making/designing this?
yes! (as I said you on IRC) let me know some newz ;)
ciao Federico
On Sun, 5 Nov 2006, Federico wrote:
Mathieu Bouchard ha scritto:
i discovered delays of toxy when dealing with messages that needs to be timing-accurate
Do you want to give me a hand making/designing this?
yes! (as I said you on IRC) let me know some newz ;)
Ok, if I'm not staying too long in Toronto, we're having a developers meeting tomorrow at Ottawa university (matju + _heri + alx1) and we're going to talk about GridFlow II. Then I'd like to make a prototype of that external as soon as possible, possibly using SWIG; _heri has gained quite a bit of experience with SWIG. Once we have something that works I'll make you try.
However, there's a slight chance that we back off from that project (of making an external for server-side tcl), so I don't really want to promise anything tonight.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Mathieu Bouchard ha scritto:
On Sun, 5 Nov 2006, Federico wrote:
Mathieu Bouchard ha scritto:
i discovered delays of toxy when dealing with messages that needs to be timing-accurate
Do you want to give me a hand making/designing this?
yes! (as I said you on IRC) let me know some newz ;)
Ok, if I'm not staying too long in Toronto, we're having a developers meeting tomorrow at Ottawa university (matju + _heri + alx1) and we're going to talk about GridFlow II. Then I'd like to make a prototype of that external as soon as possible, possibly using SWIG; _heri has gained quite a bit of experience with SWIG. Once we have something that works I'll make you try.
However, there's a slight chance that we back off from that project (of making an external for server-side tcl), so I don't really want to promise anything tonight.
maybe Toronto's nights are too late for me :) if you came on IRC early I would be happy to hear (or partecipate) to te discussion
til now, I have a question wich didn't make me spleep tonight: also GridFlow is affected by those client/server issues?
does GridFlow run in the client? cause i'm experiencing timing problems. withouth making a too long explanation, i have:
[metro] | [# some operators] | [#export_list]
and it's totally inaccurate (with cpu load at 5~10% its clearly audible that messages or whatever are off-time)
can't wait for the dev meeting :)
bye bye
Federico
On Mon, 6 Nov 2006, Federico wrote:
Mathieu Bouchard ha scritto:
Ok, if I'm not staying too long in Toronto, we're having a developers meeting tomorrow at Ottawa university (matju + _heri + alx1) and we're going to talk about GridFlow II.
maybe Toronto's nights are too late for me :)
The meeting is in Ottawa... it's just that I was setting up a GridFlow-based exhibition in Toronto at Glendon Gallery.
Toronto, Ottawa, Montréal are all in the same timezone though.
The meeting was today and just ended. I didn't respond much on IRC because we were busy at it.
if you came on IRC early I would be happy to hear (or partecipate) to te discussion
The meeting was not on IRC. Tomorrow we're meeting again because I just agreed to stay one more day in Ottawa. Further meetings will be on IRC.
til now, I have a question wich didn't make me spleep tonight: also GridFlow is affected by those client/server issues?
only to the extent that GridFlow does GUI, but that's only the [display] class.
does GridFlow run in the client?
No, except part of [display], part of [peephole], the tcl/ruby evaluators, and the GridFlow menu.
and it's totally inaccurate (with cpu load at 5~10% its clearly audible that messages or whatever are off-time)
This might be due to the garbage collector, which has to run once in a while and takes some time (e.g. 25 ms once every N seconds). Those timing issues are the 2nd most important reason to switch away from Ruby.
The Tcl language doesn't have a garbage collector, so this problem cannot happen. The Python language (which was another possibility for me) has a garbage collector which is faster than Ruby (because it relies on being combined with a reference-counter).
can't wait for the dev meeting :)
I'm sorry that this meeting doesn't happen on IRC.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
Federico ha scritto:
Mathieu Bouchard ha scritto:
On Sun, 5 Nov 2006, Federico wrote:
Mathieu Bouchard ha scritto: i discovered delays of toxy when dealing with messages that needs to be timing-accurate
Do you want to give me a hand making/designing this?
yes! (as I said you on IRC) let me know some newz ;)
Ok, if I'm not staying too long in Toronto, we're having a developers meeting tomorrow at Ottawa university (matju + _heri + alx1) and we're going to talk about GridFlow II. Then I'd like to make a prototype of that external as soon as possible, possibly using SWIG; _heri has gained quite a bit of experience with SWIG. Once we have something that works I'll make you try.
However, there's a slight chance that we back off from that project (of making an external for server-side tcl), so I don't really want to promise anything tonight.
maybe Toronto's nights are too late for me :) if you came on IRC early I would be happy to hear (or partecipate) to te discussion
til now, I have a question wich didn't make me spleep tonight: also GridFlow is affected by those client/server issues?
does GridFlow run in the client? cause i'm experiencing timing problems. withouth making a too long explanation, i have:
[metro] | [# some operators] | [#export_list]
and it's totally inaccurate (with cpu load at 5~10% its clearly audible that messages or whatever are off-time)
can't wait for the dev meeting :)
ah, nevermind that
it seems i have discovered the source of problems... my video acquisition card is generating strange warnings about IRQ....
bttv0: IRQ lockup, cleared int mask [bits: FMTCHG* VSYNC* HSYNC* OFLOW* HLOCK* VPRES* 6* 7* I2CDONE* GPINT* 10* RISCI* FBUS* FTRGT* FDSR* PPERR* RIPERR* PABORT* OCERR* SCERR*] ... bttv0: IRQ lockup, cleared int mask [bits: HSYNC OFLOW VPRES I2CDONE*]
cause without loading the bttv module my patch seems to work ok. so sorry for allarmistic bug spam :)
On Tue, 7 Nov 2006, Federico wrote:
it seems i have discovered the source of problems... my video acquisition card is generating strange warnings about IRQ.... bttv0: IRQ lockup, cleared int mask [bits: FMTCHG* VSYNC* HSYNC* OFLOW* HLOCK* VPRES* 6* 7* I2CDONE* GPINT* 10* RISCI* FBUS* FTRGT* FDSR* PPERR* RIPERR* PABORT* OCERR* SCERR*] ... bttv0: IRQ lockup, cleared int mask [bits: HSYNC OFLOW VPRES I2CDONE*] cause without loading the bttv module my patch seems to work ok. so sorry for allarmistic bug spam :)
I also use bttv cards and I sometimes found that [metro] and [fps] don't agree even when the CPU usage is less than 100%. It varied in irregular, hard-to-predict ways. I mean, for each [metro] rate, it's stable (except for Ruby's garbage collection), but sometimes lowering the [metro] rate makes the framerate slower instead of faster. I haven't seen that in the last two years though.
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada
On Nov 5, 2006, at 6:58 PM, Mathieu Bouchard wrote:
On Sun, 5 Nov 2006, Federico wrote:
Mathieu Bouchard ha scritto:
i discovered delays of toxy when dealing with messages that needs to be timing-accurate
Do you want to give me a hand making/designing this?
yes! (as I said you on IRC) let me know some newz ;)
Ok, if I'm not staying too long in Toronto, we're having a developers meeting tomorrow at Ottawa university (matju + _heri + alx1) and we're going to talk about GridFlow II. Then I'd like to make a prototype of that external as soon as possible, possibly using SWIG; _heri has gained quite a bit of experience with SWIG. Once we have something that works I'll make you try.
However, there's a slight chance that we back off from that project (of making an external for server-side tcl), so I don't really want to promise anything tonight.
If you are going to add Tcl support, I highly recommend that you check out the loader functionality that Thomas wrote. Its in both devel and MAIN, and there is a working CLR version working. I am thinking you could implement a Tcl loader and Pd API layer, then you'll be able to write regular Pd objects directly in Tcl.
.hc
------------------------------------------------------------------------
Terrorism is not an enemy. It cannot be defeated. It's a tactic. It's about as sensible to say we declare war on night attacks and expect we're going to win that war. We're not going to win the war on terrorism. - retired U.S. Army general, William Odom
On Sat, 11 Nov 2006, Hans-Christoph Steiner wrote:
If you are going to add Tcl support, I highly recommend that you check out the loader functionality that Thomas wrote. Its in both devel and MAIN, and there is a working CLR version working. I am thinking you could implement a Tcl loader and Pd API layer, then you'll be able to write regular Pd objects directly in Tcl.
I can already write regular Pd object-classes directly in Tcl or Ruby, thank you very much. I can name you two hundred (200) classes that were either implemented in Ruby or wrapped as Ruby using SWIG or source_filter.rb.
Thomas's loader does not enable other languages for externals; pd already allowed this by itself for very long, even though PyExt didn't seem to allow any class name other than [py] last time I checked. Thomas's loader is only about giving equal opportunity to pd's search path and incremental loading, and while this is something I like a lot, there are other priorities.
How do I detect whether a given version of Pd supports that feature or not?
_ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montréal QC Canada