[mc.mtof~] outputs constant 8.18 Hz (midi note 0) when outside subpatch, otherwise not.

Esther Weitz's icon

Hey everyone!

I'm having a weird issue with the mpe synth I'm building. I put all the mpeevent message parsing inside a subpatch to keep my synth clean and just output multichannel messages for pitch/pressure/slide to be processed by the oscillators, filters, envelopes.

However there is some (to me) seemingly inconsistent behavior:

Any [mc.mtof~] conversion outside of the subpatch in which the mpeevent parsing happens, outputs a constant 8.18 Hz (the frequency of midi note 0) on all inactive channels:

When I add the [mc.mtof~] at the end of the subpatch everything is fine (see below), however I would like to modify the pitch afterwards to split it to oscillators with different base octaves for example.

Here is the patch where the problem occurs:

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

Here is the patch where [mc.mtof~] is inside the subpatch and the problem doesn't occur:

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

Any ideas are greatly appreciated!

Roman Thilenius's icon


why is it a problem?

to what frequency would you wish to set voices to, which are not in use and hence have an amplitude of 0 ?

Esther Weitz's icon

It's a problem because it really messes up the debugging info and while not a direct problem with the resulting sound in this patch I would like to reuse the subpatch and want to be able to write clean code.

I understand why the zeros are interpreted as "midi note 0" and thus produce the signal of 8 Hz. That's straightforward.

The question is: Why doesn't this happen as long as the processing happens inside the same patch? It seems like there's some kind of behind the scenes safeguarding that prevents this interpretation of "all zeroes are midi note 0 instead of 'no signal'" and I want to understand how that works, why it happens and how to reproduce it in order to really understand Max and multichannel objects in particular.

Esther Weitz's icon

Update: I found the problem and it's really frustrating... I'm going to create a new topic now that I know what the topic actually is

It's the scope of the [mc.noteallocator~]'s busy map which tells all other mc objects which channels are active. Since the noteallocator is inside the subpatch only the objects inside the subpatch know which channels are active and inactive.

The solution is to give the noteallocator a @name and then input that name into every mc objects "Busy Map Name"-Attribute. Sadly, there is no downward inheritance of scope, meaning: If I move the noteallocator up a level to the main patch then all the objects in the subpatch won't know about the busymap since they don't have a local mc.noteallocator.

So no matter what I do: as soon as I want to use subpatches (for waveform selectors or whatever) I will need to 1) explicitly name the [mc.noteallocator~] and 2) reference that name in EVERY SINGLE MC OBJECT. Please tell me, that it's just my inexperience and that there is a more elegant solution to this.

Roman Thilenius's icon


i suppose that is a similar issue as with turning off voices and signals using poly~:

when a signal connection is turned off, signal objects which are connected to it, for example a meter~ or number~, still keep the last signal value in mind.

because "no signal" is not the same as "0." - "no signal" can not have a signal value.