dynamically generated code possible?

C Hausch's icon

hi everyone,

i want to generate dynamic hadamard matrices for a fdn reverb on the fly. i found a usuable code here https://www.geeksforgeeks.org/generate-hadamard-matrix-of-given-order/
and managed to replicate this in javascript inside of max.

now to actually use this i need to somehow put the code inside of a gen~ patcher, as feedbacks will be mandatory.

so the question is: can i generate codebox code inside of a gen~ patcher with javascript from outside of it?

any help would be highly appreciated!
thank you!!!

Graham Wakefield's icon

Check out the gen~.dynamicexpr.maxpat patch in the examples folder for gen~

C Hausch's icon

👍 just what i was looking for!
thank you very much!
☺️