Personal tools
You are here: Home community PdWikiWiki PdTutorialTutorialFour
Views

!Tutorial ­4­ A simple FM synthesizer. (patches tut4.pd, tut4a.pd, tut4b.pd,) Refer to the tutorial patch if you want to find out more about FM (there's a link to a good mini­tutorial). In short, Frequency Modulation consists of applying the output of one oscilator (the modulator) to the frequency of another (carrier). This way the frequency of the carrier is being MODULATED by the carrier. In this patch, we build the simplest FM generator. %%% %%% How it works: %%% %%% On the left "column" you can see a number box conneced to "[sig~":[sig~ (which simply converts an int/float to a signal, suitable for the "[+~":[+~ object) and this signal sets the frequency of the "[osc~":[osc~ down below. The signal from the "[osc~":[osc~ on the right is added to the frequency information of the carrier oscillator. Since the signal coming from the modulator is constantly changing different values are being added at different times (at the audio rate). Low values (up to few times a second) will give an effect of a vibrato, while the amplitude of the modulator will influence the width of the vibrato (the smaller amplitude, the more subtle vibrato). %%% %%% http://iem.kug.ac.at/pdwiki/images/pdtutorial05.png %%% %%% Now, when you get bored playing around with the parameters in this patch you can stop the audio and close the patch. Then open tut4a.pd. It is exactly as this one but it adds rude waveform display. Follow the instructions in the patch to activate it. The "[metro":[metro is set to 100 which means it will be updating the waveform every 1/10 of a second, which is not very smooth. You can change it to a smaller value (or larger for that matter) if you want tot update the display at a different rate. This patch doesn't add anything to your FM synth but at least it shows you one of the ways to use "[tabwrite~":[tabwrite~ object with a table (or array). "[tabwrite~":[tabwrite~'s argument is the name of the array. Now, here's a trick: hit CTRL­m (or select File­>Message) and a little window will pop up that is very useful for sendig various messages to PD or your patches. Arrays understand such messages so if you type "display resize 44100" (without the quotes) the table will resize itself to contain 44100 points. If you're running pd at 44100 Hz sampling rate then the array will hold one second of audio. You can play with different sizes of this array if you want to "zoom" in or out on your waveform. Array takes other messages. You can look them up in the "11.arrays.pd" in the control section of PD documentation. %%% %%% Let's go on with our FM mini­synth. What we've done so far, is a boring little patch. What is usually more fun is the ability to control when a note will start, how long it will last and what will be its amplitude and of course its envelope. First we'll do it in the poor man way. This way we'll be able to explore a few other PD objects. Later on I will give you some shortcuts. Don't skip to the shortcuts, though, you're here to learn the basics. Open the tut4b.pd patch. Here you see the patch that we started with except we've added an attempt at making the envelope... %%% %%% But it introduces a new object: "[line~":[line~. "[line~":[line~ accepts a message composed of a pair of numbers. First number gives the destination point and the second the ramp time. Those who are used to Max will be disappointed because "[line":[line and "[line~":[line~ in PD take only one pair of numbers. As in Max, however, you can specify the starting point, destination point and the ramp time as I did in this patch (i.e. "0, 0.9, 520"). %%% %%% http://iem.kug.ac.at/pdwiki/images/pdtutorial06.png %%% %%% ---- '''Previous: '''PdTutorialTutorialThree '''Back''' to: FrontPage ----


comments:

not found --fr4nck, Fri, 15 Feb 2008 16:30:24 +0100 reply
The requested URL /pdwiki/images/pdtutorial06.png was not found on this server.



Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser