Quantize midi in Max4Live

-dp-'s icon

Hello,

I begin in Max4Live and for my first realisation I'd like to create a device which put in time the notes play around... I don't know if it's clear...

I'd like to use onebang to send the midi note on the grid with the ableton live metronome.


Let me show you my realisation :

{

"boxes" : [ {

"box" : {

"maxclass" : "comment",

"text" : "delay",

"id" : "obj-9",

"numoutlets" : 0,

"style" : "",

"numinlets" : 1,

"patching_rect" : [ 56.0, 41.0, 150.0, 18.0 ]

}

}

, {

"box" : {

"maxclass" : "live.numbox",

"varname" : "live.numbox",

"id" : "obj-29",

"parameter_enable" : 1,

"numoutlets" : 2,

"outlettype" : [ "", "float" ],

"numinlets" : 1,

"patching_rect" : [ 56.0, 67.5, 36.0, 15.0 ],

"saved_attribute_attributes" : {

"valueof" : {

"parameter_longname" : "live.numbox",

"parameter_shortname" : "live.numbox",

"parameter_type" : 0,

"parameter_unitstyle" : 0

}

}

}

}

, {

"box" : {

"maxclass" : "button",

"id" : "obj-16",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 1,

"patching_rect" : [ 215.5, 468.0, 24.0, 24.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "delay 30",

"id" : "obj-15",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 2,

"patching_rect" : [ 215.5, 441.0, 50.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "pack i 0",

"id" : "obj-11",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "" ],

"numinlets" : 2,

"patching_rect" : [ 183.5, 522.0, 47.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "number",

"id" : "obj-7",

"parameter_enable" : 0,

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "", "bang" ],

"numinlets" : 1,

"patching_rect" : [ 119.5, 468.0, 50.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "unpack i i",

"id" : "obj-20",

"fontname" : "Arial",

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "int", "int" ],

"numinlets" : 1,

"patching_rect" : [ 54.0, 234.0, 65.0, 23.0 ],

"fontsize" : 13.0

}

}

, {

"box" : {

"maxclass" : "number",

"id" : "obj-22",

"fontname" : "Arial",

"parameter_enable" : 0,

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "", "bang" ],

"numinlets" : 1,

"patching_rect" : [ 54.0, 261.0, 38.0, 23.0 ],

"fontsize" : 13.0

}

}

, {

"box" : {

"maxclass" : "number",

"id" : "obj-24",

"fontname" : "Arial",

"parameter_enable" : 0,

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "", "bang" ],

"numinlets" : 1,

"patching_rect" : [ 100.0, 261.0, 38.0, 23.0 ],

"fontsize" : 13.0

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "int",

"id" : "obj-3",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "int" ],

"numinlets" : 2,

"patching_rect" : [ 119.5, 441.0, 60.5, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "pack i i",

"id" : "obj-18",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "" ],

"numinlets" : 2,

"patching_rect" : [ 12.5, 522.0, 126.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "midiformat",

"id" : "obj-5",

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "int", "" ],

"numinlets" : 7,

"patching_rect" : [ 12.5, 587.0, 154.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "int",

"id" : "obj-21",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "int" ],

"numinlets" : 2,

"patching_rect" : [ 12.5, 441.0, 60.5, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "button",

"id" : "obj-17",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 1,

"patching_rect" : [ 215.5, 303.0, 24.0, 24.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "midiparse",

"id" : "obj-19",

"numoutlets" : 8,

"style" : "",

"outlettype" : [ "", "", "", "int", "int", "", "int", "" ],

"numinlets" : 1,

"patching_rect" : [ 54.0, 203.0, 111.5, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "number",

"id" : "obj-14",

"parameter_enable" : 0,

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "", "bang" ],

"numinlets" : 1,

"patching_rect" : [ 12.5, 468.0, 50.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "metro 4n @active 1",

"id" : "obj-10",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 2,

"patching_rect" : [ 253.5, 268.0, 102.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "button",

"id" : "obj-13",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 1,

"patching_rect" : [ 253.5, 360.0, 24.0, 24.0 ]

}

}

, {

"box" : {

"maxclass" : "button",

"id" : "obj-12",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 1,

"patching_rect" : [ 215.5, 360.0, 24.0, 24.0 ]

}

}

, {

"box" : {

"maxclass" : "button",

"id" : "obj-4",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "bang" ],

"numinlets" : 1,

"patching_rect" : [ 253.5, 303.0, 24.0, 24.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "onebang",

"id" : "obj-8",

"numoutlets" : 2,

"style" : "",

"outlettype" : [ "bang", "bang" ],

"numinlets" : 2,

"patching_rect" : [ 215.5, 334.0, 57.0, 20.0 ]

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "midiout",

"id" : "obj-2",

"fontname" : "Arial Bold",

"numoutlets" : 0,

"style" : "",

"numinlets" : 1,

"patching_rect" : [ 12.5, 618.0, 47.0, 20.0 ],

"fontsize" : 10.0

}

}

, {

"box" : {

"maxclass" : "newobj",

"text" : "midiin",

"id" : "obj-1",

"fontname" : "Arial Bold",

"numoutlets" : 1,

"style" : "",

"outlettype" : [ "int" ],

"numinlets" : 1,

"patching_rect" : [ 54.0, 176.0, 40.0, 20.0 ],

"fontsize" : 10.0

}

}

],

"lines" : [ {

"patchline" : {

"source" : [ "obj-8", 1 ],

"destination" : [ "obj-13", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-8", 0 ],

"destination" : [ "obj-12", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-7", 0 ],

"destination" : [ "obj-18", 1 ]

}

}

, {

"patchline" : {

"source" : [ "obj-5", 0 ],

"destination" : [ "obj-2", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-4", 0 ],

"destination" : [ "obj-8", 1 ]

}

}

, {

"patchline" : {

"source" : [ "obj-3", 0 ],

"destination" : [ "obj-7", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-29", 0 ],

"destination" : [ "obj-15", 1 ]

}

}

, {

"patchline" : {

"source" : [ "obj-24", 0 ],

"destination" : [ "obj-3", 1 ]

}

}

, {

"patchline" : {

"source" : [ "obj-22", 0 ],

"destination" : [ "obj-21", 1 ],

"order" : 1

}

}

, {

"patchline" : {

"source" : [ "obj-22", 0 ],

"destination" : [ "obj-17", 0 ],

"order" : 0

}

}

, {

"patchline" : {

"source" : [ "obj-21", 0 ],

"destination" : [ "obj-14", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-20", 1 ],

"destination" : [ "obj-24", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-20", 0 ],

"destination" : [ "obj-22", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-19", 0 ],

"destination" : [ "obj-20", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-18", 0 ],

"destination" : [ "obj-5", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-17", 0 ],

"destination" : [ "obj-8", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-16", 0 ],

"destination" : [ "obj-11", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-15", 0 ],

"destination" : [ "obj-16", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-14", 0 ],

"destination" : [ "obj-18", 0 ],

"order" : 1

}

}

, {

"patchline" : {

"source" : [ "obj-14", 0 ],

"destination" : [ "obj-11", 0 ],

"order" : 0

}

}

, {

"patchline" : {

"source" : [ "obj-12", 0 ],

"destination" : [ "obj-3", 0 ],

"order" : 1

}

}

, {

"patchline" : {

"source" : [ "obj-12", 0 ],

"destination" : [ "obj-21", 0 ],

"order" : 2

}

}

, {

"patchline" : {

"source" : [ "obj-12", 0 ],

"destination" : [ "obj-15", 0 ],

"order" : 0

}

}

, {

"patchline" : {

"source" : [ "obj-11", 0 ],

"destination" : [ "obj-5", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-10", 0 ],

"destination" : [ "obj-4", 0 ]

}

}

, {

"patchline" : {

"source" : [ "obj-1", 0 ],

"destination" : [ "obj-19", 0 ]

}

}

],

"appversion" : {

"major" : 7,

"minor" : 3,

"revision" : 5,

"architecture" : "x64",

"modernui" : 1

}

}

double_UG's icon

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

-dp-'s icon

Wahou, thanx a lot, zl is much more elegant ! I love it.

If I want to change the grid and put the notes on quarter or 3/4 of time which object could be my friend ?

double_UG's icon

change the metro time to whatever you want.
Look at Help "Time Value Syntax"

1nd - Dotted whole note - 2880 ticks
1n - Whole note - 1920 ticks
1nt - Whole note triplet - 1280 ticks
2nd - Dotted half note - 1440 ticks
2n - Half note - 960 ticks
2nt - Half note triplet - 640 ticks
4nd - Dotted quarter note - 720 ticks
4n - Quarter note - 480 ticks
4nt - Quarter note triplet - 320 ticks
8nd - Dotted eighth note - 360 ticks
8n - Eighth note - 240 ticks
8nt - Eighth note triplet - 160 ticks
16nd - Dotted sixteenth note - 180 ticks
16n - Sixteenth note - 120 ticks
16nt - Sixteenth note triplet - 80 ticks
32nd - Dotted thirty-second note - 90 ticks
32n - thirty-second note - 60 ticks
32nt - thirty-second-note triplet - 40 ticks
64nd - Dotted sixty-fourth note - 45 ticks
64n - Sixty-fourth note - 30 ticks
128n - One-hundred-twenty-eighth note - 15 ticks