Introduction

My first patch : Hello World

Control Objects

Signal objects

Variables

More Signal objects : handling MIDI

Conclusion

Bibliography. External information pointers.

Glossary.

My first patch : Hello World



When you first start jMax, it shows a window that resembles this :

The jMax console.



This window is the jMax console. This is the place where written messages are displayed, should they come from jMax itself, or from the patches you've designed, which is very useful for debugging, as you'll see all along this document.

Now, open the 'File' menu, and select 'New'. A blank window will appear. This window is called a patcher. A patcher window has two modes : an edition mode, in which you can build your jMax patches, and a playing mode, that simply turns you patch into a playable instrument. You can toggle modes by clicking on the little hand at the left top of the patcher.

Upper part of the patcher, edition mode.



Upper part of the patcher, playing mode.



When in edition mode, you can see a lot of small icons with various shapes and colors. This set of little icons is called the toolbar.

The jMax toolbar.



We're now going to create our first jMax patch. There's a legendary rule which says that every first example of a computer language shall be a program that says 'Hello, World !'. As jMax is really a programming language, I thought it would have been very dangerous to proceed otherwise.

So, let's proceed : when in edition mode, click on the second button from the left (the one located just after the small hand), and click anywhere in the middle of the patcher window. A small box appears, with a blinking cursor in it. If you click somewhere else on the patcher, the box becomes grey : in that case, just click on it again.

Type "print obj" at the blinking cursor, and click somewhere else on the patcher window. The box now takes a nice white and green face, and a small pin appears at the upper left corner of the little box. This pin is called an inlet, because that is where the object receives information from.

A 'print' object named 'obj'.



Congrats. You've just created an print object, whose name is obj.

Now, click on the third icon of the toolbar, place your mouse above the print object you've just created, and right click. Another small box appears ; it is slightly different from the previous one. A cursor blinks in it : type "Hello, World !" (including the surrounding double quotes). These two words won't fit on the same line, so you can resize the box by approaching your mouse pointer next to the right edge of the box, right click, and moving the pointer at the desired distance, where the line won't be split any more. Now, it should look like this :

A 'print' object and a 'Hello, World !' message.



The new box is a message box. The lower pin is called an outlet, because that is where this box delivers information to.

Now, click on the outlet of the message box, move your pointer to the inlet of the print object, and release your pointer. A small wire has appeared : it is a patchcord. Now, jump to playing mode (click on the small hand, first icon of the toolbar), and click and the message box called 'Hello, World !'. The 'Hello, World !' message appears on the console !

'Hello, World !' in action.







You are free to copy, modify or distribute this document under certain conditions.
See http://www.gnu.org/copyleft/fdl.html for more details.

(c) 2001 Fabrice Medio -- Last modification : Feb 10th 2001.