| Navigation : Previous | Next | 
Using the Interface Boxes : Example
Building a Triad with an Item-List-Box, a Button-Box, and a Check Box
A minor or major triad is created with three interface boxes : multiple-items-list-box, button-box, and check-box.

- 
    On the left the build note!button calls a series of boxes :- 
        two list-boxes allow to choose a note name from A to G, and an octave index, from 1 to 5. 
- 
        the resulting reference is returned as a list with three lisp functions to n->mc[1] , 
- 
        n->mc returns a midicents value to a chord box. 
 
- 
        
- 
    On the right, the build chord!button calls another series of boxes :
- 
    The minorcheck box is checked and returns “true” to OMIF,
- 
    OMIF returns 300, which makes a minor third. If it isn’t checked, OMIF returns the value of a major third - 400 mc. 
- 
    The value of the root is added with 300 and 700 to build a minor triad, via two om+ boxes. 
- 
    The resulting values are gathered by x-append into one single list and returned to a chord box. 
Note: As n->mc returns a list , we have to use a chord box, and not a note box, to create the root of the chord. A note box doesn’t accept lists, but atoms.
Choosing and Listening to a Sound with a Pop-Up-Menu Box
Arguments of the Pop-Up-Menu:

This pop-up box returns two types of results :
- 
    Input #1 is connected to a textfile box, which contains a list of midi channel names . When output #1 is evaluated, it returns the midichannel number. 
- 
    Input #2 is connected to a lambda patch, which can play the sound of a selected sample. 
About MIDI Functions in OM:
Inside the Lambda Patch:

A sequence function evaluates two elements successively :
- 
    The pgm-out function sets the MIDI program from the midichannel index value passed as argument to the lambda patch. 
- 
    The play function plays a note with the chosen midi sound. 
The action programmed in the patch is executed when an item is selected in the pop-up-menu box.
References :
- [1] n->mc
Converts a note name or list of note names into corresponding midi cents values. The reference is the standard notation, where the medium C (6000 midicents) = C3.
Contents :
- OpenMusic Documentation
- OM User Manual
- OpenMusic QuickStart
| Navigation : Previous | Next |