Terug

Max les 2 – Basic Objects

Everything in Max is an Object

Number box

There are 3 types of number boxes, it will be very important to know the difference.

Integer – You can use whole numbers here. i.e. 3
Float/Decimal – You can use numbers that have a decimal point i.e. 3.14
Audio Rate – This has to do with controlling audio and will be skipped for now.

Bang

A Bang initiates or triggers the flow of code. If your code is a river of data, the bang object triggers the water to flow.

Toggle

A Toggle is a simple helper that outputs a 1 or a 0.

Opdracht 2-1

  1. Connect a Toggle to a Number box, lock your patcher, click over and over on the Toggle box. Does the number change?
  2. Connect a Bang to that same Toggle, Does the Toggle state change? Does the Number Change?
    You should be able to see how the 3 objects flow top to bottom.

Objects are just helpers

Slider

The slider object is a helper that outputs a number between 0 and 127 when you slide up/down.

Math

You can do any math operation in Max. The difference is that the math objects change the stream of numbers coming through the input. Operations include:
– (+) Adding
– (-) Subtracting
– (*) multiplying
– (/) dividing

Scale

Sometimes you need to change the range of numbers you are receiving from a sensor or from another stream of numbers

Opdracht 2-2

  1. Drag a slider from the patchers top bar
  2. attach a number box to the end.
  3. drag an empty object box from the top and type in * 3. connect the bottom of your number box to the top of this new math object. Can you imagine already what it will do?
  4. now attach a new number box to the output of the math object you just created.

Lock your patcher. Now when you drag the slider up/down you can see what numbers the slider outputs.

And can you see what happens to those numbers after you do the math?

The number box is just there to see the stream of numbers that happen behind-the-scenes.

  1. Now lets use the same slider to output yeat another range of numbers. To the side of the slider drag a blank object box and type in scale 0 127 1000 2000.
  2. Attach the output of theslider to the input of the scale object.
  3. Now add a number box after the scale and connect the two.

Lock your patcher. Now when you drag the slider can you see how the scale changes the numbers?

Opdracht 2-3

  1. Get the help file for jit.playlist (as in Les 1). Click on the playback tab and copy the same chunk of code as last time.
  2. Paste the code into a new patcher.
  3. add a slider
  4. Under the slider add a new object and type scale 0 127 0 3. Connect the two objects.
  5. Connect the output of the scale object to the input of your number box

Drag the slider up/down and notice what is happening.

By scalling the slider input to just 4 numbers (0 to 127 into 0 to 3) you made a channel switcher for your 3 video playlist

Opdracht 2-3 cont.

. Figure out how to add a new video to your playlist.
. HINT: Look at the Resources on the left-side of your Patcher window.
. change the scale object so that you can now slide to the new video.