Introduction
Instruments in Csound can be many things to many people: an instrument like physical instruments in which you play one note at a time, a generator to be used as a particle in a grain cloud, a live sound generation machine that one turns on and manipulates, or algorithmic note generation machine amongst many other things. With all the possibilities, it can be easy to get lost in working on a particular instrument, as well as can be difficult to integrate instruments from others into your own library to draw upon. This article will discuss some approaches and concepts of instrument building in Csound with an emphasis on practical tips for building up your own library of instruments.
Defining an Instrument
The first thing I recommend to do before building instruments in Csound is to carefully consider what are your musical requirements. This kind of question may be new to those who haven't worked with a tool like Csound before where one can determine aspects of one's own model of music making at a low level, as opposed to using something like MIDI where there already is a preconceived standard concept of musical information. However, this is not to say that MIDI is a bad model as it does cover a lot of the abstraction of what is an instrument. For the sake of familiarity for those new to Csound, we'll go ahead and use MIDI for our first set of musical requirements.
Templates
After deciding on what your needs are for the types of instruments you'd like to build and the musical ideas you want to express, I highly recommend creating an instrument template for yourself, something which you can use as a starting point to create new instruments. If you have an existing instrument you like, you might want to start out with that as a model.
Layout of Instrument Code
The following is an example for layout of your code and templates:
instr #
Instrument Configuration