Hi, i wanted to ask How I could use Pd to specify a certain frequency and then show freuquency in a waveform, specifically a sawtooth wave
-
Making waveform
-
Well, if you want a full range sawtooth oscillator, you'll have to multiply the output of [phasor~] by 2 and subtract 1, so you can bring it to the range of -1 to 1.
-
Thank you guys so much. So just out of curiosity, if i wanted to run a patch that lets me click and switch between sawtooth waves and then a click back to a sine wave could i do that?
-
Easy peasy! Check out the [multiplex~] object, and use a toggle [tgl] for the switch.
-
@helpplease1 Also...... The [phasor~] object outputs a sawtooth, and if you feed its output into a [cos~] then you have a sine wave (the combination is the equivalent of [osc~]).
So if you switch on and off the [cos~] you have what you are looking for.........
sin_saw.pd
David.
-
Absolutely fascinating!!
IM going to go one step further. Say if I want it to produce FOUR different waves on command. So if i wanted a sawtooth then a sine and THEN maybe even a square or triangle wave. Im assuming this is all possible too then haha.
-
@helpplease1 It is indeed all fascinating.
In Pd extended there is an object called [square~] which uses a pulse width modulation technique (google for the wiki if you don't understand).
In the Pd doc there is a patch for a triangular waveform where the attack and release slopes can be defined...... J05.triangle.pd (in your program files/ pd/doc folder).
You should work your way through the doc folder. If you don't understand how the patches work then read http://puredata.info/docs/manuals/pd/x2.htm up to but not including chapter 2.9.
If you need help building your own patches then try the "floss manuals" https://en.flossmanuals.net/pure-data/ and some of the great tutorials on YouTube.......
David. -
I Feel like im a few simple steps away from achieving what I want with my idea.
So having established I can switch between multiple waveforms. i want to be able to create a patch that uses the GUI radio and be able to click a box that helps me create a sine, square, sawtooth and triangle wave on a graphical output everytime I click a different but specific output on the GUI radio box (Also known as the v or H slider) -
@helpplease1 The "bang" is a good way to make things happen. You can use it for example to open or close a [spigot] by banging a message [0( or [1( to its control inlet....
The radio outputs numbers from 0 to "n"...... right-click it for its properties and decide how many buttons you want......
The [select] object bangs one of its outputs when the incoming message matches one of its arguments...
You would start your project (something) like this........
button_control.pd
David. -
It seems that you've solved your oscillator issues and now you're into mixing them, but since the thread is about it, I've written a tutorial on waveshaping (my approach to waveshaping) which you can find here http://drymonitis.me/code/ under "Tutorials".