How to detect a hit on the guitar strings (coming through [adc~]) and use it as a simple bang trigger
Greetings.
I frequently use a live guitar in my PD patches, I route it through the mic input [adc~]. But now I am facing a problem, that you might help me with.
I am interested in detecting in PD the moment of hitting the guitar strings with the hand, e.g. like using a hand to drum on the strings.
It is a very percussing sound, similar to a snare hit.
I would like to detect this hit on the guitar strings in PD (coming through [adc~]) and use it as a simple bang trigger.
It would be easy to use the [fiddle~] attack output, but I don't want the trigger on any other guitar playing event (e.g., chords, notes ...) except on this percussive hit on the strings.
Do you have any guidance on where to start to tackle this problem?
I don't have the slightest idea where to search for information regarding this topic.
PDuino - simultaneous analog input and digital output problems
Hello!
I'm trying to get PDuino working in a setup where I have Arduino reading an analog input and also controlling a relay on the digital output. I have tried the StandardFirmata sketch for Arduino but it doesn't seem to be able to read the analog input with this sketch (it controls the digital output no problem with this however). When I use the AllInputsFirmata instead, it reads the analog inputs just fine but I'm getting no response on the digital outputs.
Is there perhaps something where you can't use analog inputs and digital outputs at the same time? Could I be doing something else wrong? I've tried all the other Firmata sketches that come with the Pduino setup files (out of desperation!) but with no success. Any help greatly appreciated!
Virtual metal guitar in Pure Data?
@Nobody This is the most basic Karplus-Strong emulation of a string. karplus~.pd
For emulating the rest of the instrument you'd need to include other aspects in the model, such as picking position and of course the body resonation as @whale-av mentioned. This might be easier to do for an electric guitar than for an acoustic, but I wouldn't know how to approach either.
Having said that, when you say "metal guitar" I guess you mean the genre like in the video you posted and not a guitar with a metal body like a dobro, if that's the case for emulating a very heavily distorted sound you might get away with a less-than-perfect model, and you can concentrate on modelling the amp, cabinet and effects. After all, the unprocessed sound of an electric guitar is pretty unimpressive to begin with if compared with the final processed sound.
Kraken a low-cpu, compact, highly versatile guitar effects stompbox
Kraken a low-cpu, compact, highly versatile guitar effects stompbox
Intent:
Make a guitar effects rack that would
- do a lot (includes 8000 pedal combinations)
- cost very little cpu; and
- eliminate the need to "connect" effects abstractions
(Master-Kraken-help.pd is the main patch.)
The Stack (in this order):
eq3
pre (gain)
3 effect/pedal slots (with clean-dirty "bypass" toggle for the whole set)
with each slot containing
a (tof) menu to select from 21 effects (0 being raw)
3 parameters (mknobs)
a dry-wet slider
a bypass toggle (for that line which crossfades in and out (set by the crossfade control, in ms)
and
an infinite sustain toggle (for that line)
reverb (with brightness and roomsize control and off|on toggle)
compressor (with threshold, limit, ratio, attack, release (zexy~))
master out level.
Kraken also includes:
a simple recorder (record and play (loop) toggles and recording the entire result)
a popup (standard tuning) guitar tuner
an [ adc~ | sample ] (a|s) switch (to test the sound or even post-process a track/file using openpanel)
and
a presets control which loads or saves the current settings (for the entire rack and includes a date+time prefix as well as an entered name for each preset).
Additional Info:
OpenSoundControl (OSC) has been exposed for a future/additional post ("Kraken-OSC") which I have almost finished in Mobmuplat (only, for now, PdParty and others to be added later) and can be accessed via the send and receive to network abstractions inside the patch.
**
EFFECTS LIST:
00-raw
01-chorus
02-compressor
03-delay(3-tap)
04-delay(fb)
05-delay(spectr)
06-distortion
07-filter
08-flanger
09-fuzz
10-looper(fw-bw) (>0.5 on, <0.5 off to record, play forward, or play backward)
11-octave_harmonizer
12-overdrive
13-phaser
14-pitchshifter
15-reverb
16-step-vibrato
17-tremolo
18-vcf
19-vibrato
20-wah-wah
Dependencies:
(which I believe are all available in Deken)
zexy
cyclone
moonlib
iemlib
ggee
plus zexy~ "load on startup"
Credits/Thanks/Acknowledgements:
As I think with most pure data patches Kraken is built on the back of lots of other people's hardwork and diligent effort. In particular, it owes its effects to predominantly the DYI2 library (by Hardoff), the Stamp Album library (by Balwyn), those on the Guitar Extended website (by Pierre), and less so to a few others. And to all of them, I am deeply thankful.
Tally-Ho! Happy playing.
I am very thankful to finally "Release the Kraken!". I hope it may bring you many hours of pleasure, entertainment, and possibly education.
p.s. if you see some of your work inside this, DO please let me know and I will credit you more specifically.
Thanks again. Feel free to ask any questions you may like regarding using the tool, the abstractions, etc., and I will respond to them as soon as I am able. -Peace
dbtorms
@pomolo This needed re-writing.
Dynamic range is meaningless in Pd (or any computer digital processing), in that it cannot be reproduced in the real world. The dynamic range is determined by the ratio of the biggest possible number to the smallest. Even in Pd 32-bit the biggest possible number is massive compared to the smallest.
Of course for FFT the dynamic range is constrained, as it depends on the sample-rate and bit depth.......
https://en.wikipedia.org/wiki/Audio_bit_depth
dB(something) becomes fixed, with real measurable (but weighted) values, when it is measured as sound waves in the air....... and it is fixed then because it is universally agreed that 0dB is the smallest pressure wave that can be heard by a human.
Only then can you define +100dB
RMS..... volts do not "exist" either until the [dac~] does it's work
How you scale the numbers to match your soundcard is up to you.
As Pierre says above 1V = +100dB has been "chosen" as sensible for Pd.
But as we all know, a traditional VU meter will show 0dB as "maximum".... not +100dB.
Hence the dB-100 part of the formula above.
+1...-1 (about zero) is considered safe for [dac~]
If the soundcard sees 1 as max for its conversion to analog all is well.
At 1.00001 it will clip. This value is fixed and known. There is nothing to be done about it.
The dynamic range of your card is not from 0dB to +94dB.
(Well....... it is, but that is what confuses the mind).
Its dynamic range is determined by its noise floor, and your card has a noise floor 94dB "below" the maximum that it can output before clipping.
The dynamic range of your card is from -94dB to 0dB........ if we agree that it will "clip" above 0dB.
So if Pd +100dB is 1 (in fact shown on the VU Gui in Pd as 0dB) then when the Pd Gui shows -95dB any Pd output will be masked by the noise floor of the soundcard....... (or more likely by dither if the soundcard is any good), as the very small numbers cannot be properly resolved, and that results in unpleasant audible artefacts.
And then there is the metering of the soundcard (if it has any).
Because it was traditional to overload magnetic tape, many of the first pro digital systems actually showed 0dB (the max number without clipping) as +18dB..... and showed red bars from +12dB upwards. Trying to make sure you would not clip your recording.
This has most of the info you are looking for I think........
https://sound.stackexchange.com/questions/25529/what-is-0-db-in-digital-audio
As with any analog or digital system you need to know "where you are" with the audio chain before you start work. Set an oscillator into a [dac~] with a VU driven by [pvu~]. You will see 0dB on the meter (1V RMS in Pd).
What does your soundcard show?
Do you need to trim the output of all your patches with a [*~ ?].?
Probably not.
Are there standards
No, not for metering.
If it shows +18dB or +12dB that is probably correct.
0dB on the Pd VU should show as the last bar on your soundcard before the red bars, but the soundcard metering might be lying..... to save you from yourself.
You will only get clipping where the maximum possible value is exceeded.
Volts, RMS or peak, are measures on a linear scale.
But our ears hear "power" and so the dB scale of relative power is a logarithmic scale.
The formula above equates the linear scale to the log scale, but they can "slide" against each other.
Putting an amplifier increases the volts, but how much more volume (dB) you get depends on the efficiency of the speaker...... losses in cables etc.
Only when you have decided 0dB can you say what is 100dB.
Or when you have decided 100dB you can say "how much" is 0dB.
Because it is all relative.
David.
how to turn a guitar sound into another one sound ?
@phil123456 He says it responds like the guitar because it is the guitar (no triggering of samples), and I would agree..... that it is all "effects"...... wah-wah, chorus (a lot), reverb, echo, tremolo, expander/compression......etc. (with some recorded Malibu beach sounds in the background).
There must be lots of guitarists that have tried in the past...... I just found this..... https://www.seymourduncan.com/forum/showthread.php?127086-Rhodes-sound-on-guitar
but there must be other threads out there.
David.
Sigmund~ Parameter_Setter: Use guitar notes to set patch parameters
Sigmund~Parameter_Setter: Using guitar notes to set patch parameters
sig-setter~-help.pd
sig-setter~.pd
Preface: I have been doing a lot of work recently setting up an electric guitar as an "arduino guitar" (with additional knobs, switches, etc.) to run my patches.
Occurred to me a couple of days ago (while considering buying a second ard to make a guitar for a friend), I could harness sigmund~ to just capture pitch (as digital values) and envelope (as the analog values) without ever changing the inside of the guitar.
The result is this patch.
Instructions:
The [ON] toggle triggers a [switch~] and would be used during setup and (probably) not performance (without severely cramping one's playing style).
The grid of hradios represent the fret board (in standard guitar tuning). Low on the bottom, high on the top.
The first three (bottom hradios) strings (low-E,A,D) run from midi-pitch 40 thru 54. So if you play for example pitches 40-44, it changes the first string hradio between the values of 1 and 5. The A and D strings do the same but for their respective hradios. (The first 6 outlets (from left to right) represent the 6 strings).
The three high strings also capture hradio values. But in the special case of being in "open", (using the [env~], in other words how loudly you play the note) they send analog values between the range of 0 and 1 (as shown in the val0, val1, and val2 sliders and are sent to the right three outlets). So if you play the note loud it sets the parameter/slider closer to 1, softer closer to 0.
The "threshold" (sigmund~ minpower param) is used to filter for ambient noise and add sensitivity control and defaults to 66. So it can be set to capture the softer sounds and change the range of the analog values. (It's max is 100. Changing that value would need to be done internally within the patch).
I am pretty sure if configured properly, this makes my arduino guitar idea mute.
On the other hand, I love to play with knobs and switches so am Not going to abandon that tool for this patch.
However, I think this patch might prove useful to others.
If not to actually use, then at least for the sake of an idea-generator about how to use the fretboard (potentially instead) of arduino to set param values.
Happy Pd-ing,
Scott
p.s. This is setup to use standard guitar tuning but other tunings could easily be fashioned.
You can see the effect in action by clicking on the messages (which represent (midi) pitches)) at the top right of the help file. Changing the "gain(log)" before clicking a message impacts the analog values.
p.p.s. Sorry, it's so large, but my eye-sight is very poor and this scale just makes things a helluva a lot easier on me.
afterward:
If it bounces between values on you, try (in this order): a cleaner sound (un-effected), changing the threshold, or if necessary the parameters inside the sigmund~ object.
Dynamic Effect/Plugin Loader esp. For Rapsberry PI (DIY2 and Stamp Album effects/plugins)
Dynamic Effect Plugin Loader esp. For Rapsberry PI (DIY2 and Stamp Album effects/plugins)
DynamicEffectPluginLoaderForPI.zip
Background:
In the last couple of days I finally built something I have needed and wanted for a while (which later on I will discuss in more detail under a separate thread): an Arduino electric guitar.
In other words, I took the connections off the 5-way and knobs (internally connected to the pickups and line out) and rerouted the switch and knobs to an arduino. The reasoning being I can control Way more with pd and those knobs than what they were originally intended to do if I capture their output using Arduino.
However, the patch I had built for it was clocking in at about 275-300% of the pi's cpu. And while I could have gone back and added switches (which I took out a while back, to replace with fade-mixers for when I change an effect) throughout, the thought of doing that was more daunting than (considering how elaborate the patch is) I wanted to undertake.
Enter: Dynamic Patching.
I found that with just 3 straight-chained effects the pi ran at only about 10%.
So...here's what I built and am sharing now (before tying it into the arduino guitar, because I think others might want to go ahead and learn from it, extend it, expand upon it, use it, etc. etc.).
The patch(es, there are two, one laid out for the DIY2 plugins and one laid out for the Stamp Album ones, will probably consolidate them later, but other things are demanding my attention) is pretty straight forward:
(Dependency on the tof/menubutton, tof can be found via deken)
Click on the menus at the top to select an effect for each of the 5 slots or select the "unchanged" effect to leave that slot open.
Then click the BUILD bang or the CLEAR bang (to start over).
The selected effects will load into the PALLETTE subpatch already connected to adc~ and dac~.
That's really about all there is to it. Very straight-forward, clean, and very cpu light-weight. The racks of all 5 slots I tested ran at about 10-12% on my PI 3r2.
Hope you can make use of it. And would love to hear feedback.
For the future:
Add a hid-stomp controller to load preset racks (which you can send in via the tof/menubotton) to load racks on the fly;
Add a meta-level to send either hid, osc, or arduino commands to each of the loaded effects.
Merry Music to us, one and all.
Peace,
Scott
p.s. Oh! The arduino guitar: though it has no connected pickups it gets its audio signal from an (about) 1" piezo mic fun-tacked to the knob-well inside the guitar. Sounds great. Just pure guitar. The tone, texture, etc. come after the fact via the pd-side.
Ciao for now.
Wanna say: the real genius lies not in what I cobbled together, but the strength of will and purpose it took for the two original developers to make abstractions so completely consistent and thoroughly aligned. My highest regards to you both. Thank you, both, so very much, for helping to make my "job" so easy.
2017 06 25 01:4:06 - The Way I REALly Want to Play with Her (For My Guitar's Sake (Improv) Remix-0): improv remix (using Anduril and a midi-keyboard as parameter controller)
2017 06 25 01:4:06 - The Way I REALly Want to Play with Her (For My Guitar's Sake (Improv) Remix-0): improv remix (using Anduril and a midi-keyboard as parameter controller)
I think this turned out Really well! (A mix of an old guitar piece where this time instead of the guitar (send it as input~) I "played" the effects.
I configured my "Samson Graphite M25" (USB, midi-keyboard) so the keys sent (0-1)/7 and the velocity sent the [line~] values to my xyz effects.
So I divided the keyboard into 3 sets of 8 controls to send values to my effect parameters, i.e. as I "played" a key, the parameter value [line]d to the chosen value. The greater the velocity the shorter the line.
Was a hell-offa lot of fun.
I also added a key (the 25th) to turn on the elven-cloak (pitch/env~) automatic parameter changer, and my CC's to change the values on a twist.
Hope you like it. Better to hear it than talk about it, right?
The original guitar piece (mine) is one of my favorites I have done and really lent itself to this techinque.
Ciao for Now and Happy PDing.
Sincerely,
Scott
Audio Ideas (AI) Collection (placeholder, currently only links)-effects, controllers, mmp, etc.
Audio Ideas (AI) Collection (placeholder) currently only links
per @LiamG 's kind suggestion I have begun the process of consolidating my abs and patches, etc. into a single location/zip file or for possible upload to github.
Just to get the ball/me rolling and scope the work I got the links for my shares into a single location to later be consolidated into the single AI Collection.
For now at least, please, bare with me (and the links below) as ideas I am more passionate about currently are demanding my attention. (Which funnily enough will probably also be included in the set, where ever they are shared.)
Thanks, for your patience and all you do for the Pure Data Family.
Sincerely,
Scott
abstract~
pushdelay-envelope-env-driven-delay-line-with-both-delay-time-and-feedback-dependent
numpad-abstraction-for-entry-of-large-numbers-via-click-instead-of-sliders-includes-basic-calculator
abs_delay_fbw-feedbackwards-lifo-last-in-first-out-delay
abs_sequences_by_formula-sequences-by-formula-abstraction-ex-collatz
abs_effects_router-60-effects-in-one-abstraction-router-from-diy2-stamp-album-my-abs
visualcontrolsurface-vsl-values-set-by-their-location-on-the-screen-req-ggee-shell
abs_4-8-14_way_toggle-pair-2-toggles-resulting-in-4-8-or-14-states
audioflow-delay-to-forward-backward-looper-using-speed-control
5-band-equalizer-with-bezier-controller-eq5_mey_w_bezier_sv-pd-updated-to-8-band-below
forward-backward-looper-orig-abs-from-residuum-whale-av
abs_rgb2hex-rgb-0-255-colors-to-hexadecimal-values
pseudo-12-string-effect-6-string-guitar-to-sound-like-a-12-string
jack_midi2pd_2sys_connector_sv-jack-midi_out-to-pd-sys_playback-switcher
abs_4to16pads_bin_conv_sv-convert-4-midi-pads-from-a-binary-value-to-a-decimal-for-rerouting
abs_automatedslider_sv-automated-control-changer-pd-and-mobmuplat-editor-versions
idea-for-effects-stack-ing-technique-control-mother
micin-_abs-abstraction-convert-signal-to-notein-ex-using-a-midi-synth-as-a-guitar-pedal
curve_abs-tri-way-curve-switch-to-change-control-values-in-either-linearly-convex-or-concave-manner
a-preset-control-abstraction-for-saving-parameters-presets-to-text-files
4-tap-delay-with-pitch-shifter-per-delay-line-adaptation-of-diy2-patches
patch~
extra
the-15-owl-faust-patches-compiled-as-32bit-linux-externals-attached
libpd
mmponboardeditortemplate-mmp-for-creation-of-mobmuplat-files-directly-on-the-handheld-android-only
3d-synth-webpd-tree-js-webgl_camera_cinematic-html-example
Off topic