# Signal Music, Melody
The previous Signal Music article was focused on rhythm. This one is focused on melody and harmony.
# Melody
Building on the "evolving random" patches from the previous post, here are some ideas for creating random melodies. Pieces of these ideas can be easily combined to add small amounts of structure to your sources of randomness.
> [!example]
> ![[image-67.png]]
> Easy procedural melody ideas.
The first example shows using`[stash~]` as an evolving random melody generator. It will play a loop of 4 notes which will gradually change over time.
The second example shows using`[stash~]` as melodic lookup table. Another source of randomness generates a value which is used to look up the final value in the `[stash~]`. This can be a way to constrain random voltages to voltages found in a specific melody, for example.
The third example shows how you can take a MIDI note number (in the above example, a note from 32.0 to 64.0), break it up into its octave part and interval part, then constrain the interval part to a limited set of values. Then recombine to form the quantized MIDI note number.
## Harmony
Using 3 separate sequencers (in this case, `[stash~]` objects), it is easy to set up each sequencer so they're each playing different notes on a given beat. You can even vary the sequence lengths so they come in and out of relation with each other.
> [!example]
> ![[image-68.png]]
> Three independent stored sequences played together makes a harmony.
A fun technique is to take one chord shape, and slide it around. On some synths this is called "Chord Memory".
Another way to store a chord for later playback is to use messages containing lists to hold a list of notes to be played as a chord.
> [!example]
> ![[image-75.png]]
> Moving a stored chord shape around, or playing back multiple stored chord shapes.
Harmony can be played by three sequencers related only by allowed pitches, but this can get chaotic sometimes. I recommend using a pitch quantizer on each of the three voices.
> [!example]
> ![[image-76.png]]
> Three separate sources of randomness play notes in a chord.
Finally, one last thing to think about. Instead of sequencing note pitches, consider you can sequence intervals instead. These intervals can be added to existing pitches. This can be a quick way to generate harmonies. Pitch quantizers are recommended here as well.
## Other Ideas
As a sequence plays, it can be useful to have parts of it be significantly faster or slower (usually multiples like 0.5x or 2x) in order to have parts of the song that are more dense and parts that are less dense.
By playing a rhythm with ramps, then running it through a `[rate~]` which is dynamically changing over time, it can help add faster sections to the sequence.
> [!example]
> ![[image-77.png]]
> Other articles go into different approaches to dynamically divide a ramp, but this is one way to do it.
To make each note pop, it can sometimes be useful to have one note "duck out" another sound. This can be done with an envelope follower or similar, but since we are generating our music with ramps, we can simply mute ramps we don't want to play.
> [!example]
> ![[image-77.png]]
> One way to make a note not play when another instrument is playing (in the above example, the hi-hats will not play if a bass drum or snare drum is playing).
## Example
### Reactive Rhythm Section
> [!example]
> ![[image-49.png]]
> This patch combines three instruments, the [[Instrument IV, Blip Generator]], and two variations of the [[Instrument II, Noise Synth]].
This combines three different ideas into one patch. There's a bass drum synth, a snare drum synth, and a rate-modulated hi-hat synth. In addition, the snare ducks out when the bass drum is playing, and the hi-hats duck out when the bass drum or snare are playing.
> [!example]
> ![[image-50.png]]
> [[Instrument VI, Pad Synth]]
Chords are played by three triangle-wave synths. Each synth follows its own independent sequence of notes.
### Lead Synth with Rate Modulation
> [!example]
> ![[image-51.png]]
> [[Instrument VII, Lead Synth]]
A detuned-saw synth plays a sequence of notes, but the length of each note is determined randomly. Every time the ramp wave representing the note completes, a new rate is determined. The result should be varying rates of ramps, playing in sync.
## Bass Synth with Rate Modulation
> [!example]
> ![[image-52.png]]
> [[Instrument VIII, Bass Synth]]
A detuned-saw synth amplitude-modulated by a triangle-wave LFO. It plays through a predetermined sequence of notes. Every beat, it picks the next note, and also determines how many subdivisions should be played for that beat. 1-8x subdivisions are played during a given beat.
### Putting it all Together
> [!example]
> ![[example-4.mp4]]
> Performance of the last few patches. ([[example-4.mp4|Click here to view, if it's not displaying]])