[sharing sucks. get a job] basic signal/float question

Jul 27, 2008 at 6:18pm

[sharing sucks. get a job] basic signal/float question

I wrote this cool oscilator for a synth. anyone can use it. pretty neat huh?

Now I want to keep it as an abstraction. I was just wondering if anyone had a good way to make all the parameters an abstraction signal/float. I know I could use sig. but this thing has like 10 parameters. thats 320 sig~s for a 32 voice poly. And you know what they say about patches with to many sig~ objects…

are there better alternatives?

– Pasted Max Patch, click to expand. –
#39017
Jul 28, 2008 at 7:53am

well… this kind of hackery used to work… in Max 4… but doesn’t in Max 5.0.4 (it seems to break the Audio until I reboot Max 5)

#P window setfont “Sans Serif” 9.;
#P window linecount 1;
#P newex 67 69 29 196617 sig~;
#P flonum 67 44 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 174 44 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 174 94 66 196617 prepend amp;
#P newex 67 98 67 196617 prepend freq;
#P user ezdac~ 190 209 234 242 0;
#P user scope~ 67 177 167 278 256 3 128 -1. 1. 0 0. 0 0. 102 255 51 135 135 135 0;
#N vpatcher 307 56 615 400;
#P outlet 32 258 15 0;
#P window setfont “Sans Serif” 9.;
#P newex 32 219 109 196617 *~;
#P message 169 148 36 196617 signal;
#P message 70 148 36 196617 signal;
#P newex 32 181 40 196617 cycle~;
#P newex 131 122 87 196617 route float signal;
#P newex 32 122 87 196617 route float signal;
#P newex 32 84 208 196617 route freq amp;
#P inlet 32 51 15 0;
#P connect 0 0 1 0;
#P connect 1 0 2 0;
#P connect 5 0 4 0;
#P connect 2 0 4 0;
#P connect 4 0 7 0;
#P connect 7 0 8 0;
#P connect 2 1 5 0;
#P connect 1 1 3 0;
#P connect 6 0 7 1;
#P connect 3 0 7 1;
#P connect 3 1 6 0;
#P pop 1;
#P newobj 67 144 36 196617 p test;
#P connect 6 0 7 0;
#P connect 7 0 3 0;
#P connect 4 0 0 0;
#P connect 3 0 0 0;
#P connect 0 0 1 0;
#P connect 5 0 4 0;
#P window clipboard copycount 8;

#136777
Jul 28, 2008 at 1:49pm

Why not just leave your sig~ outside the poly~? Then you’d only need 10? Or do I misunderstand the problem?

#136778
Jul 28, 2008 at 2:58pm

Why not just leave your sig~ outside the poly~? Then you’d only need 10? Or do I misunderstand the problem?

the reasons are two fold.

1) I was hoping to write a generic analog-style-synthesizer so I could shove different funky oscillators in. So for instance if I wanted to route the utility envelope to this thing, I’d be screwed with global sigs.

2) I really just want something modular. so if I have ten parameters, and in one situation I need to modulate 1-4 and keep 5-10 the same, I’d use signals on 1-4 and messages on 5-10. But if it’s different the next time around, the only solution for my abstraction is to have “signal/float” inlets like cycle~

Somehow I would have thought that a 6 year max user might have run into this already. makes me wonder if this doesn’t contribute to the barrier against modularity.

#136779
Jul 28, 2008 at 3:31pm

Oh I understand now. Martin Robinson’s method is the way I would have gone about it in Max 4 but if it is, as he says, broken in Max 5 I’m not sure what to suggest. Perhaps dynamically creating the sig objects/removing them using scripting?

Presumably this is to save CPU resources? (I don’t know what they say about too many sig~ objects ;-)

#136780
Jul 28, 2008 at 3:45pm

Yeah. on my reading, 10 sigs a poly would come out to 16 percent cpu just for generating control signals.

– Pasted Max Patch, click to expand. –
#136781
Jul 28, 2008 at 3:56pm

Matthew Aidekman wrote:
> Now I want to keep it as an abstraction. I was just wondering if anyone had a good way to make all the parameters an abstraction signal/float.

What about that ?

– Pasted Max Patch, click to expand. –

HTH

Ciao

#136782
Jul 28, 2008 at 3:59pm

I wasn’t expecting that patch but it demonstrates your point well! It only took 4% on my work machine. ;)

#136783
Jul 28, 2008 at 4:52pm

WHOA WHOA WHOA… WHOA. I am jacks unbridled sense of confusion

What on gods green earth is going on in that patch? I have never seen anything like that. I don’t understand it. it scares me. burn it at the stake. VOODOO WITCHCRAFT!

can someone point me to some documentation or an explanation?

Quote: gusanomaxlist wrote on Mon, 28 July 2008 09:56
—————————————————-
> Matthew Aidekman wrote:
> > Now I want to keep it as an abstraction. I was just wondering if anyone had a good way to make all the parameters an abstraction signal/float.
>
> What about that ?
>
>
> HTH
>
> Ciao
>
—————————————————-

#136784
Jul 28, 2008 at 7:13pm

whoa. seconded. WTF? how does sending the ‘signal’ message to
number~ pass the value?!

On Jul 28, 2008, at 12:52 PM, Matthew Aidekman wrote:

>
> WHOA WHOA WHOA… WHOA. A am jacks unbridled sense of confusion
>
> What on gods green earth is going on in that patch? I have never
> seen anything like that. I don’t understand it. it scares me. burn
> it at the stake. VOODOO WITCHCRAFT!
>
> can someone point me to some documentation or an explanation?
>
>
> Quote: gusanomaxlist wrote on Mon, 28 July 2008 09:56
> —————————————————-
>> Matthew Aidekman wrote:
>>> Now I want to keep it as an abstraction. I was just wondering if
>>> anyone had a good way to make all the parameters an abstraction
>>> signal/float.
>>
>> What about that ?
>>
>>
>> HTH
>>
>> Ciao
>>
> —————————————————-
>
>

#136785
Jul 28, 2008 at 7:41pm

> VOODOO WITCHCRAFT!
> can someone point me to some documentation or an explanation?
I overlooked Martin patch, which is even more voodoo because it uses
[prepend] after signal.
I forgot when and how I discovered that so I can’t explain it… (gurus,
please chime in!)

@Martin
weird, this trick still perfectly works for me (5.04 – os x) and I use
it a lot.

Ciao

#136786
Jul 28, 2008 at 8:25pm

Actually something else is breaking my audio, every time I turn audio on-off-on, unrelated to this issue. I’m glad to hear it still works in Max 5!

The way I figure this works is that MSP’s building of the DSP chain is done by MSP objects sending the symbol ‘signal’ around your patch, but crucially the MSP object will have attached (bound) some important data to the symbol ‘signal’ immediately prior to sending the message. This data is only accessible via the C SDK unless some other object enables access to it.

(This is similar to Jitter, although with Jitter you generally have some other unique symbol to which your Jitter matrices are bound.)

So as long as the symbol ‘signal’ gets around your patch immediately (not via any deferring mechanisms e.g., deferlow) the receiving objects will still be able to get at the signal data and have no knowledge it has gone via some other (voodoo?) route.

#136787
Jul 28, 2008 at 8:43pm

awesome patch (and i’m hoping to push some other thread to the top of the forums list instead of the shitty rant that’s been dominating so far…)

#136788
Jul 28, 2008 at 9:22pm

Matthew Aidekman schrieb:
> And you know what they say about patches with to many sig~ objects…

I don’t know, the only problematic direction is sig to float with
snapshot~, sig~ is probably the least expensive MSP object in the world,
its hard to beat…

Stefan


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

#136789
Jul 28, 2008 at 9:32pm

On 28 juil. 08, at 22:25, Martin Robinson wrote:

> Actually something else is breaking my audio, every time I turn
> audio on-off-on, unrelated to this issue. I’m glad to hear it still
> works in Max 5!
>
> The way I figure this works is that MSP’s building of the DSP chain
> is done by MSP objects sending the symbol ‘signal’ around your
> patch, but crucially the MSP object will have attached (bound) some
> important data to the symbol ‘signal’ immediately prior to sending
> the message. This data is only accessible via the C SDK unless some
> other object enables access to it.
>
> (This is similar to Jitter, although with Jitter you generally have
> some other unique symbol to which your Jitter matrices are bound.)
>
> So as long as the symbol ‘signal’ gets around your patch immediately
> (not via any deferring mechanisms e.g., deferlow) the receiving
> objects will still be able to get at the signal data and have no
> knowledge it has gone via some other (voodoo?) route.

I would recommend not using this hack in the poly~ context (in/out or
out/in), because poly~ have it’s own DSP chain, so it may not work
properly, or have some issues. Keep in mind that it’s more a hack than
the cleanest way to do it ever ;-)

ej

#136790
Jul 28, 2008 at 11:24pm

I’ve never really understood why sig~ doesn’t pass signals.

It should.

bt

barry threw
Media Art and Technology

San Francisco, CA
Work: 857-544-3967
Email: bthrew (at) gmail (dot) com
Web: http://www.barrythrew.com

#136791
Jul 29, 2008 at 1:10am

Quote: barry threw wrote on Mon, 28 July 2008 17:24
—————————————————-
> I’ve never really understood why sig~ doesn’t pass signals.
>
> It should.
>

Agreed. I run into this problem all the time. It would be really nice if a signal input had precedence over a float.

#136792
Jul 29, 2008 at 9:57pm

Matthew Aidekman schrieb:
> Yeah. on my reading, 10 sigs a poly would come out to 16 percent cpu
> just for generating control signals.

Its not the sig~s which create the CPU hit. You add all these signals,
and you use send~, which has to fill a buffer of a signal vector size.
This is way more expensive than the sig~s… Again, a sig~ is the least
expensive thinkable MSP object, it has to do almost nothing…
But it does matter how many signals you mix together…
(Inside a poly~ you are unfortunately forced to use send~, all sends are
outside of that DSP chain…)

Stefan


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

#136793
Jul 29, 2008 at 10:39pm

Quote: Stefan Tiedje wrote on Tue, 29 July 2008 22:57
—————————————————-
> Its not the sig~s which create the CPU hit. You add all these signals,
> and you use send~, which has to fill a buffer of a signal vector size.
> This is way more expensive than the sig~s… Again, a sig~ is the least
> expensive thinkable MSP object, it has to do almost nothing…
> But it does matter how many signals you mix together…
> (Inside a poly~ you are unfortunately forced to use send~, all sends are
> outside of that DSP chain…)

In fact I think that was how I figured you could do that ‘signal’ symbol trick/hack. I read a thread about using send/receive rather than send~/receive~ unless you really need the “runtime” rerouting capabilities of the ~ versions. With send/receive you’re just sending ‘signal’ when the DSP chain is built so can’t reroute at “runtime”. But send~/receive~ is more involved as Stefan says and uses much more CPU.

#136794
Jul 30, 2008 at 10:29pm

Fixed my MSP auth problem and yes my voodoo patch works in Max 5. Phew.

#136795

You must be logged in to reply to this topic.