note on-off swapper

Jan 10, 2010 at 1:34pm

note on-off swapper

Is there a better, or more elegant way of overcoming Max’s R to L order, and getting a note-off before a note on? For envelopes and stuff?
Brendan

{
	"patcher" : 	{
		"fileversion" : 1,
		"rect" : [ 29.0, 67.0, 640.0, 480.0 ],
		"bglocked" : 0,
		"defrect" : [ 29.0, 67.0, 640.0, 480.0 ],
		"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
		"openinpresentation" : 0,
		"default_fontsize" : 12.0,
		"default_fontface" : 0,
		"default_fontname" : "Palatino Linotype",
		"gridonopen" : 0,
		"gridsize" : [ 15.0, 15.0 ],
		"gridsnaponopen" : 0,
		"toolbarvisible" : 1,
		"boxanimatetime" : 200,
		"imprint" : 0,
		"enablehscroll" : 1,
		"enablevscroll" : 1,
		"devicewidth" : 0.0,
		"boxes" : [ 			{
				"box" : 				{
					"maxclass" : "newobj",
					"text" : "p vel_nn_off",
					"fontsize" : 12.0,
					"numinlets" : 2,
					"patching_rect" : [ 75.0, 66.0, 137.0, 23.0 ],
					"id" : "obj-35",
					"numoutlets" : 3,
					"fontname" : "Palatino Linotype",
					"outlettype" : [ "int", "int", "int" ],
					"patcher" : 					{
						"fileversion" : 1,
						"rect" : [ 0.0, 0.0, 640.0, 480.0 ],
						"bglocked" : 0,
						"defrect" : [ 0.0, 0.0, 640.0, 480.0 ],
						"openrect" : [ 0.0, 0.0, 0.0, 0.0 ],
						"openinpresentation" : 0,
						"default_fontsize" : 12.0,
						"default_fontface" : 0,
						"default_fontname" : "Palatino Linotype",
						"gridonopen" : 0,
						"gridsize" : [ 15.0, 15.0 ],
						"gridsnaponopen" : 0,
						"toolbarvisible" : 1,
						"boxanimatetime" : 200,
						"imprint" : 0,
						"enablehscroll" : 1,
						"enablevscroll" : 1,
						"devicewidth" : 0.0,
						"boxes" : [ 							{
								"box" : 								{
									"maxclass" : "comment",
									"text" : "select's R-L order prevents note-off appearing BEFORE the note on; this works",
									"linecount" : 4,
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 178.0, 100.0, 145.0, 71.0 ],
									"id" : "obj-29",
									"numoutlets" : 0,
									"fontname" : "Palatino Linotype"
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "newobj",
									"text" : "unpack 0 0 0",
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 125.0, 250.0, 77.0, 23.0 ],
									"id" : "obj-26",
									"numoutlets" : 3,
									"fontname" : "Palatino Linotype",
									"outlettype" : [ "int", "int", "int" ]
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "newobj",
									"text" : "pack 0 0 0",
									"fontsize" : 12.0,
									"numinlets" : 3,
									"patching_rect" : [ 125.0, 219.0, 63.0, 23.0 ],
									"id" : "obj-24",
									"numoutlets" : 1,
									"fontname" : "Palatino Linotype",
									"outlettype" : [ "" ]
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "newobj",
									"text" : "route 0",
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 159.0, 174.0, 48.0, 23.0 ],
									"id" : "obj-18",
									"numoutlets" : 2,
									"fontname" : "Palatino Linotype",
									"outlettype" : [ "", "" ]
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "comment",
									"text" : "note#",
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 50.0, 175.0, 37.0, 23.0 ],
									"id" : "obj-12",
									"numoutlets" : 0,
									"fontname" : "Palatino Linotype"
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "comment",
									"text" : "velocity",
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 210.0, 174.0, 52.0, 23.0 ],
									"id" : "obj-11",
									"numoutlets" : 0,
									"fontname" : "Palatino Linotype"
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "number",
									"fontsize" : 12.0,
									"numinlets" : 1,
									"patching_rect" : [ 87.0, 175.0, 50.0, 23.0 ],
									"id" : "obj-3",
									"numoutlets" : 2,
									"fontname" : "Palatino Linotype",
									"outlettype" : [ "int", "bang" ]
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "newobj",
									"text" : "stripnote",
									"fontsize" : 12.0,
									"numinlets" : 2,
									"patching_rect" : [ 87.0, 126.0, 58.0, 23.0 ],
									"id" : "obj-2",
									"numoutlets" : 2,
									"fontname" : "Palatino Linotype",
									"outlettype" : [ "int", "int" ]
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "inlet",
									"numinlets" : 0,
									"patching_rect" : [ 87.0, 40.0, 25.0, 25.0 ],
									"id" : "obj-30",
									"numoutlets" : 1,
									"outlettype" : [ "int" ],
									"comment" : ""
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "inlet",
									"numinlets" : 0,
									"patching_rect" : [ 118.0, 40.0, 25.0, 25.0 ],
									"id" : "obj-31",
									"numoutlets" : 1,
									"outlettype" : [ "int" ],
									"comment" : ""
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "outlet",
									"numinlets" : 1,
									"patching_rect" : [ 125.0, 333.0, 25.0, 25.0 ],
									"id" : "obj-32",
									"numoutlets" : 0,
									"comment" : ""
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "outlet",
									"numinlets" : 1,
									"patching_rect" : [ 154.0, 333.0, 25.0, 25.0 ],
									"id" : "obj-33",
									"numoutlets" : 0,
									"comment" : ""
								}

							}
, 							{
								"box" : 								{
									"maxclass" : "outlet",
									"numinlets" : 1,
									"patching_rect" : [ 183.0, 333.0, 25.0, 25.0 ],
									"id" : "obj-34",
									"numoutlets" : 0,
									"comment" : ""
								}

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

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-18", 0 ],
									"destination" : [ "obj-24", 2 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-24", 0 ],
									"destination" : [ "obj-26", 0 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

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

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

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-30", 0 ],
									"destination" : [ "obj-2", 0 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

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

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-31", 0 ],
									"destination" : [ "obj-18", 0 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-26", 0 ],
									"destination" : [ "obj-32", 0 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

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

							}
, 							{
								"patchline" : 								{
									"source" : [ "obj-26", 2 ],
									"destination" : [ "obj-34", 0 ],
									"hidden" : 0,
									"midpoints" : [  ]
								}

							}
 ]
					}
,
					"saved_object_attributes" : 					{
						"fontface" : 0,
						"default_fontface" : 0,
						"fontsize" : 12.0,
						"default_fontname" : "Palatino Linotype",
						"default_fontsize" : 12.0,
						"globalpatchername" : "",
						"fontname" : "Palatino Linotype"
					}

				}

			}
, 			{
				"box" : 				{
					"maxclass" : "newobj",
					"text" : "print vel",
					"fontsize" : 12.0,
					"numinlets" : 1,
					"patching_rect" : [ 75.0, 100.0, 56.0, 23.0 ],
					"id" : "obj-28",
					"numoutlets" : 0,
					"fontname" : "Palatino Linotype"
				}

			}
, 			{
				"box" : 				{
					"maxclass" : "newobj",
					"text" : "print nn",
					"fontsize" : 12.0,
					"numinlets" : 1,
					"patching_rect" : [ 134.0, 100.0, 54.0, 23.0 ],
					"id" : "obj-27",
					"numoutlets" : 0,
					"fontname" : "Palatino Linotype"
				}

			}
, 			{
				"box" : 				{
					"maxclass" : "newobj",
					"text" : "print off",
					"fontsize" : 12.0,
					"numinlets" : 1,
					"patching_rect" : [ 193.0, 100.0, 54.0, 23.0 ],
					"id" : "obj-25",
					"numoutlets" : 0,
					"fontname" : "Palatino Linotype"
				}

			}
, 			{
				"box" : 				{
					"maxclass" : "newobj",
					"text" : "notein",
					"fontsize" : 12.0,
					"numinlets" : 1,
					"patching_rect" : [ 75.0, 29.0, 46.0, 23.0 ],
					"id" : "obj-1",
					"numoutlets" : 3,
					"fontname" : "Palatino Linotype",
					"outlettype" : [ "int", "int", "int" ]
				}

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

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

			}
, 			{
				"patchline" : 				{
					"source" : [ "obj-1", 1 ],
					"destination" : [ "obj-35", 1 ],
					"hidden" : 0,
					"midpoints" : [ 98.0, 58.5, 202.5, 58.5 ]
				}

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

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

			}
 ]
	}

}
#47685
Jan 10, 2010 at 2:09pm

It’s not quite clear to me what you try to achieve. Note off happens before note on only if you play the video backwards… There is the swap object. And there’s copy compressed in the edit menu which makes posts much shorter.

_
johan

– Pasted Max Patch, click to expand. –
#171487
Jan 10, 2010 at 6:06pm

thanks for this – I even had the word ‘swap’ in the post-topic! i need this functionality for a polyphonic string model i’m building in max, and i’m trying to avoid using the ‘conventional’ method: previous noteoff; delay next noteon.
Cheers

#171488
Jan 11, 2010 at 1:13am

doh…

– Pasted Max Patch, click to expand. –
#171489
Jan 12, 2010 at 7:38am

a poly set to a single voice would do it better, you need more memory in case someone plays chords. The new version of the poly object has some specific modes for all possible cases…
Trashing noteoff information for a synth doesn’t make much sense for me, usually its better to use information than to trash it…;-)

Stefan

#171490

You must be logged in to reply to this topic.