< Back to IRCAM Forum

Signal Controlled Force to Mlys.Lua

Can someone please explain to how would I create a force connection controlled by signal to “force” a mesh created inside mlys.lua? I wanted to create the equivalent to this:

mlys.point-input → mlys.signal → mlys.force → mlys.rect-plate → mlys.point-output

but inside mlys.lua with a mesh instead of a rect plate.

I tried to use something like

	local inputPoint1 = modalys.create_point_input{ name="input1",channel= 1}

	local mySig =modalys.create_controller{kind="signal",input=inputPoint1,name="MySignal1"}

	local meshAccIn = modalys.create_access{where=finalMesh,kind="normal",name="meshAccIn",position=396}

	local myForce = modalys.create_connection{kind="force",where=meshAccIn,name="cxForce1"}

followed by accesses and point-outputs on the object, but I don’t see how to connect the signal controller to the force connection.

Thanks in advance!

1 Like

Dear Theo,

That is a very good question. I will add the possibity to connect a signal to a force connection in the future update (3.6.2) of Modalys.
Meanwhile, there is a possibiity which is undocumented so ever slightly :smiling_imp:: through the dedicated create_input_force_signal_access function:

local signalToForce = modalys.create_input_force_signal_access{ where=doughnut, position=575, kind="normal", name="mySignalToForce",channel=1}

Atttached is the modified ‘parametric doughnut’ example. Note that the gain must be set quite high in order to excite the structure! (which is normal…)

Thank you for your feedback, and I will include this example in 3.6.2 as well.

Have a nice Modalys day!
Robert
lua_3d_parametric_doughnut_with_signal_input.maxpat (70.6 KB)

1 Like