# Signal Music, From Nothing
Signal music is all about procedural music where both the sequencing and the synthesis are handled using signal processing. It is possible to create signal music purely from mathematical fundamentals. This article will explore how to create a bass drum synth completely from scratch.
Take some function, $scale$. It takes 5 arguments, $n$, $a$, $b$, $x$, and $y$. $n$ is the value to be scaled. $a$ and $b$ are the low input and high input values, and $x$ and $y$ are the low output and high output values. Given a function like, $y = scale(x, 0.0, 1.0, 2.0, 3.0)$, we see that $y = 2.0$ when $x = 0.0$ and $y = 3.0$ when $x = 1.0$. This will be an important tool later.
> [!example]
> ![[image-88.png]]
> A graph scaled using the $scale$ function.
Consider $y = x$ where $x$ is time in Hz. If we find the graph $t = mod(x, 1.0)$, we will get a periodic graph of Hz over time. We will use a formula of $t = mod(2x, 1.0)$ because this will be one ramp per beat at 120 bpm.
> [!example]
> ![[image-89.png]]
> A ramp wave. This ramp operates at 2 Hz, or 1 beat at 120 bpm.
To our formula, $t = mod(2x, 1)$, we can multiply $round(1 - mod(x,1))$, which will create a gate signal which will mute every other ramp. $t = mod(2x, 1) * round(1 - mod(x, 1))$
> [!example]
> ![[image-90.png]]
> We gate the ramp wave signal, so a ramp is only generated every other beat.
We can use logarithms to create a very basic envelope. We will use this envelope to both modulate the amplitude but also the frequency of our bass drum.
> [!example]
> ![[image-91.png]]
> A simple envelope created using logarithms.
We can find $o$, which is our pitch envelope. This is $scale(c, 0.0, 1.0, 55.0, 110.0)$.
Given $c$, which is our envelope, and given $o$, which is our frequency over time, we can form a bass drum which triggers every 1 Hz with the formula $y = sin(τo)*c$. We run this formula through a $tanh$ function, which acts as a saturator, and will catch any peaks in the signal. $y = tanh(sin(τo)*c)$.
> [!example]
> ![[image-92.png]]
> A simple bass drum synth.