3

This seems like the most basic of things - I'm trying to add two frequency values together in Max for Live, but they only get summed when the first slider is updated.

Freq A = 100Hz
Freq B = 100Hz
So, A+B should equal 200Hz.
This happens if Freq A's slider value is updated.
But dragging Freq B's slider doesn't register any change.

I also confirmed the output frequencies with a spectrum analyzer.

A screenshot of the node setup (not in Presentation Mode, meaning no devices are hidden):

Two Max frequency sliders are connected to the sockets of a plus object.

Above: The Hz value is supposed to get summed in the + object before a tone is generated by the oscillator of the cycle~ object.

Sharing the node setup for easy copy/paste (minified):

<pre><code>
----------begin_max5_patcher----------
800.3oc6WssiaBCD8YxWAxuV1HL2RReaWU09V+AVUsxAbR7VvN01jMoq18au
FykXJDBaSTaUUeAB1GlY7YlyvjmmXAVx1iE.62aeusk0ySrrzKUrfU0yVfLz
93TjPCCjR1gmJRIIXNvob+cHNEkgOt8JN9a2rrd6sHY7FBc8CbbrrzUP2ogN
1QyKt5E5N00wNPc09K0uBGKvTIRRXzh2.VsNIQ6D1xGuABqsOKWlhkxCawkF
G.brAqRYHkyZLHhqhPIl+.lhVlhMMpoy5FiyJtF31MFo4YDpxwBSaw3j9haE
1xnTC1qZUAZGN4AjTxIKyk3i+RTw+UIfBFNMGyVUub85lmqTB8qEYAyvoM.F
c8.ooVXEaXbYC3OpvkiowGruqOv0LuaO6ko3Hc.Ms+cQ5RMnqle6BfPIRBJs
aRqOT0oMijTKX4JXB4gR6322oVh2JpimxseYxji2zWeYhyHUJT7SpB05pTId
utvB7tAzEKzUaPufhpMeOs7.ZTyshQkBx2KYhFNskrHDXfsIEdKWQP1eFw4r
mNotgPMTLsJuapXqoO.n2Ja30ilhODmhec.txCtPSV99ZEZAaX6YJPMXknSd
lEDknH8Ovwdz8QQmsO5rKnMp+umtn+i2DE8VZhd6+ah9FkIqQD5qmTkzZ29Z
TrHnQkDLunDbQzaSjDdt1GNl+5nvwoHBEWn.ZtV7DFbL7akc5uiUasR3eIZE
yL0.RkOof8qpQtYl6fpjngjHkL9nJ8Ct7R6XVVlJg24Kee.uiDis2g4RRr5q
1ojLhbf5acWU3rxavY5ayMJP1PRRvsJsaMFgaeiQr3zSQ.Fp0849Ro60a.gs
o4qUVdDJ+pQDB86Lhv4IBuAFm5NVZx36LbYiX3YPbZKoTTze9etoofh0aylB
VNOtNtpFGx9HIjfERBso+28M87Jvza9Zr9IbD9wqEFFuXdnSNR001wvtN18h
br+HbL7ZPsvwbDitFNBN1iDrkmJKRQa2p5iIpPqchRb+HSS0ybzORnkOpml.
vUc+pwGoWAwU5ZoRTmyKUH6iB.kuJSkzn4jpBFkmeYxO..PscvK
-----------end_max5_patcher-----------
</code></pre>

What I've tried:

Tried adding a trigger object, but I may have done it incorrectly. Or maybe that's not the thing to do.

Tried adding a float argument to the + object, as described here.

Read about adding frequencies, but something in my understanding is lacking.

Read about math in Max. I think I need some visual references.

I'm noob with Max, so I'm likely overlooking something basic. Any help appreciated.

1 Answer 1

3

This happens because the right inlet on + is "cold" (indicated by being blue). The math in Max page you link explains it, in the Inlets, Hot and Cold section:

As we’ve seen in the first set of math objects, some inlets cause an object to output a message, while others cause the object to simply store values. In fact, messages sent to any of the inlets cause these objects to store values; the difference is that values coming in the left-most inlet have an implicit bang message attached to them - this forces the math object to output the result of the calculation once the value is received and stored. We can see this in action by attaching a bang object to a math object, and using it to explicitly force output.

Here is a youtube video diving into more details.

Helpfully, that section also tells us what we need to do (although not in a ton of detail):

It is a common practice, when a cold inlet needs to produce output, to apply a bang message (via a button or trigger object) into the left-most inlet to force output.

What you actually need to do, is to add a new connection (keep the current one in place) from your second slider, to a button (bang) object, and then also connect the button's output to the first input of +.

What this does, is the button object, upon receiving any message, will output a "bang" message. When the + object gets a bang message in its left input, it will recalculate its result, based on stored values.

Picture (you'll have your sliders in place of the number inputs):

image showing how a cold inlet can be turned into a hot inlet in max4live

This is taken from this youtube video (which is from the same guy that I previously linked [no affiliation], I'd recommend you watch the full videos in order to get more detail on how things are working exactly)

Note, the button object needs to be to the left, graphically, of the input you're attaching to it, for this to work as expected. The follow up video to the last video explains why this happens (it's because max has a right to left [and also top down] order of operations)

2
  • Thank you! It's working now! That screenshot was super helpful for getting it up and running quickly. I will study the videos you linked to, to better understand why it works. The concepts of "hot and cold" inlets, and "bang" messages are new to me. I didn't realize that a button could be set up like that to give that inlet's requirement by first receiving it from my Freq B slider. Much of what I linked to in my question... was cryptic to me when first I read through it. Now it's starting to come together. Much gratitude.
    – Mentalist
    Commented Oct 20 at 20:04
  • 1
    @Mentalist Max is basically a programming language (with all the complexity that entails) and frankly... there's some legacy design stuff that makes it more complicated/confusing than it needs to be. (I work mostly in bitwig and its "Grid" system these days, which is a bit nicer IMO). But certainly, it is super powerful once you learn how it all works together. Best of luck!
    – mbrig
    Commented Oct 21 at 2:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.