How to generate note on/off in Max?
Hello,
I am super, super new to Max. I am using it for my senior Music Recording project, and I want to create a synthesizer that will eventually be controlled by data from a webcam. So far I have four oscillators and the gain objects to control them for a sort of additive synth, and the ezadc object so I can hear them. I just can't figure out how to generate what would essentially be note on/off. I tried the kslider object and it changes the pitch, but not the duration of the pitch. It also makes the pitch so low that I can hardly hear it, how can I fix that as well?
After this I will be looking for objects to begin messing around with webcam data, if anyone could point me in the direction of where to start with that I'd appreciate it!
Here's what I have so far.
{
"patcher" : {
"fileversion" : 1,
"appversion" : {
"major" : 8,
"minor" : 0,
"revision" : 8,
"architecture" : "x64",
"modernui" : 1
}
,
"classnamespace" : "box",
"rect" : [ 167.0, 204.0, 640.0, 480.0 ],
"bglocked" : 0,
"openinpresentation" : 0,
"default_fontsize" : 12.0,
"default_fontface" : 0,
"default_fontname" : "Arial",
"gridonopen" : 1,
"gridsize" : [ 15.0, 15.0 ],
"gridsnaponopen" : 1,
"objectsnaponopen" : 1,
"statusbarvisible" : 2,
"toolbarvisible" : 1,
"lefttoolbarpinned" : 0,
"toptoolbarpinned" : 0,
"righttoolbarpinned" : 0,
"bottomtoolbarpinned" : 0,
"toolbars_unpinned_last_save" : 0,
"tallnewobj" : 0,
"boxanimatetime" : 200,
"enablehscroll" : 1,
"enablevscroll" : 1,
"devicewidth" : 0.0,
"description" : "",
"digest" : "",
"tags" : "",
"style" : "",
"subpatcher_template" : "",
"boxes" : [ {
"box" : {
"id" : "obj-20",
"maxclass" : "kslider",
"numinlets" : 2,
"numoutlets" : 2,
"outlettype" : [ "int", "int" ],
"parameter_enable" : 0,
"patching_rect" : [ 26.0, 20.0, 336.0, 53.0 ]
}
}
, {
"box" : {
"id" : "obj-12",
"maxclass" : "gain~",
"multichannelvariant" : 0,
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "signal", "" ],
"parameter_enable" : 0,
"patching_rect" : [ 170.0, 158.0, 30.0, 140.0 ]
}
}
, {
"box" : {
"id" : "obj-11",
"maxclass" : "gain~",
"multichannelvariant" : 0,
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "signal", "" ],
"parameter_enable" : 0,
"patching_rect" : [ 123.0, 158.0, 30.0, 140.0 ]
}
}
, {
"box" : {
"id" : "obj-10",
"maxclass" : "gain~",
"multichannelvariant" : 0,
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "signal", "" ],
"parameter_enable" : 0,
"patching_rect" : [ 75.0, 158.0, 30.0, 140.0 ]
}
}
, {
"box" : {
"id" : "obj-9",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 240.0, 120.0, 59.0, 22.0 ],
"text" : "rect~ 440"
}
}
, {
"box" : {
"id" : "obj-8",
"maxclass" : "newobj",
"numinlets" : 3,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 179.0, 120.0, 49.0, 22.0 ],
"text" : "tri~ 440"
}
}
, {
"box" : {
"id" : "obj-7",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 108.0, 120.0, 60.0, 22.0 ],
"text" : "saw~ 440"
}
}
, {
"box" : {
"id" : "obj-3",
"maxclass" : "ezdac~",
"numinlets" : 2,
"numoutlets" : 0,
"patching_rect" : [ 103.0, 389.0, 45.0, 45.0 ]
}
}
, {
"box" : {
"id" : "obj-2",
"maxclass" : "gain~",
"multichannelvariant" : 0,
"numinlets" : 1,
"numoutlets" : 2,
"outlettype" : [ "signal", "" ],
"parameter_enable" : 0,
"patching_rect" : [ 31.0, 158.0, 30.0, 140.0 ]
}
}
, {
"box" : {
"id" : "obj-1",
"maxclass" : "newobj",
"numinlets" : 2,
"numoutlets" : 1,
"outlettype" : [ "signal" ],
"patching_rect" : [ 31.0, 120.0, 66.0, 22.0 ],
"text" : "cycle~ 440"
}
}
],
"lines" : [ {
"patchline" : {
"destination" : [ "obj-2", 0 ],
"source" : [ "obj-1", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 1 ],
"source" : [ "obj-10", 1 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"source" : [ "obj-10", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 1 ],
"source" : [ "obj-11", 1 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 1 ],
"order" : 0,
"source" : [ "obj-11", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"order" : 1,
"source" : [ "obj-11", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 1 ],
"source" : [ "obj-12", 1 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"source" : [ "obj-12", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 1 ],
"source" : [ "obj-2", 1 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-3", 0 ],
"source" : [ "obj-2", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-10", 0 ],
"source" : [ "obj-7", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-11", 0 ],
"source" : [ "obj-8", 0 ]
}
}
, {
"patchline" : {
"destination" : [ "obj-12", 0 ],
"source" : [ "obj-9", 0 ]
}
}
],
"parameters" : {
"parameterbanks" : {
}
}
,
"dependency_cache" : [ ],
"autosave" : 0
}
}
ADSR~
Have a look at [makenote].
Also, if you want to post code to this forum, select the objects in your patch, then do Edit -> Copy Compressed. Then paste in your post.