(maxmsp) Lecture Notes: Basic Programming

Learning to program requires:

  • Learning how to describe a problem or task as a series of discrete steps.
  • Learning how a particular programming language handles data, user interaction, input/output, and program flow.

Describing a Task

I can supply a formula for converting temperature in Farenheit to temperature in Celsius.

(TempF° – 32°) * 5/9 = TempC°

Computer programs will usually break down the formula into discrete mathematical operations, the same way you would solve the program yourself. The above formula in computer terms would look like:

  1. TempF° – 32°
  2. Result of 1. multiplied by 5
  3. Result of 2. divided by 9 equals TempC°

Or take the case of a synth arpeggiator. Described in regular language:

Given a MIDI note for input, auto-generate a series of notes in a rhythmic pattern.

Converted to steps:

  1. Receive MIDI note input
  2. Define one or more series of intervals for arpeggios.
  3. Using some type of timing device, add intervals to input note (to create arp notes).
  4. Generate output notes. (from 3.)

You can look at how I implemented the temperature conversion in Max/MSP by downloading the example patch from class. (http://kkothman.iweb.bsu.edu/mumet242-s08/examplePatches/day1.pat)


Leave a Reply