Forums > MaxMSP

controlling midi through audio

May 10, 2008 | 9:05 pm

Hi

this is probably very simple but im new to max/msp.
Im experimenting with conrolling midi via audio signals but this patch i put together isnt working…
What I cant seem to figure out is how to get it to read the on off state of the audio. as it is the midi signals sent have no sustain or release ect…
any ideas?

chris

{
"boxes" : [ {
"box" : {
"maxclass" : "number",
"patching_rect" : [ 95.0, 446.0, 50.0, 20.0 ],
"fontsize" : 12.0,
"numinlets" : 1,
"id" : "obj-14",
"numoutlets" : 2,
"outlettype" : [ "int", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 142.0, 37.0, 20.0, 20.0 ],
"numinlets" : 1,
"id" : "obj-13",
"numoutlets" : 1,
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "adc~",
"patching_rect" : [ 142.0, 78.0, 37.0, 20.0 ],
"fontsize" : 12.0,
"numinlets" : 1,
"id" : "obj-12",
"numoutlets" : 2,
"outlettype" : [ "signal", "signal" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "makenote",
"patching_rect" : [ 175.0, 389.0, 63.0, 20.0 ],
"fontsize" : 12.0,
"numinlets" : 3,
"id" : "obj-10",
"numoutlets" : 2,
"outlettype" : [ "int", "int" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "noteout",
"patching_rect" : [ 174.0, 438.0, 51.0, 20.0 ],
"fontsize" : 12.0,
"numinlets" : 3,
"id" : "obj-9",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "flonum",
"patching_rect" : [ 194.0, 264.0, 78.0, 17.0 ],
"htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"triscale" : 0.9,
"id" : "obj-3",
"numoutlets" : 2,
"bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ],
"outlettype" : [ "float", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "mtof",
"patching_rect" : [ 194.0, 224.0, 29.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-4",
"numoutlets" : 1,
"outlettype" : [ "" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "gate",
"patching_rect" : [ 130.0, 281.0, 27.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 2,
"id" : "obj-19",
"numoutlets" : 1,
"outlettype" : [ "" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "print attack",
"patching_rect" : [ 130.0, 301.0, 61.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-20",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "toggle",
"patching_rect" : [ 130.0, 262.0, 15.0, 15.0 ],
"numinlets" : 1,
"id" : "obj-21",
"numoutlets" : 1,
"outlettype" : [ "int" ]
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "(up to 3 outputs)",
"patching_rect" : [ 229.0, 248.0, 84.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-32",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "flonum",
"patching_rect" : [ 351.0, 199.0, 72.0, 17.0 ],
"htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"triscale" : 0.9,
"id" : "obj-33",
"numoutlets" : 2,
"triangle" : 0,
"bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ],
"outlettype" : [ "float", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "flonum",
"patching_rect" : [ 272.0, 200.0, 72.0, 17.0 ],
"htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"triscale" : 0.9,
"id" : "obj-34",
"numoutlets" : 2,
"triangle" : 0,
"bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ],
"outlettype" : [ "float", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "flonum",
"patching_rect" : [ 194.0, 200.0, 72.0, 17.0 ],
"htextcolor" : [ 0.870588, 0.870588, 0.870588, 1.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"triscale" : 0.9,
"id" : "obj-35",
"numoutlets" : 2,
"triangle" : 0,
"bgcolor" : [ 0.866667, 0.866667, 0.866667, 1.0 ],
"outlettype" : [ "float", "bang" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "unpack 0. 0.",
"patching_rect" : [ 194.0, 148.0, 61.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-40",
"numoutlets" : 2,
"outlettype" : [ "float", "float" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "newobj",
"text" : "fiddle~ 1024 1 20 3",
"color" : [ 1.0, 0.890196, 0.090196, 1.0 ],
"patching_rect" : [ 142.0, 122.0, 266.0, 17.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-64",
"numoutlets" : 5,
"outlettype" : [ "float", "bang", "list", "float", "list" ],
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "raw pitch and amplitude",
"linecount" : 2,
"patching_rect" : [ 230.0, 221.0, 83.0, 27.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-72",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
, {
"box" : {
"maxclass" : "comment",
"text" : "amplitude (dB)",
"linecount" : 2,
"patching_rect" : [ 351.0, 221.0, 50.0, 27.0 ],
"fontsize" : 9.0,
"numinlets" : 1,
"id" : "obj-73",
"numoutlets" : 0,
"fontname" : "Arial"
}

}
],
"lines" : [ {
"patchline" : {
"source" : [ "obj-12", 1 ],
"destination" : [ "obj-64", 0 ],
"hidden" : 0,
"midpoints" : [ 169.5, 108.0, 151.5, 108.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-12", 0 ],
"destination" : [ "obj-64", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-64", 3 ],
"destination" : [ "obj-10", 1 ],
"hidden" : 0,
"midpoints" : [ 336.75, 186.0, 180.0, 186.0, 180.0, 291.0, 206.5, 291.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-64", 3 ],
"destination" : [ "obj-33", 0 ],
"hidden" : 0,
"midpoints" : [ 336.75, 186.0, 360.5, 186.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-40", 1 ],
"destination" : [ "obj-34", 0 ],
"hidden" : 0,
"midpoints" : [ 245.5, 173.0, 281.5, 173.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-4", 0 ],
"destination" : [ "obj-3", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-35", 0 ],
"destination" : [ "obj-4", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-40", 0 ],
"destination" : [ "obj-35", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-64", 2 ],
"destination" : [ "obj-40", 0 ],
"hidden" : 0,
"midpoints" : [ 275.0, 143.0, 203.5, 143.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-64", 1 ],
"destination" : [ "obj-19", 1 ],
"hidden" : 0,
"midpoints" : [ 213.25, 139.0, 186.0, 139.0, 186.0, 273.0, 147.5, 273.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-19", 0 ],
"destination" : [ "obj-20", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-21", 0 ],
"destination" : [ "obj-19", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-64", 0 ],
"destination" : [ "obj-10", 0 ],
"hidden" : 0,
"midpoints" : [ 151.5, 249.0, 117.0, 249.0, 117.0, 375.0, 184.5, 375.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-13", 0 ],
"destination" : [ "obj-12", 0 ],
"hidden" : 0,
"midpoints" : [ 151.5, 72.0, 151.5, 72.0 ]
}

}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-9", 0 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-10", 1 ],
"destination" : [ "obj-9", 1 ],
"hidden" : 0,
"midpoints" : [ ]
}

}
, {
"patchline" : {
"source" : [ "obj-10", 0 ],
"destination" : [ "obj-14", 0 ],
"hidden" : 0,
"midpoints" : [ 184.5, 411.0, 104.5, 411.0 ]
}

}
]
}


Viewing 1 post (of 1 total)