Mapping Pitch and Amplitude to the Track Pad with Max/MSP

trackpad_to_pitch_and_amplitudeCurrently I’m taking a graduate class in Max/MSP/Jitter at the University of Minnesota with Ali Momeni. Recent experiences including a night class in July at CNMAT (the Center for New Music and Audio Technology, UC Berkeley), and this current class at the U are really opening up my eyes (and ears) to the possibilities of Max 5. As a result I’m becoming more and more convinced that this is the ideal platform for the kind of projects I’m currently interested in.

The workload in the class is intense, but I have decided to punish myself even further by committing to post the audio output of at least one Max patch per week on Audio Cookbook in a new category called One Max Patch Per Week. It’s not quite as ambitious as my One Sound Every Day project, but with my busy schedule I should be able to keep up the pace.

Here’s my first entry into this new category. It is a simple way to map the input from the track pad or a mouse to the pitch and amplitude of a sinusoidal sound wave. For the patch I used the “pictslider” object, which outputs the x and y coordinates as scaled values.

I mapped the x coordinate to pitch with a range of values between 200 and 800 Hertz, and the Y to the amplitude with the typical MIDI based values of 0 to 127. I’ve included a screen grab of the patch so you can see how simple it was to do this.

Track Pad to Pitch and Amplitude

5 thoughts on “Mapping Pitch and Amplitude to the Track Pad with Max/MSP

  1. you know you can copy and paste compressed/uncompressed(preferred) max patches
    from the Edit menu.

    U can then create a new patch from File->New From Clipboard

    check out the max/msp forums on cylcing ’74
    this is how ppl trade patches

  2. Yeah. I’ve seen that done a lot. I may do that here once I start posting some more complicated examples. On the other hand the images are nice for a quick visual, so I’ll continue with that for non-Max using readers.

  3. i would like to reproduce as a lesson to myself (i’v been putting off for ages basic max msp learning) the patches you are going to work on. I notice that the screen shot does not show how you entered the x and y values-which is essential to get some sound.
    Your idea of sharing this work is a good one.

  4. Alright then, Brian. Since you’re the second person to suggest it here’s the patch. What I’ll do for future posts of this nature is to include the compressed patch in a comment rather than the post itself for the purpose of keeping the entries clean:

    {
    	"boxes" : [ 		{
    			"box" : 			{
    				"maxclass" : "pictslider",
    				"numoutlets" : 2,
    				"leftvalue" : 200,
    				"outlettype" : [ "int", "int" ],
    				"patching_rect" : [ 209.0, 128.0, 100.0, 100.0 ],
    				"id" : "obj-8",
    				"numinlets" : 2,
    				"rightvalue" : 800
    			}
    
    		}
    , 		{
    			"box" : 			{
    				"maxclass" : "ezdac~",
    				"numoutlets" : 0,
    				"patching_rect" : [ 209.0, 381.0, 45.0, 45.0 ],
    				"id" : "obj-3",
    				"numinlets" : 2
    			}
    
    		}
    , 		{
    			"box" : 			{
    				"maxclass" : "gain~",
    				"numoutlets" : 2,
    				"outlettype" : [ "signal", "int" ],
    				"interp" : 36.0,
    				"patching_rect" : [ 209.0, 284.0, 48.0, 73.0 ],
    				"id" : "obj-2",
    				"numinlets" : 2
    			}
    
    		}
    , 		{
    			"box" : 			{
    				"maxclass" : "newobj",
    				"text" : "cycle~",
    				"numoutlets" : 1,
    				"fontname" : "Arial",
    				"outlettype" : [ "signal" ],
    				"fontsize" : 12.0,
    				"patching_rect" : [ 209.0, 243.0, 45.0, 20.0 ],
    				"id" : "obj-1",
    				"numinlets" : 2
    			}
    
    		}
     ],
    	"lines" : [ 		{
    			"patchline" : 			{
    				"source" : [ "obj-1", 0 ],
    				"destination" : [ "obj-2", 0 ],
    				"hidden" : 0,
    				"midpoints" : [  ]
    			}
    
    		}
    , 		{
    			"patchline" : 			{
    				"source" : [ "obj-2", 0 ],
    				"destination" : [ "obj-3", 0 ],
    				"hidden" : 0,
    				"midpoints" : [  ]
    			}
    
    		}
    , 		{
    			"patchline" : 			{
    				"source" : [ "obj-2", 0 ],
    				"destination" : [ "obj-3", 1 ],
    				"hidden" : 0,
    				"midpoints" : [ 218.5, 366.0, 244.5, 366.0 ]
    			}
    
    		}
    , 		{
    			"patchline" : 			{
    				"source" : [ "obj-8", 0 ],
    				"destination" : [ "obj-1", 0 ],
    				"hidden" : 0,
    				"midpoints" : [  ]
    			}
    
    		}
    , 		{
    			"patchline" : 			{
    				"source" : [ "obj-8", 1 ],
    				"destination" : [ "obj-2", 0 ],
    				"hidden" : 0,
    				"midpoints" : [ 299.5, 272.0, 218.5, 272.0 ]
    			}
    
    		}
     ]
    }
    

Leave a Reply