Forums > MaxMSP

Guitar feedback generator, some answers and suggestions needed.

December 28, 2009 | 6:41 pm

Hi all.

I’m developing a patch that takes my guitar signal, detects the pitch (using fiddle), multiplies this frequency by some integer to choose a desired partial and uses this to set the centre frequency of a bandpass fillter with a very narrow Q.
This signal’s volume is controlled by a midi expression pedal and added to the original guitar signal which goes to my guitar amp via a reamping box.

My goal is to be able to play a note and use the expression pedal to boost that partial and hopefully the sound from the amp will cause the string itself to feedback at that frequency.
I’ve been able to get a good approximation of this by running the bandpassed signal through a delay (after the expression pedal so the attack is removed), this shouldn’t be necessary if I can get it to feedback properly.
I recorded the guitar signal inside max and it seems that the guitar is feedbacking at the desired partial sometimes, other times I’m simply hearing the boosted partial. I think some strings are more likely to cause feedback and some frequencies work better possibly because there are phase differences whose influence changes depending on the frequency.

My main question is about the physics of such a process. I imagine that I would want the phase of the boosted partial to be the same or close to the original so that it reinforces that pitch on the guitar. I did a quick test recording a filtered and unfiltered sine wave and it appears that the cascade object may be putting the signal out of phase or at least delaying the band-passed signal relative to the original signal.
It should be possible to purposefully delay the band-passed signal by some small amount so it lines up with the phase of the original signal’s chosen partial. The problem is that I’m not sure how I’d calculate the phase of the partial of the unprocessed signal without processing it (e.g. band pass) and thus presumably delaying it or putting it out of phase.

Here’s where the physics comes in, for naturally vibrating strings are partials in phase with each other particularly the fundamental?
It this were true perhaps some very limited calculation could be done to detect the time offset between zero crossings in both signals. For example I imagine the zero crossings for the fundamental match up with a zero crossing from the fourth partial (every fourth one). This could be used to calculate the delay time for the band passed partial (something like: wavelegnth – offset*partialNumber) so that the band-passed partial is in phase with the original.

To top this all off I realise that the entire guitar signal is delayed simply by going through my interface and max. I have the signal vector as small as possible though. In the future, the original signal will be doubled before my interface and the band-passed signal added after the interface using a mixer pedal.

I will also need a more sophisticated level control eventually. When the guitar starts sustaining the chosen partial the patch continues to boost it even more. Ideally I’d like something roughly linear in spite of this dynamic.

Any thoughts would be much appreciated. Let me know if you have any questions.

– Pasted Max Patch, click to expand. –

December 30, 2009 | 10:26 pm

cool idea :)
here are some random thoughts:

generally, the frequency at which a feedback-system resonates is dependant
on the overall delay time.
In a normal guitar-string->amp->loudspeaker situation the delay time results from the speed of sound (approx. 340 meter/sec) and the distance between the string and the loudspeaker.
This of course might get more complex because of acoustic reflections of the room…

When a string starts resonating, you don’t need to "phase-align" anything; the feedback system will take care of that on its own. With a physical string you won’t have a perfectly static pitch anyway…

So maybe you should do some experiments with a simple feedback/delay setup, while keeping the overall A/D/A-Converter and patch latency and the guitar/amp distance in mind.

Ah, and don’t forget to crank the amp up to 11 ;)


January 2, 2010 | 4:14 am

Interesting. So given any delay amount and distance from the speaker there is one frequency at which the system can be made feedback?
I presume that in order to create the feedback I need to play a note at this frequency or a note with this frequency as one of its partials?

Ideally I wanted to keep everything as organic as possible and not have any delay (as in a feedback loop with delay) within the patch and aim to get the string itself resonating with a little encouragement and control from max.


January 4, 2010 | 2:10 pm

So given any delay amount and distance from the speaker there is one frequency at which the system can be made feedback?

I think it’s always the fundamental frequency plus integer multiples of it.
You can think of it as a comb filter, which is nothing else than a delay and feedback network.
So you have equally distanced peaks for potential feedback.

This holds true for microphone/loudspeaker feedback, but should be the same for string/loudspeaker feedback, except that the string will only resonate on its fundamental and partials.

I presume that in order to create the feedback I need to play a note at this frequency or a note with this frequency as one of its partials?

Theoratically, you do need an initial excitation to get the feedback started.
But given a sufficient feedback gain, the "floor"(?)-noise only, will be enough to get the string ringing.

Ideally I wanted to keep everything as organic as possible and not have any delay (as in a feedback loop with delay) within the patch and aim to get the string itself resonating with a little encouragement and control from max.

You won’t perceive the delay in the time domain, as we are speaking of really short delay times.
The math is pretty straight forward:
Say you want a feedback frequency of 100Hz.
One period is 1/100Hz = 0.01s = 10ms
So with a delay time of 10ms you will get feedback "peaks" at 100Hz, 200Hz, 300Hz etc.

The speed of sound (343 m/s) will introduce a delay of 2.915ms (1/343) per meter.

PS:
Be sure to use delay~ (with delay time in samples!) instead of tapin~/tapout~ (their delay time is limited to the vector size).

You can use the examples/utilities/latency-test.pat patch to measure your actual I/O latency.


January 4, 2010 | 3:57 pm

Thanks for the response!

I see what you were talking about now. The entire system of guitar->max->amp is acting the same as a comb filter and comb filters naturally boost certain frequencies depending on the total delay time.

If the total delay is simply acting to boost certain frequencies then there really is little difference in me simply adding eq to the system is there? That way I have control over what gets boosted, I could simply use the appropriate delay to encourage this.

I had been reluctant to think of it this way because guitar feedback generally doesn’t sound like a resonance reinforcing itself through the loop (or at all like comb filtering), it sounds like the string itself morphing into some other pitch.
I’m guessing that the comb filtering resonance is the cause of this and the string/pickup is the means by which the resonance is transferred from the air (sound) back into the amp.

One other thing, that latency test patch probably doesn’t account for an additional 64 sample delay caused by my firewire interface. According to the manual there is this delay but loop-back tests don’t pick it up, I think the interface/drivers compensate somehow. Just something to keep in mind for anyone trying this.


Viewing 5 posts - 1 through 5 (of 5 total)