An Instrument responds to note events and produces an audio signal.
The job of an instrument is to produce sound based on control signals
arriving through its Controller
parameter. Fiddle ships with
a large number of instruments. Most are based on ChucK's built-in
UGens but you can extend the
set of available instruments in a few ways:
Probably the best way to familiarize yourself with an instrument is to load an example found here.
To add an instrument to your session, just select it from the menu. Since most instruments rely on connections to both a Player and a Channel, Fiddle offers an automation that creates and wires three nodes upon selection. At top-right, you can see that this feature is disabled. It can easily be toggled to your preferred state.
Here's the result of importing the Fluid (based on fluidsynth). If the network arrives in a jumbled form, the context menu provides a handy Re-Layout function.
At this point you should note the lack of notes. Unless we connect a
notestream node to the player input we'll get no sound
out of our instrument. Because of the diversity of options for notestreams
we don't auto-create+connect one. But if you find yourself repeating the
same sequence of operations you might explore the use of the
Graph Editor's Import
function.
If your creativity urges you toward novel instrument sounds, you can easily construct your own instrument from lower-level components already present in Fiddle + ChucK.
The starting point for a custom instrument is either the ADSR
or
the Envelope
instrument. These two starting points differ in their
implementation of the shaping of the audio envelope.
Here are three instruments provided for contrast. Note that, like the Channel
nodes, the ADSR and Envelope nodes have a dark-blue header signifying the ability
to build subgraphs within. Contrast this with the Wurley instrument that
comes in a complete form and therefore doesn't support subgraphs.
So now, let's create a custom instrument built on ADSR. The choice between ADSR and Envelope is a matter of taste. The ADSR instrument implements the common Attack+Decay+Sustain+Release enveloping strategy while the Envelope instrument implements a simpler, less-expensive envelope. In both cases it's the envelope itself than manages NoteOn/NoteOff messages. That leaves us to focus internal aspects of our instrument.
As always, in order to modify the subgraph of a node, you must "enter" it by double-clicking or via the context menu. To "exit" the subgraph, again use the context menu or double-click on an empty region of the subgraph.
To make your internal UGens are responsive to frequency or control-channel
changes you must wire your Instruments into the Instruments
outlet parameter.
You must also wire the audio outputs of your instrument components into
the Outlet
parameter. These instruments are auto-routed into the envelope
node where its NoteOn/NoteOff behavior is applied.
Here's a simple custom ADSR instrument that combines modulated Square and unmodulated Perlin produce a noisy sound. Note that both signals are affected by the outer ADSR envelope settings.