One cool object in Pd makes it possible to analyse the frequency and amplitude of a note played on a guitar. It is called [sigmund~]. One use one can make of this frequency and amplitude is to control a synth, and turn a simple electric guitar into a monophonic synth-guitar.
Once again, I encourage you to read some literature and learn more about sound synthesis in Pd (do read Miller Puckette’s book, and also Obiwannabe’s website). In this example I used some simple FM synthesis (I haven’t studied it in depth, there’s a lot of room for improvement).
The patch analyses the input from the guitar and outputs a frequency (you have to play single notes for it to work) and an amplitude (the strength of the signal). These two are then fed into the FM synthesis part to control various parameters. Finally the amplitude of the guitar signal is used to control the volume of the synthesised sound (like a very rough Attack-Decay component in an analog synthesizer).
Note the use of :
- [loadbang] : it bangs when you open the patch (I use it to set some parameters at startup).
- [expr] : this object can contain some maths and logical operations that would require a lot of sinle objects otherwise.
- [sigmund] : analyses the frequency of the fundamental of the input. Very useful and speafy. Read the help patch to leanr how to tweak the parameters.
One last thing to to note : [sigmund] outputs values continuously. This means that even when you not actually plucking your strings, [sigmund] still tries to analyse the input even though no note is being played. It analyses the hum, static and other noise from your guitar, and mostly this translate to trash data (values jump constantly and frantically). It is thus essential to use the amplitude output of [sigmund] to create a gate below which no data is sent to the synth. If you pluck your string, the amplitude goes up, a note is being played and can be analysed, you can let the data flow to the synth. When you stop playing, the amplitude recededs back below the gate, the signal cannot be analysed as a note, and no data should go to the synth. This is exactly what the first [expr] object in the green area does, with a gate set to 35 (you can change this if your instrument makes less or more noise than mine).
- Here’s the link to download the patch.
- And finally, an audio sample.