[sharing sortie 4] gen~ seamless looper - comments welcome

Roald Baudoux's icon

Hello,

This is my first gen~ patcher. It is meant to loop a complete buffer with an ajustable crossfade time. Comments about coding would be highly appreciated.

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

Possible improvements : start and stop functions, varispeed, reverse playback.

Gregory Taylor's icon
Max Patch
Copy patch and select New From Clipboard in Max.

Not sure I entirely understand all of the insides, but let's try this: I don't think that those codeboxes are required for what you're doing - it's your choice to use them, but they don't look like they're going to buy you anything. There is one thing about the left codebox, though: you're making some kind of calculation for a variable called phaseoffset that you're calculating but not outputting, and it's not required in what's in the codebox [I could be wrong, of course. Did I miss something?]

Roald Baudoux's icon

Hi Gregory,

Thank you for the comments.

Yes I introduced the phaseoffset before figuring out that the offset between the two players had to be 0.5 but I forgot to remove it.

Sure it is not necessary to use codeboxes but do you think is it computionnaly less efficient ? Because on the other hand I think it is much easier to read with the codeboxes.

Whatsoever I like the idea of the possibility to use both single operators and codeboxes to build similar circuits. I think it will help a lot people to make the jump from regular visual max programming to text programming.

Gregory Taylor's icon

Ah that explains the stub in the codebox, then.

I am delighted and entertained by your presumption that visual programming is somehow the "regular" alternative. :-)

AFAICT, the computational efficiency is a wash.

I wanted to remind people that the codebox isn't necessariy save for a few very specific cases. Good luck with the rest of your patch - it's looking good.

Gregory Taylor's icon

Interesting. Just got an offline email from someone who thought that codeboxing was the ONLY way to do if/then/else stuff. I hope you'll forgive the slight divergence to your excellent share, Roald.

You can patch if/then/else stuff easily without going anywhere near a codebox. Here's a silly example of what something like

"If your input is less than 1.0, multiply it by .01. If it's greater than 1. square it. Otherwise, pass it through without doing anything...."

looks like.

5248.IfThenElse.jpg
jpg
Roald Baudoux's icon

The if / then / else was indeed one of the reasons to go codebox. Nice to see there's an alternative.

Gregory, my understanding of (american ?) english has its limits : what do you mean with "the computational efficiency is a wash" ?

Gregory Taylor's icon

"Patch of codebox? Er is bijna geen verschil, volgens mij."

Joshua Kit Clayton's icon

FWIW, there is a limitation where dynamic execution of code in if/then/else is codebox only. In the above and other scenarios when visual patching all of the code is executed. So if you have really expensive calculations in your different cases, you may wish to use codebox for that scenario.

Roald Baudoux's icon

Ah, maintenant je comprends mieux, merci Gregory.

Aber was Joshua geschrieben hat is auch sehr interessant.

Thank you, guys !

Gregory Taylor's icon

Graag gedaan, m'neer.