ui elements

10 views
Skip to first unread message

Spencer Kelly

unread,
Oct 18, 2010, 11:58:21 PM10/18/10
to web-pu...@googlegroups.com

so im getting smarter...

i've got sliders, bangs and numberboxes, they're just not connected to the graph yet
http://www.spencerwaterbed.com/soft/webpd/

I want it to feel like Mozilla's ubiquity. I think we can do tons to improve on the traditional puredata UI. but its so wobbly stil...

i've got a half-working demo of ajax patches  -
http://www.spencerwaterbed.com/soft/webpd/?try.pd  --local
http://www.spencerwaterbed.com/soft/webpd/?http://spencerino.spencermountain.user.dev.freebaseapps.com/pd.txt  --cross domain using JSONP (patch formatting screwed up, but you get the idea)

i'm uncommitting the [key] objects I made. multiple document.onkeypress() conflict. doh. they should share a listner somehow.

so this stuff is good...

whats MORE though, is I figured out finally that I can do this  - pd["_graph"].objects[0].sendmessage(0, "bang");
all the way from processing.js, so that makes me want to rewrite ALOT of the interface.
namely, right now its running parallel to the sound entirely. It should really be running off the same object.

i didn't catch this until now because it wont let me stringify pd["_graph"].objects. Too big i guess maybe.(?)
If you guys think its a good idea to use pd["_graph"].objects, the UI will need to hook some data onto it, like whether it is 'selected' or not...
which could, I don't know, mess things up.

but ready or not, the UI is nestling up to the graph, pretending to yawn, reaching for the popcorn, etc.

Spencer Kelly

unread,
Oct 22, 2010, 2:51:09 PM10/22/10
to web-pu...@googlegroups.com
hey, so i'd like to get some approval before going ahead with this.

right now the ui uses its own 'uielements' json object, which stores
all the information about the object and its paramaters ,
and the sound uses its own 'pd.graph' json object. I'm proposing to
merge them, to avoid the kung-fu necessary in connecting the ui
interaction events of the 'uiobjects[2].mousepressed' stuff to the
'pd.graph[3].sendmessage' stuff.

it means having non-sound stuff right beside the sound stuff.
which probably is not a big deal

chrism

unread,
Oct 23, 2010, 12:46:55 AM10/23/10
to web-pu...@googlegroups.com
Hi Spencer,

Sorry for the slow reply. I have been meaning to dive into the WebPd
stuff and catch up on all the mails you guys have sent through. I will
do this soon, hopefully. Sorry about the delay.

With regards to the ui vs audio stuff, I would love to keep them
separate as far as possible. What I don't want is for people who want to
use WebPd as an engine in their game, or online instrument or whatever,
to have to have the UI code installed too. I think the UI code is
totally awesome, but I just want to make sure we can keep them separate.
Can you think of a way to make your life easier without actually putting
UI code into the webpd core? This might involve taking advantage of some
Javascript trickery and modifying classes at runtime and stuff like
that. If you want to commit your code I can take a look at it and see if
I can come up with some way to make your life easier and at the same
time keep the UI and engine separate.

Chris.

--
-------------------
http://mccormick.cx

Spencer Kelly

unread,
Nov 6, 2010, 1:09:56 AM11/6/10
to web-pu...@googlegroups.com
On Sat, Oct 23, 2010 at 12:46 AM, chrism <ch...@mccormick.cx> wrote:
> With regards to the ui vs audio stuff, I would love to keep them
> separate as far as possible. What I don't want is for people who want to
> use WebPd as an engine in their game, or online instrument or whatever,
> to have to have the UI code installed too. I think the UI code is
> totally awesome, but I just want to make sure we can keep them separate.
> Can you think of a way to make your life easier without actually putting
> UI code into the webpd core? This might involve taking advantage of some
> Javascript trickery and modifying classes at runtime and stuff like
> that. If you want to commit your code I can take a look at it and see if
> I can come up with some way to make your life easier and at the same
> time keep the UI and engine separate.

hey chris, I agree. I do have a question.
how do I pull the object connection information from pd.js?

if this gets the object name: pd["_graph"].objects[i].type
then how do I get its connections? its in the variable called 'source'?

i'm completely rewriting the UI. its the smartest thing i've ever done.
bugs are exploding instantaneously. demo soon.

Spencer Kelly

unread,
Nov 14, 2010, 1:50:06 PM11/14/10
to web-pu...@googlegroups.com
nm, figured it out. the connections wouldn't stringify because they
are recursive. (I didn't know that was allowed in json!?)
i fished out the data I need.
Its a lot nicer working right off the pd.js class. I've got some
objects working with live sound interaction.
i've got run + edit modes working too. way less bugs.
demo soon.
cheers


for (var i in pd["_graph"].objects) {

for (var o in pd["_graph"].objects[i].outlets)
{
alert("outlet "+o+" of "+pd["_graph"].objects[i].type+" connects to
inlet "+pd["_graph"].objects[i].outlets[o][1]+" of
"+pd["_graph"].objects[i].outlets[o][0].type)

Reply all
Reply to author
Forward
0 new messages