SID sound patches and vibrato
This isn't going to be a Roland SC55, but we can get quite a bit of the way there while retaining the characteristics of the SID chips.
General MIDI specifies 128 sounds / sound effects and our MIDI input may instruct us to use any of those for a given channel. Building some of those sounds will be fun - reverse cymbal, or synth drum for example. Some are going to sound very similar to each other.
Automagic!
Which sound is played for each channel will be automatic, at least in this 'MIDI' mode. My program for C64 allows the user to map instrument to MIDI channel, but that's a pain to configure each time you use it, and a MIDI file usually contains the 'program' information. If you're using a DAW or scoring tool like Musescore, it's very easy to make sure that information is there. (the 'program change' event, Cx).
The SID chip is very flexible. Each voice has an envelope and waveform and each chip has a very flexible filter which can be applied to any of the voices. It has advanced features like sync, ring modulation and resonance.
Vibrato
As a brass player, a musical characteristic that's important to me is vibrato. This varies the pitch of the note very slightly. It makes the difference between a straight beep and a note that sounds like it's coming from a human player. A further enhancement is to hold the note straight for a short period before starting the vib.
Another term is tremelo which may be the same or slightly different. Players of different instruments will argue about exactly what these terms mean but really we're just talking about adding expression.
A brass player generally varies the pitch of the note, so that's what seems natural and 'correct' to me. More recently I have learned to use 'breath vibrato' with woodwind instruments which varies the intensity of the note just a little rather than the pitch. It happens that wobbling the pitch is the easiest thing to do with our SID voices, and so that's what we're doing here.
Implementing this in code
Like pulse width modulation (one for another day) vibrato isn't a setting on the chip, it's something you need to code.
The easiest way to do this would be to count up to a preset value, count down, repeat. However, I feel that the 'shape' of vibrato should be a sine rather than a triangle. So I've always used a sine table.
I've done this before in 6502 and Z80 assembly but it's way easier in C on a machine with floating point! You can see that I've generated a sine table consisting of floats, ranging from 1 to -1 and in 50 steps, meaning that a full sinewave at one step per 'frame' (or 50th second) makes one cycle per second.
Comments
Post a Comment