Some new GUI objects

2 views
Skip to first unread message

Brandon James

unread,
Oct 28, 2010, 7:45:38 PM10/28/10
to web-pure-data
Hey guys,

I've been working on a set of GUI control classes that can be used to build a synth (or whatever) with WebPd and processing.js.
Some of them mirror the native Pd Gui stuff, but for the most part they are meant to stand on their own.
Here are classes I've finished(hah) so far. More are coming.
All of them can be moved and resized using the right and middle mouse buttons respectively .
Also in there is an ADSR controller that hooks right up to a line~. It bypasses the need for [delay] (for now).
Check the included README for plenty of info.

--Brandon


WebPd_pjs_GUI.7z

Spencer Kelly

unread,
Oct 31, 2010, 2:26:50 PM10/31/10
to web-pu...@googlegroups.com
brandon, this is awesome.
we have to collaberate on this ui thing.
I'd like to rewrite it, almost completely.
and make it bigger, and more organised. and I need help.

i should really have done something as lucid as chris made for pd.js,
so people can work together on it in a clean way.
I have way more time this week than i have had, so im gonna get going on it.
wanna work on a public versioning thing? i have it right now on
dropbox - http://dl.dropbox.com/u/8068328/webpd/index.html
but can do whatever.

i'm gonna pull things live from the pd.js object. which may mean
setting up listeners. this is complicated, but possible.

I went to a conference this week and met alot of the audio api guys.
allister mcdonald, david humphrey. they were really receptive, and
they said theres a good group of hacker guys that can join in on this.
It's demo city over there in W3C, when they push the other browsers to
adopt this standard. If we get this up and running, it'll get a lot of
eyeballs.
if we get something usable, i'll set it up on puredatajs.com, or
something, and set up like an ecosystem of opensource pd patches. like
hascanvas.com ? where you can publish things.

so chris and brandon, what, besides settimeout(), could function as a
metro timer?
thats priority #1 as far as I'm concerned. I've had success using
settimeout to bang a loadbang repeatedly, though didn't push it with
performance.
hope you guys are swell

happy halloween

Brandon James

unread,
Oct 31, 2010, 9:23:14 PM10/31/10
to web-pure-data


> brandon, this is awesome.
Thanks. Trying to learn as fast as I can.

> I need help.
Well, this is really my first foray into text based coding, so I'm
not sure how much help I'd be,
but if you were to set something up, I'm sure I'd come play. Right now
I'm focusing alot on processing
and javascript in general, trying to get my head wrapped around
working in this kind of environment.
It's a lot of fun, but I still find myself prototyping ideas in Pd.

>what, besides settimeout(), could function as a metro timer?
I built a few sequencers trying out setTimeout and setInterval (I'll
post something up later),
and with a lot of tweeking got 'kind of' reliable timing with maybe
40ms or so jitter.
But I've been thinking too.
Pd sends messages at block boundaries. So should WebPd (pretty sure it
does).
At the very least, the fact that audio data is represented accurately
shows that accurate timing is possible.
So what I'm saying is maybe some kind of generic timing system could
be built on top of the audio API and used for what ever.
Like using audio signals as control values.
I'll look into it soon and see if I can make enough sense of things to
get something working.

-Brandon

chrism

unread,
Oct 31, 2010, 9:53:04 PM10/31/10
to web-pu...@googlegroups.com
On Sun, 31 Oct 2010 18:23:14 -0700 (PDT), Brandon James
<xbrando...@gmail.com> wrote:
> At the very least, the fact that audio data is represented accurately
> shows that accurate timing is possible.
> So what I'm saying is maybe some kind of generic timing system could
> be built on top of the audio API and used for what ever.
> Like using audio signals as control values.

That is exactly how metro should work. Here is how it should be coded.
Metro internally keeps two values - one is the 'counter' and the other
is the fixed value of it's tick length in milliseconds ('length'). Every
DSP tick, you should add the length of one frame to the counter. The
frame length is the tick length in milliseconds which you can find by
dividing the samplerate by the frame size in samples (i think it's 128
in our case but should use the internal variable so it's always
correct). So then you have a test that looks like this in the dsp tick:

while (counter >= length) {
counter -= length;
sendBangToMyOutlet();
}

So basically every time the counter spills over the length of the metro
tick, a bang should be sent and the counter should jump back. The while
loop means we can be sure that even if it spills over several times in
one dsp tick (timer is set shorter than the length of a tick) that the
right number of bangs gets sent.

Hopefully this makes sense.

Sorry I haven't had time to look at all this lately. I'll try and get
onto it soon.

Chris.

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

Brandon James

unread,
Nov 1, 2010, 2:14:55 AM11/1/10
to web-pure-data
Thanks for that Chris. It makes total sense.
I have a couple things to wrap up first, but then I want to get back
in and do some more work on WebPd proper.
Getting [snapshot] working and adding [metro] and [delay] are at the
top of that list for me.
I assume [delay] should work much the same way as [metro].

Also, I think dollar ags in msg objects may have a problem with zero.

On Oct 31, 8:53 pm, chrism <ch...@mccormick.cx> wrote:
> On Sun, 31 Oct 2010 18:23:14 -0700 (PDT), Brandon James
>

chrism

unread,
Nov 1, 2010, 10:36:14 PM11/1/10
to web-pu...@googlegroups.com
Hi Brandon,

On Sun, 31 Oct 2010 23:14:55 -0700 (PDT), Brandon James
<xbrando...@gmail.com> wrote:
> I assume [delay] should work much the same way as [metro].

Yeah, exactly. There should be a 'spill' timer and when it goes over it
should trigger the delay bang.

> Also, I think dollar ags in msg objects may have a problem with zero.

Hm, that is very likely true! Maybe we should start using the issue
tracker on the google code page?

Cheers,

Chris.

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

Reply all
Reply to author
Forward
0 new messages