How can I flag an input/output to read/transmit MIDI connections in [gen~] ?
gen only supports audio in and out, no MIDI, so you can’t really transmit MIDI using it
Wellllllllllllll… That is unfortunate BUT:
That is only sort of partially correct.
[gen~] supports whatever signal you throw at it at audio rate.
It’s a [gen~] code export thing that does EASILY accept MIDI input and output as [gen~] I/O.
The code export framework takes any input named similarly to “in 3 MIDI” and links it to MIDI I/O specified in export patcher handler files.
[GEN~] DAISY_MIDI_io.gendsp google drive link
For the Mod DUO export thing a similar handle could be set.
This could greatly expand the ability to make tempo synced FX, never mind the synthesizer possibilities.
/it has helped that Maxlord Graham Wakefield is personally involved.
oopsy/source at main · electro-smith/oopsy · GitHub has some details.
MIDI input can be bursty and sparse. A [param] is not a good match for this, since it can only handle 1 value per block size (even at 1000Hz this might not be enough to capture really bursty midi). Instead we feed the raw midi bytes in via an [in] signal, one byte per sample.
I am not familiar with Max concepts, what is this “[in] signal” referring to? an extra audio port?
Can you do a code export via Max gen~? I will see about making use of the resulting code and try to have it as a synth.
I think I can answer you this one:
Everything in MaxMSP that handles audio takes a “~”, so I guess that if this was only referring to audio would be written, “in~”.
I would LOVE to be able to make this work with my beta Dwarf, whenever that arrives.
I have a guitar with a 1/8 MIDI output and, welllllll, the possibilities here make me giddy.
OK so, I took the Daisy Patch MIDI I/O example from Graham Wakefield and did some disassembly, snippet making, and example-ing. Included is the CPP Code Export from an altered “mod-gen~.empty_gen”, a bunch of texted [gen~] codebox outputs for reference, the original Oopsy Daisy Max Patch, and the Max Patch the MOD Cpp code was exported from.
Somewhere along the way I screwed up the note-off messaging but it shouldn’t matter for THIS exploration. I promise to fix it in the next few days, if you want.
@jon there is a [gen~] object OUTSIDE of the main patcher that is designed to take Max midi-format and turn it into audio-rate signaling by poking a buffer object. It is the object [p midimessages2signal]. I don’t believe that will be a required step along the way for the MOD environment but it is not required for this code to operate on Daisy hardware. HOWEVER, it is the thing that forces the in-line message parser to multiply the signal by 256 before the first data translation occurs in the message parser. So… there may be some message rate and bit depth things to deal with, I’m not certain.
BUT, it’s the thing that makes MIDI messages audio messages so…
On the upside, I am excited that the algorithms I’ve been making for my Daisy translates over to the MOD environment with great ease. BEST PHASER PEDAL I EVER WROTE
(now… if I can just get my UI chops together, I’ll send up some submissions for the pedal store)
Splitting hairs is what we do!
Everything in Max that operates at a fixed and locked signal rate gets a tilde. Video, Audio, or “Other”
HOWEVER, Referring to [in 1] or [out 2] inside of a [gen~] object these do NOT get a tilde, as they exist inside of [gen~] annnnnd inside of which everything happens explicitly at sample-rate. The goal being the entire calculation happens within a single sample unless you intentionally add delays to the signal for EQs or whatever whatever. The [in 1]/[out 2] are connectors to symbolize the ins and outs of the object-oriented codebox. The labels after the designation (“gate”, “minisynth”) usually mean nothing at all and just provide popup text to the object when you hover over a connection when connecting to it from outside of [gen~]. HOWEVER, what Graham did was add a hook to the Oopsy compile process to recgonize certain bits of text, i.e. “MIDI”, to tell them compiler something special to do with that input/output.
The instruction set for [gen~] is extremely limited compared to Max but it IS code so you can recreate any (almost) Max object inside of it, you just have to do it by hand. -Like making a toggle switch in code as opposed to just using the Max “toggle” object. Those objects do not exist in the [gen~] environment. It is purely math.
Attached is a screenshot of the most simplified [gen~] object included above that accepts 256 byte messages and outputs a cheese monosynth. (with the note off bug I got lazy about)
First of all thanks for sharing this
Second…I’m really curious about the Phaser sound! What about some audio samples of it?
Gotcha and thanks for the explanation. It makes a lot of sense.
Admittedly my Max knowledge has a bit of a gap on gen related stuff. Something that I’m aware for a while and that I’m feeling that finally got the perfect excuse to catch up on it
Who knows one of this days we will be creating some plugin for the MOD platform together
They are slowly rolling them out. Based on numbers I have seen shared, they have around 50% of the betas out the door.