The K Desktop Environment

5.5. Creating Instruments

The way aRts does midi synthesis is this: you have a structures which has some input ports, where it gets the frequency, velocity (volume) and a parameter which indicates whether the note is still pressed. The structure should now synthesize exactly that note with that volume, and react on the pressed parameter (where pressed = 1 means the user still holds down that key and pressed = 0 means the user has released that key).

When midi events arrive, aRts will create new structures for the notes as needed, give them the parameters, and clean them up once they are done.

To create and use such a structure, you should do the following:

A good way to learn how to do instruments is to open an existing instrument via File+Open Example and see how it works ;)