[newbie]: loadbang (or similar) on patch lock

Apr 26, 2008 at 3:28pm

[newbie]: loadbang (or similar) on patch lock

hi, everyone

being at Max for just a week, there’s plenty of things I don’t understand, but I’m getting there.

what I need to figure out is if there’s a way to trigger an object on patch lock.

loadbang is triggered at patch load, but when I switch between unlocked and locked there’s no way to re-initialize my stuff.

am I missing some secret object?

I’m a programmer, hence it’s very hard sometimes to figure out things that are too visual.

I’m loving it, though

ubi

#37270
Apr 26, 2008 at 3:37pm

A practical way of re-initializing a whole patch, is to have a
thispatcher object instanciated in the patcher.
Then, if you send it a [loadbang] message, it will re-fire all
loadbangs in your patcher and in its subpatchers.
If you only want to initialize what’s in a specific subpatcher, use
thispatcher at subpatcher level.

_M

On 26 avr. 08, at 17:28, ubi de feo wrote:

>
> hi, everyone
>
> being at Max for just a week, there’s plenty of things I don’t
> understand, but I’m getting there.
>
> what I need to figure out is if there’s a way to trigger an object
> on patch lock.
>
> loadbang is triggered at patch load, but when I switch between
> unlocked and locked there’s no way to re-initialize my stuff.
>
> am I missing some secret object?
>
> I’m a programmer, hence it’s very hard sometimes to figure out
> things that are too visual.
>
> I’m loving it, though
>
> ubi

#128662
Apr 26, 2008 at 4:02pm

hey manuel
thanks for your tip (it’ll be useful one day),
but I probably did not explain myself clearly.

what I need to do is “execute” something every time I lock the patch, not just when I “load”.

loadbang only happens when you load the patch.

while I work and test the app, I want the event to be fired every time I lock my patch, without the need to manually trigger anything.

is there a way?

u

#128663
Apr 26, 2008 at 4:10pm

On 26-avr.-08, at 17:28, ubi de feo wrote:
>

> loadbang is triggered at patch load, but when I switch between
> unlocked and locked there’s no way to re-initialize my stuff.

Dble clic in the [loadbang] instance will trigger it too!

p

#128664
Apr 26, 2008 at 4:20pm

Aha – I suspected something like this.
Afaik, it’s not possible with classical Max methods.
Maybe the Javascript freaks around here will bring the light.

_M

On 26 avr. 08, at 18:02, ubi de feo wrote:

>
> hey manuel
> thanks for your tip (it’ll be useful one day),
> but I probably did not explain myself clearly.
>
> what I need to do is “execute” something every time I lock the
> patch, not just when I “load”.
>
> loadbang only happens when you load the patch.
>
> while I work and test the app, I want the event to be fired every
> time I lock my patch, without the need to manually trigger anything.
>
> is there a way?
>
> u

#128665
Apr 26, 2008 at 4:20pm

thanks patrick.

found out that.
still there’s no way to have an event fired when you lock a patch?

#128666
Apr 26, 2008 at 4:25pm

i would map a key to fire a bang to a loadbang connected to a thispatcher. something like !, probably. so- apple-e to lock patch, shift-1 to init it. it’s a hack, but maybe it approaches the convenience you’re looking for.

#128667
Apr 26, 2008 at 4:37pm

I love how active this forum is and how people reply quickly en masse.

@joshua:
mapping a key might be a good way not to click,
but it doesn’t address my need (which is a quite OC one).

I’m trying to “initialize” values and objects every time I lock the patch, WITHOUT having to click, press, drag or “interact” with the patch in any way.

let’s say I’m being lazy,
but the main question here is how to execute a task that is easily achieved in any language at runtime :)

u

#128668
Apr 26, 2008 at 5:12pm

actually, this is not quite the same as initialize-on-run-after-compile of every other language.

the max scheduler is always running, unless it’s forcibly stopped or there’s a stack overflow. this is a substantial paradigm difference between working in max and working in non-visual-dataflow languages.

most max programmers almost never move out of edit mode. when we want to simulate clicks in locked mode, we merely hold down command (or control) when we click a UI element. there’s really no need to constantly switch back and forth from edit-to-lock unless you’re working hard on finishing the look of a patch.

keep working in edit mode, lock your loadbangs to !, and you should find that the different paradigm can be quite rewarding.

j

#128669
Apr 26, 2008 at 5:26pm

oooohhhh

I noticed that accidentally clicking with command pressed caused the UI objects to react, but never realized that the whole flow was triggered.

I played a bit with my patch and it worked in edit mode.

I guess I really have to spend more time on learning.
it’s fun anyway.

you all can imagine how hard it can be for a code writer to approach this new world.

on the bright side, I think the debugger is really amazing.

this patching thing rocks, and with the use of javascript I can achieve a lot.

thanks everyone who replied
u

#128670
Apr 26, 2008 at 6:00pm

On 26 avr. 08, at 18:20, manuel@cycling74.com wrote:

> Aha – I suspected something like this.
> Afaik, it’s not possible with classical Max methods.
> Maybe the Javascript freaks around here will bring the light.

In the ejies, I’ve something called ej.lock which reports the changes.

http://www.e–j.com

ej

#128671
Apr 26, 2008 at 6:24pm

hi, emmanuel

very interesting helpers of yours.
with JS I figured out I could access

this.patcher.locked

as I said, more than polling for it, I would have liked an event fired kinda like it happens with loadbang on load.

JS proves to be very useful for very basic tasks that are not covered (at least I couldn’t find any trace of them) like “for” loops.

I’ve never been so happy about a forum like this time :)

#128672
Apr 26, 2008 at 6:28pm

wow!

nevermind…
didn’t dig into your code first.

you can actually create tasks?

this is cool.

I HAVE WHAT I WANTED :)

and I learned a new thing on JS in Max
this thing rocks

thank you emmanuel

#128673
Apr 26, 2008 at 6:37pm

On Apr 26, 2008, at 10:26 AM, ubi de feo wrote:
> you all can imagine how hard it can be for a code writer to approach
> this new world.

Sometimes I think it’s easier for a digital hardware guy, than a
software person, to come to terms with the Max world.

Chris Muir
cbm@well.com

http://www.xfade.com

#128674
Apr 26, 2008 at 6:41pm

On 26 avr. 08, at 20:28, ubi de feo wrote:

> you can actually create tasks?

yep, so the polling is done in the js object. I’m glad you appreciate,
I just made it for fun ;-)

ej

#128675
Apr 26, 2008 at 6:49pm

On Apr 26, 2008, at 11:24 AM, ubi de feo wrote:
> JS proves to be very useful for very basic tasks that are not
> covered (at least I couldn’t find any trace of them) like “for” loops.

Things that you would use “for” loops for in a traditional language,
are generally dealt with using Counter or Uzi, in Max. It takes some
paradigm shifting, and you may always be more comfortable using
something like mxj to do this sort of stuff in Max.

-C

Chris Muir
cbm@well.com

http://www.xfade.com

#128676
Apr 27, 2008 at 4:59am

Chris Muir schrieb:
> Sometimes I think it’s easier for a digital hardware guy, than a
> software person, to come to terms with the Max world.

And even easier for an analog hardware guy. Max was easy to grab for
those who knew an analog modular synth. In the beginning, I explained
what was Max about, with that model. But these survive only in a small
technoid niche nowadays…

Stefan


Stefan Tiedje————x——-
–_____———–|————–
–(_|_ —-|—–|—–()——-
– _|_)—-|—–()————–
———-()——–www.ccmix.com

#128677
Apr 27, 2008 at 5:24am

On Apr 26, 2008, at 9:59 PM, Stefan Tiedje wrote:
> Chris Muir schrieb:
>> Sometimes I think it’s easier for a digital hardware guy, than a
>> software person, to come to terms with the Max world.
>
> And even easier for an analog hardware guy. Max was easy to grab for
> those who knew an analog modular synth. In the beginning, I
> explained what was Max about, with that model. But these survive
> only in a small technoid niche nowadays…

Hey! That’s my niche you’re talking about!

Chris Muir
cbm@well.com

http://www.xfade.com

#128678

You must be logged in to reply to this topic.