HPKComposer, the Instrument Editor

Each Instrument is editable in a graphical editor dependent of the choosen software synthetizer.You enter in the Instrument editor by clicking on one of the following buttons , which brings the Instrument Editor page.

The default is to use the HPKSynthe software synthetizer, as indicated in the upper right combo box. From this combo box you can choose another software synthetizer. The two buttons at the left of the combo box are the load and save buttons for this Instrument.

HPKSynthe graphical editor

One single view shows and allows the editon of all the HPKSynthe parameters:

c' combo box is a dynamic parameter that can be assigned to a controller by just selecting a controller number in the list.

Csound Orc graphical editor

This editor lets you to define instruments by using the standard Csound opcodes. The GUI provides four editors:

  • the Instrument editor, for coding the Csound instrument using Csound opcodes
  • the Function editor for describing the functions this Instrument is using
  • the Parameters editor for specifying the Parameter name and the value range, as well as a default value used when the score is not driving this parameter
  • the Global Variable editors for describing global variables required by the Instrument
  • the Output editor, that describes the ouput type of this Instrument, direct ouput using a Pan module and the Global Effects for this Instrument

As for any software synthetizer that can be used inside HPKComposer, it is possible to save and load Instrument definition.

In this editor, you define the instrument using the Csound opcodes. This is like building a Csound orchestra text file except that some conventions must be used because of the need to be integrated with HPKcomposer and its score generation structure.

The first important difference is how functions must be declared. In Csound, you just type the number of the function that is described in the score file (there is another option but this is the common way). As HPKComposer is generating functions and numbering them, it is not possible to keep this approach. For solving this problem, there is a special function editor where you register the function required by the Instrument. You give to each function a number as it should be in the classical Csound world, then you declare the use of this function in the Instrument Editor by using a special tag <fx>, where x is the function number as it has been registrated. During the generation, a correct substitution will be done.

Another difference is the declaration of the Instrument parameters. In Csound p1, p2, p3 are reserved, everything else is usage free. Inside HPKComposer, parameters 4 and 5 are reserved: p4 is the pitch and must be decoded using cpsch(), and p5 is the amplitude from 0 to 32000. As HPKComposer controls the generation of the score file (and the parameters values), only sixteen parameters are available for specific use. They must be coded as icx and not px as expected, x is in the range 1-16. The parameter value range must also be specified for letting HPKComposer convert from the generated score (normalized betwwen 0 and 127) to the required values. This is done in the Parameter editor.

Global variables are supported by you have to take care that any instance of a Csound Instrument will generate the global variables. This duplication will be source of errors.

Name conventions must also be followed for sound output. First of all the number of channels is defined by the settings: one for mono and two for stereo (sorry nothing else!). HPKComposer is able to transparently switch between mono or stereo when using any of the available software synthetizers, except in the case where you decide to directly  manage the output of you Csound intrument in the "Csound orc" editor. You must use the following conventions:

  • use out for the sound output if the output setting is mono, and this output is direct
  • use outs for the sound outputs if the output setting is stereo, and this output is direct
  • use aoutmix if you want to process the sound in the Global Effect modules. In this case the output must be monophonic as the Global Effects accept only monophonic source.

Example

Suppose you want to use the oscil opcode with a waveform described by the function number 14. You code the following in the Instrument page: kclk oscil 100,440,<f14>, and you type the function description in the Function page with number 14

Tips

  • The text ouput settings is usefull for monitoring the Csound compiler ouput
  • An error in the Function convention will bring a window during the files generation, with normally the incorrect string. For example, if you code this <fx> you will see x in the dialog box. Anyway be very carefull about the synthax.
  • If an Instrument is designed for using Global Effects, save it as an individual Instrument before setting the routing and levels.

Modular software synthetizer

The concept is very familiar: you select modules that you put on a surface and you connect these modules together. In general, each module is equivalent to a Csound opcode. Not all opcodes are available yet


  • for moving a module, select the "move" tool, click on the module you want to move and then click on a free place.
  • for deleting a module, select the "delete" tool and click on the module you want to delete (no possible undo).
  • for adding a module, select the "add" tool, or select an item other than the current one in the choice lists, and click on a free place.
  • for adding a connection, click on the "add connection" tool, and click on a "jack output", then click on a "jack input". You must always do a connection from the output to the input. A visual feedback is given for showing is the connectionis possible or not (audio, rate level connections)
  • for deleting a connection, click on the "delete connection" tool, and click on any of the "jack input" or "jack output".
  • Audio connection are in blue
  • parameters than cannot be modified at a k rate are in orange
  • you must use a score parameter module for linking any parameter to the score
  • in case of trouble with the connections, click anywhere on a free place, it will reset the state of the "add connection" tool.