Brush Workshop 2: The sinus
The great thing about controllers is you can make your brushes act a little by themselves by adding more or less predictable behaviors. In fact, that's how begins what we call the generative art! In this tutorial we're going to use a simple math classic: the sinus. Our brush will be very basic but also a good training ground.
As usual, let's select the default felt pen brush and open up our controller editor.
Let's delete some predefined controllers so we see clearly what we are doing: select the opacity output, delete all the nodes, select the size output, and delete everything there too.
Now we have a big neutral brush that doesn't even change size or opacity, perfect to start from scratch.
Let's get right into it by opening the "Math" folder, take a "Sinus" node and plug it into the size output:
Okay, that doesn't do anything. That's because as you can see on the node, the sinus requires an input value. What you need for a sinus is a value that always goes up. Let's try a "Length" node from the "Stroke parameters" folder:
Here we go! Our size does change over the course of the brush stroke.
The preview is a little full at the moment so let's reduce the size a bit to see our stroke better. Let's make it 10px.
Now let's open the sinus node's options to see what's happening. To do that, click on the "fx" button next to the small curve in the node.
Then click on one of the small circular button to zoom in the sinus curve:
Those who know their maths may say than a sinus always returns a value between -1 and 1. That's right but since you'll probably never want that kind of values in a brush, we've already set the amplitude and the offset to 0.5 so it comes between 0 and 1 right away and save everyone the hassle
Try the various parameters there. The period parameter for example will change the frequency of the waves:
So our sinus gives us this nice curve that goes up and down forever, as long as the input goes. If you try your brush now, you'll notice that the waves always have the same size. That's because it is calculated from the length of the stroke. Now let's replace that with a "Time" node:
The result is much more variable. In this case the sinus will make its waves based on the time elapsed and will not wait for you to cover a certain distance to calculate new values. If you draw slowly, it will make a lot a waves over a small distance.
Now that's cool but we don't have any pressure now that we replaced it by a sinus!
No worries, we can do everything we want here. Let's grab a "Pressure" node from the "Stoke parameters". And what we are going to do is multiply it with our first branch. Let's also take a "Mul" node in the "Operators" folder.
Now unplug the sinus, put it on the side, plug the mul node in the output and replug everything in the mul so it looks like this:
We can see what's happening by comparing the preview curves in the nodes: when the pressure is low, it reduces the sinus result.
And here we go, a pressure sensitive but still automatically varying brush!
As a final touch, I'm going to add an "Ease power" node to my pressure to gain more control over the lowest pressures and set the size from 0 to 15.
Time to draw!
This kind of setup can generate nice organic shapes out of random sketches:
Or even give some kind of a feather and ink feeling:
Notes and further ideas:
This brush always goes to a minimum size between the sinus waves, for more control you can change your sinus options to a lower amplitude and higher offset, like this :
This will make the lower values of the sinus also grow in size with the pressure.
Also, we will use them in other tutorials, but you can try and replace the sinus node by a noise node found in the "Signals" folder. This will give more random results.
And of course, try to plug a sinus in other parameters and add some controllers to your opacity to fine-tune your brush!