Adding Keyboard Control
The sawtooth sound you created in the previous topic does not respond to the MIDI keyboard. In a few following steps we are going to fix that.
First, the sawtooth no more has a constant frequency. Instead it should have a frequency corresponding to the pressed MIDI key. So, right-click the constant module and select Delete. Alternatively you could have selected it by left-clicking and pressed Del key, or selected Edit->Delete from the menu bar. In any case, you no longer have 440Hz frequency source.
Now create an OnFreq module instead of deleted constant. Do it by right-clicking the empty space and selecting Basic->MIDI Note->OnFreq. If you read the module's description (by right-clicking it and selecting Module Description) you're gonna learn that this module produces the frequency corresponding to the pressed MIDI key. There is a shadow behind the OnFreq module, we're going to discuss it a bit later. Connect it to the F input of the sawtooth.
As the result you don't hear no more sound from the speakers no matter press you MIDI keys or not (of course you are not going to hear anything with Stop button pressed, but even pressing Play button does not help). Besides, you should see a shadow appearing behind the sawtooth module and a couple of red > signs appearing at the WaveOut's inputs. To deal with this problem let's take a brief look at one of the SynC Modular concepts.
Whenever you are going to buy a synthesizer gear you should wonder how many voices it is capable to play simultaneously. If you're told that a specific gear has 64 voice polyphony you are going to believe that it is capable of playing as many as 64 notes at the same time (sometimes manufactures call different things a voice, saying that a note can consist of several voices, but that's another story). Anyway we want a polyphonic sounding patch.
This means that if we want a 16-note polyphony for our patch, we need 16 sawtooth oscillators (and - for a bit more complex patches - also 16 filters, and 16 envelopes etc.). Of course you are not going to create 16 identical sawtooth modules in your structure.
When you see a shadow appearing behind a module, this module is polyphonic. This means that there is actually not one module, but many of them, one module for each voice. How many depends on the voice settings for the patch. As a rule, in SynC Modular you are not going to specify whether you want the module to be polyphonic or not. The SynC Modular makes the decision automatically (sometimes you are given control over the module's polyphony, but we are not going deep into detail here). In most cases when any of the module's input is coming from a polyphonic module, then the entire module is considered polyphonic. In our case the sawtooth module became polyphonic because it was connected to the OnFreq module which is polyphonic by itself.
So (assuming the patch is set to 16 voices) you have 16 OnFreq modules and 16 sawtooths. When you press a key on your MIDI keyboard the SynC Modular allocates a new voice for that key. If there are no free voices the oldest one is discarded. This is usually called latest note priority.
Notice. Discarding the voice produces an abrupt change in the sound which is sometimes quite noticeable and is heard as a click. In this case set the patch polyphony as large as required. Don't set it too large, because this increases memory consumption. Also too large polyphony may eat up CPU time.
Now that a voice is allocated, its OnFreq module is producing an output signal which is equal to the corresponding frequency in Hz, assuming the equal temperament scale (which is generally used in most western music). Just think of it as of producing the corresponding frequency. The connected polyphonic sawtooth is oscillating at the produced frequency.
If there's another key pressed at the same time, another voice is allocated, its sawtooth oscillating at a different frequency.
The only problem is that we don't hear any sound. That's because the WaveOut module is not polyphonic. Anyway there's only one audio output device in SynC Modular. And it is not clear how to route 16 polyphonic sawtooths into one monophonic WaveOut module. That's why those red > signs at the WaveOut's inputs, informing you that the connection is invalid. You have to tell the SynC Modular how the sawtooth outputs for all voices are supposed to be combined. This is done by introducing a VC (voice combiner) module into your structure. Right-click the background and select Basic->VC module from the menu.
Most often, you are going to just mix up (add) the outputs of a polyphonic module. This is the default working mode of VC module. Route the sawtooth output to the V input of the VC. We are not discussing the G input this time, leave it disconnected. Attach the VC output to the L and R inputs of the WaveOut module, replacing the old connections. Watch the green > sign at the VC output, informing you that this output is monophonic (while the entire module is polyphonic, as denoted by the shadow). Watch the red > signs at the WaveOut inputs disappearing.
Now click the Play button and play some keys on your MIDI keyboard. Hear the patch responding to different keys. Watch the number of allocated voices change in two windows on the toolbar. Why there are two windows is explained elsewhere.
next page>>