scale bottle-lag?

johannotto's icon

hi,
I always used iter/scale/group to scale my lists, now with very large and fast input-lists (up to 4096, see patch) could it be a bottle-lag? Is vexpr much more faster? What's the vexpr formula for simple linear scaling?
I know the Lobjects, but I try not to use 3rdParty objects if possible...

big thx,
johann

Max Patch
Copy patch and select New From Clipboard in Max.

Jean-Francois Charles's icon

Try:
[vexpr ($f1-$f2)*($f5-$f4)/($f3-$f2) + $f4 @scalarmode 1]
Jean-François.

Luke Hall's icon

I don't think [vexpr] can handle lists that long but I might be mistaken.

lh

Emmanuel Jourdan's icon

It sure can (>= 5.0.6). You can also have a look to my ej.lscale.

johannotto's icon

big thx!
works fine even with very big ones!

Luke Hall's icon

Ah, that would be the problem, I'm still using 5.0.4 where it appears the maximum is 999. Thanks for pointing that out Emmanuel.

lh

Emmanuel Jourdan's icon

That's right. It has been fixed for 5.0.6. You can have access to the what's new information by using the "Latest Support Information" item from the Help menu.

Roman Thilenius's icon

the scale formula for [vexpr] is the same as for expr,
but i always find it a bit brrrr to send [vexpr] a
list of 100 identical elements, which is why i do
the [zl len] [zl iter 1] [zl group] thing.

-110

Tj Shredder's icon

You can measure the difference in time, and if your input has a fixed range, you can simplify the vexpr. Even if you get rid of the [zl len] you're still more than twice as fast with vexpr...

Stefan

Max Patch
Copy patch and select New From Clipboard in Max.