electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » Les Hall's Projects including eChucK
Karplus Strong Opamp Circuit
Post new topic   Reply to topic Moderators: Inventor
Page 1 of 2 [42 Posts]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Goto page: 1, 2 Next
Author Message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Fri Sep 28, 2012 8:31 pm    Post subject: Karplus Strong Opamp Circuit
Subject description: I think I make a KS with just one opamp!?
Reply with quote  Mark this post and the followings unread

Oh wow - wow wow wow amazing! Maybe I've had a bit too much caffeine tonight, but I am really excited about this circuit that I created. It's basically just an all-pass filter with two components added: a capacitor and a resistor. And it's making percussion sounds! wow!

See the attachments below for a schematic of the unmodified all-pass filter circuit, a waveform captured via Audacity, and a short audio sample with a drum beat every 4 seconds approximately.

The Added components are a cap from the noninverting input to ground and a resistor from a pulse source to the noninverting input. The resistor allows the input of a stim pulse a-la-KS normal stimulus, and the capacitor closes the KS loop with a first order low-pass filter.

Component values: R is 330k, C is 0.1uF, Rx is 1Meg in feedback position and 100k in input position. Added parts are resistor = 330k and capacitor = 2.2uF. That's it! well, that and an LM358 opamp does the job.

This is a fascinating discovery because it is a truly minimal KS implementation if it turns out that I am correct in understanding how it works. The theory is that the all-pass filter acts as a delay line. Adding the resistor merges it with an inverting summing amp for stim pulse input, and adding the capacitor puts a low-pass filter in negative feedback. All three subcircuits are sort of morphed together into one beautiful KS opamp circuit. wow!

I'll play with it over time and report results in this thread.

Les


Active_Allpass_Filter.jpg
 Description:
The Active Allpass Filter illustration from Wikipedia
 Filesize:  7.35 KB
 Viewed:  7937 Time(s)

Active_Allpass_Filter.jpg



KS opamp waveform.jpg
 Description:
Audacity captured KS opamp waveform
 Filesize:  53.31 KB
 Viewed:  84 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

KS opamp waveform.jpg



KS opamp.mp3
 Description:
What it sounds like

Download
 Filename:  KS opamp.mp3
 Filesize:  531.94 KB
 Downloaded:  330 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Fri Sep 28, 2012 11:05 pm    Post subject: Reply with quote  Mark this post and the followings unread

Here is a schematic of the circuit that I have been playing with tonight. It sounds like wooden bongos!

Les


KS opamp schematic.jpg
 Description:
The KS opamp schematic
 Filesize:  46.83 KB
 Viewed:  100 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

KS opamp schematic.jpg



_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
JingleJoe



Joined: Nov 10, 2011
Posts: 878
Location: Lancashire, England
Audio files: 14

PostPosted: Sat Sep 29, 2012 1:09 am    Post subject: Reply with quote  Mark this post and the followings unread

That sounds great Very Happy nice little circuit you've made there Les, very nice. I may just have to comendeer it for my next synth Twisted Evil

I've recently been playing with variations on the twin-T filter and with it, I was planning to make a circuit which does just what yours does Laughing but what with moving house I won't be able to work on it right now, thanks for doing the work for me! Wink

P.S. what happens if you change the value of R? (the resistor you added).

_________________
As a mad scientist I am ruled by the dictum of science: "I could be wrong about this but lets find out"


Green Dungeon Alchemist Laboratories
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Sep 29, 2012 1:45 am    Post subject: Reply with quote  Mark this post and the followings unread

Joe, I think changing the input resistor will vary the gain on the input pulse. Oh and BTW if you dont' have a carefully crafted input pulse just send in a digital signal via a 0.1uF cap in series with the input resistor. That'll turn the edges into pulses. Also, I'm running this single ended but I've come to realize that it really begs to be run from a bipolar suply or with an artificial ground. More to follow.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
analog_backlash



Joined: Sep 04, 2012
Posts: 391
Location: Aldershot, UK
Audio files: 21

PostPosted: Sat Sep 29, 2012 3:27 am    Post subject: Reply with quote  Mark this post and the followings unread

Hi Les,

I will definitely be adding this circuit to my "things to try out when I get round to it" list. I want to build some kind of simple as possible percussion box and this idea seems to fit the bill. Presumably I could make 4 different percussive sounds with one LM324, by varying the R and C values. Need to add some white noise generators in there somehow and a sequencer.

Anyway, you might see/hear results sometime in the future. The problem with this website is that there's far too much on it that I want to try out!

As a side issue, I was looking at another site recently (which shall remain nameless) and I found a whole thread dedicated to the hatred of LM358/LM324. I use them a lot and I've rarely had any problems. Perhaps they were just too lo-fi for their tastes.

Cheers

Gary
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 1535
Location: Chicago
Audio files: 14

PostPosted: Sat Sep 29, 2012 5:59 am    Post subject: Reply with quote  Mark this post and the followings unread

Maybe a relative of the "Bridged T" a la TR-808 Kick drum?
Back to top
View user's profile Send private message
Cynosure
Site Admin


Joined: Dec 11, 2010
Posts: 733
Location: Toronto, Ontario - Canada
Audio files: 42

PostPosted: Sat Sep 29, 2012 6:45 am    Post subject: Reply with quote  Mark this post and the followings unread

I don't fully understand KS, but to me it looks like you made a pulse triggered oscillator, similar in function to the T. The difference with yours is that it looks like the trigger pulse come through the circuit too. Which can be a good thing if you trigger it from a white noise pulse and add a lowpass filter on the output. That should make a good kick drum sound.

Have you tried changing the values of C3 and C4? That might change the decay length.
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Sep 29, 2012 7:23 am    Post subject: Reply with quote  Mark this post and the followings unread

Cynosure wrote:
I don't fully understand KS, but to me it looks like you made a pulse triggered oscillator...
Have you tried changing the values of C3 and C4? That might change the decay length.


Well, Cyno, I feel that it's not an oscillator because the oscillation is not sustained, and that it is a KS loop because of the merging of the three KS functions as described previously, as well as the way it sounds just like a KS loop synthesizing percussion with a short delay amount.

In other words it looks like a duck and it quacks like a duck, so maybe it's a duck. That's no guarantee though, just my perspective at this juncture.

I dont' have much of a cap collection for varying those caps and the layout is tight, but what I have found is that changing any of the caps shuts it down except the input cap which is optional in most cases.

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sat Sep 29, 2012 7:36 am    Post subject: Reply with quote  Mark this post and the followings unread

I added artificial ground and lookee here, nice decaying oscillation riding on the pulse response, sounds good too!

Les


Bongo with Noise.jpg
 Description:
 Filesize:  29.79 KB
 Viewed:  68 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

Bongo with Noise.jpg



KS opamp with noise.mp3
 Description:

Download
 Filename:  KS opamp with noise.mp3
 Filesize:  107.46 KB
 Downloaded:  316 Time(s)


_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Cynosure
Site Admin


Joined: Dec 11, 2010
Posts: 733
Location: Toronto, Ontario - Canada
Audio files: 42

PostPosted: Sat Sep 29, 2012 7:39 am    Post subject: Reply with quote  Mark this post and the followings unread

Wow that sounds awesome!
Back to top
View user's profile Send private message
elmegil



Joined: Mar 20, 2012
Posts: 1535
Location: Chicago
Audio files: 14

PostPosted: Sat Sep 29, 2012 2:01 pm    Post subject: Reply with quote  Mark this post and the followings unread

That looks exactly like what I get out of my TR-808 Kick Drum circuit. Very Happy It's damped enough that it doesn't sustain oscillation either.

I think that the two things "Bridged T" and "Karplus Strong" are probably related to each other.....
Back to top
View user's profile Send private message
RingMad



Joined: Jan 15, 2011
Posts: 242
Location: Montreal, Canada
Audio files: 2

PostPosted: Sun Sep 30, 2012 4:41 am    Post subject: Reply with quote  Mark this post and the followings unread

Hey, that's no duck... sounds like a bongo. Does it look like a bongo? Maybe it is a bongo. Ok, I'm just being silly this morning... it sounds good, Les!

James.
Back to top
View user's profile Send private message Visit poster's website
JingleJoe



Joined: Nov 10, 2011
Posts: 878
Location: Lancashire, England
Audio files: 14

PostPosted: Sun Sep 30, 2012 5:30 am    Post subject: Reply with quote  Mark this post and the followings unread

Inventor wrote:
I added artificial ground and lookee here, nice decaying oscillation riding on the pulse response, sounds good too!

Les

Can we get a diragm? I could probably add the virtual ground myself if I wasn't half asleep.

_________________
As a mad scientist I am ruled by the dictum of science: "I could be wrong about this but lets find out"


Green Dungeon Alchemist Laboratories
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Sep 30, 2012 7:35 am    Post subject: Reply with quote  Mark this post and the followings unread

lol, RingMad!

Joe, ask and ye shall receive! I didn't connect the 2.2uF cap to virtual ground because it is polarized, and to be truthful the 0.1uF shunt cap need not be connected either, but I believe it's important to virtual ground the resistor on the noninverting terminal.

Les


KS opamp full schematic.jpg
 Description:
 Filesize:  56.61 KB
 Viewed:  107 Time(s)
This image has been reduced to fit the page. Click on it to enlarge.

KS opamp full schematic.jpg



_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Sep 30, 2012 7:38 am    Post subject: Reply with quote  Mark this post and the followings unread

elmegil wrote:
That looks exactly like what I get out of my TR-808 Kick Drum circuit. Very Happy It's damped enough that it doesn't sustain oscillation either.

I think that the two things "Bridged T" and "Karplus Strong" are probably related to each other.....


Well now, there is some question as to what exactly this circuit is in fact. I maintain it's a squoosh-morphed KS loop, but JovianPyx tells me it's a stimulated band pass filter, Cyno thisnks it's an oscillator, and you are compaing it to a Twin T.

In practice as I understand it there can be many implementations that can accomplish similar results. That may be the case here. It could be that the sets of all stimulated band pas filters, oscillators, Twin Tees, and KS loops have a union in at least an analagous way. I'm calling it a KS loop, so there!

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
elmegil



Joined: Mar 20, 2012
Posts: 1535
Location: Chicago
Audio files: 14

PostPosted: Sun Sep 30, 2012 8:55 am    Post subject: Reply with quote  Mark this post and the followings unread

Bridged T is related to a Twin T but not quite the same Smile
Back to top
View user's profile Send private message
JingleJoe



Joined: Nov 10, 2011
Posts: 878
Location: Lancashire, England
Audio files: 14

PostPosted: Sun Sep 30, 2012 9:48 am    Post subject: Reply with quote  Mark this post and the followings unread

Thanks les Smile
_________________
As a mad scientist I am ruled by the dictum of science: "I could be wrong about this but lets find out"


Green Dungeon Alchemist Laboratories
Back to top
View user's profile Send private message
JovianPyx



Joined: Nov 20, 2007
Posts: 1257
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Sun Sep 30, 2012 11:48 am    Post subject: Reply with quote  Mark this post and the followings unread

First, the sound of Les's circuit is very nice, resonant drum like.

As for Karplus-Strong:

The Karplus-Strong theory and implementation is described in great detail in two places, the Stanford University web site and in their patent. Using google to find that is left to the reader.

While I agree that there are similarities between a filter with negative feedback and KS, they are not the same. One is a filter (which exhibits some small amount of delay), the other is a delay line attached to a filter. While they have attributes that are similar, that doesn't make them the same. For example, a bicycle and a car both have wheels, both are vehicles, both can turn corners, but one would never call a bicycle a car, they are clearly different.

In the Stanford documentation, the system is described as a delay line capable of holding a waveform which is connected to a single pole lowpass filter. The output of the filter is routed back to the input (through an adder) which allows injecting an excitation signal.

If the filter described here has a delay line, then it sould be able to store a waveform, but clearly it cannot since it's "memory" (capacitor) can store the voltage value at only one instant in time. The delay line in a Karplus-Strong system holds one entire cycle of the waveform.

Note that "delay" and "delay line" are two different things. If something has the characteristic of delay, that does not mean that it is a delay line.

The point of the work by Karplus and Strong was to model a vibrating string (plucked or hammered). It is explained that the length of the string is modeled by a delay line while the filter models the energy lost when the wavefront meets the string's termination point. Most of the energy loss is at higher frequencies because the filter described is a single pole lowpass type. This gives rise to it's timbre similarity to an actual tight string. I've personally done a lot of work with this in my implementation of several instruments I call "Xarp" (sound clips are on the forum).

All throughout the definition on the Stanford site, you will see math that refers to discrete time, not continuous time. An analog filter does not operate in the discrete time domain, it operates in the continuous time domain. Because of this, the pitch of a Karplus-Strong system is set by two things: the sample rate of the system and the number of delay elements in the delay line. If the described filter is truly Karplus-Strong then it should exhibit the Karplus-Strong characteristics. Can it be tuned by changing the length of it's delay line? (no delay line, so that can't happen). Can it's pitch be changed by manipulating the sample rate? (no, it operates in continuous time, so there is no sample rate).

I realize that one of the timbre types described for Karplus-Strong is "drumlike", but that is not where it ends. As a challenge, if this circuit is a Karplus-Strong system (read the Stanford definition written by Karplus and Strong), then it should, through adjustment of the model, be able to make tight string sounds like harp, guitar, piano, etc.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Sep 30, 2012 11:52 am    Post subject: Reply with quote  Mark this post and the followings unread

Oh, you're just no fun at all!

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Sun Sep 30, 2012 9:39 pm    Post subject: Reply with quote  Mark this post and the followings unread

No, I can't let this go that easily. Scott, you're a jerk. How dare you take it upon yourself to do research, compose an argument, and then type up a long monolog just to prove me wrong at something. That's not how friends behave and you have just proven that you're no friend of mine.

Your little act of emotional sabotage here has served to cause me extreme anger and frustration. I am now envisioning violent acts of destruction because of all of the OTHER TIMES that engineers did the stupid fucking bullshit that you just did to me.

Engineers are sneaky little bastards who delight in destroying another person if at all possible. They acted as an invisible enemy torturing me for two years before I finally lost my career and went insane - literally! Then they did it again in 2004 and again in 2008 and now THIS from YOU!

All I have to say to you is that you should be ashamed of yourself for writing that up and going out of your way to piss me off, you back stabbing saboteur. You should be ashamed of yourself for treating a friend like this, even if you are technically correct.

Inventor

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
JovianPyx



Joined: Nov 20, 2007
Posts: 1257
Location: West Red Spot, Jupiter
Audio files: 161

PostPosted: Mon Oct 01, 2012 5:30 am    Post subject: Reply with quote  Mark this post and the followings unread

Les,

I'm not really sure what this is all about, but if I were to describe it in a single word, I'd use "childish".

I was not trying to embarrass you or hurt you as you accuse.

I feel that this forum is an enormous opportunity to be educated and to educate. Many folks come here to learn. People come here and ask questions and I think they appreciate it when someone takes the time to compose a correct answer. And I know that people respect your knowledge here and take it as gospel.

My response was not mean spirited, nor was it vulgar (as yours was). It merely pointed out facts that I dare say many folks are interested in.

Do you remember a few months ago when you gave me a harsh (in chat) tongue lashing regarding the use of the word "charge" and "coulombs"? Well, to be honest, you were right - and I said that in chat - so I took it to heart that in science, words have precise meanings. Without consistent meanings, we cannot communicate effectively. So I was only doing what you taught me that day - to be accurate when using known, well defined terms such as "charge", or in this case "Karplus-Strong".

Do you actually think I sat here and did research just to give you a hard time? Really Les, I've got way too much stuff to do to waste time on that. No, in fact, I've been doing that research over the last few years because I was developing a (hopefully) high quality musical instrument based on string physical models. So in reality, I already knew what I wrote above.

You can be my friend or not, that is up to you, but I'm stating publicly that your accusation is 100% false. I am not your enemy, never was and don't intend to be.

Beyond that, I will let the forum readers decide.

_________________
FPGA, dsPIC and Fatman Synth Stuff

Time flies like a banana.
Fruit flies when you're having fun.
BTW, Do these genes make my ass look fat?
corruptio optimi pessima
Back to top
View user's profile Send private message Visit poster's website
JingleJoe



Joined: Nov 10, 2011
Posts: 878
Location: Lancashire, England
Audio files: 14

PostPosted: Mon Oct 01, 2012 6:00 am    Post subject: Reply with quote  Mark this post and the followings unread

Sad Aw, relax Les, you've taken Mr Pyx's comment the wrong way. Do you remember when we first spoke and there was bad tension between us? You were so rational and sought peace, I was glad you did, please do the same again here Smile It was merely a misunderstanding.

As a scientist one has got to accept where one has gone wrong in order to become more right and progress one's knowledge. Even if it does piss you off Razz

_________________
As a mad scientist I am ruled by the dictum of science: "I could be wrong about this but lets find out"


Green Dungeon Alchemist Laboratories
Back to top
View user's profile Send private message
Inventor
Stream Operator


Joined: Oct 13, 2007
Posts: 5978
Location: San Antonio, Tx, USA
Audio files: 258

PostPosted: Mon Oct 01, 2012 10:40 am    Post subject: Reply with quote  Mark this post and the followings unread

Well, I've calmed down a bit now. I missed my doctor's appointment today because I was so upset over this. Sure, I overreacted. But that's because my ENTIRE LIFE's PLANS have been destroyed by people doing just what you did. I had this fantasy that I'd get an education and work in some respectable position and have a happy middle class life with a family and all that. I worked very hard for many years to accomplish that goal. Then a group of ENGINEERS decided to attack me just like you did only on a much larger scale. The spied on me, falsely accused me, and placed lice and fleas in all of my cloth for years. I tell you, you cannot fight an invisible enemy. With all those attacks and many other lesser issues I will not mention, I eventually went insane and was later diagnosed with paranoid schizophrenia. I lost my life's dream, my career, and my very sanity. The family that was to be never happened and now it's too late. So don't you get on your soapbox and preach to me about technical details like this. I'm sick and tired of ENGINEERS and their smug correctness. They are willing to destroy relationships and even other people's lives just to prove themselves correct as you have done here. I know you mean no harm, but you triggered some deep-seeded anger that I apparently have not yet resolved. Just stop proving me wrong, I'm sick of that shit!

Les

_________________
"Let's make noise for peace." - Kijjaz
Back to top
View user's profile Send private message Send e-mail
EdisonRex
Site Admin


Joined: Mar 07, 2007
Posts: 4531
Location: London, UK
Audio files: 169

PostPosted: Mon Oct 01, 2012 1:18 pm    Post subject: Reply with quote  Mark this post and the followings unread

Les, please stop it. Maybe some people who happen to be engineers did you wrong, but that isn't license to slag off engineering, especially in this forum.

It's a credit to those responding to be gracious.

But this has no value and does nobody any good. Please don't go there.

_________________
Garret: It's so retro.
EGM: What does retro mean to you?
Parker: Like, old and outdated.


Home,My Studio,and another view
Back to top
View user's profile Send private message Visit poster's website
analog_backlash



Joined: Sep 04, 2012
Posts: 391
Location: Aldershot, UK
Audio files: 21

PostPosted: Mon Oct 01, 2012 5:41 pm    Post subject: I know how you're feeling Reply with quote  Mark this post and the followings unread

Original Text Removed

I meant what I said originally, but I gave away too much information about myself and I regretted it.

I still support you Les and I hope that you're OK.

Last edited by analog_backlash on Tue Nov 06, 2012 4:01 am; edited 1 time in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Inventor
Page 1 of 2 [42 Posts]
View unread posts
View new posts in the last week
Goto page: 1, 2 Next
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » Les Hall's Projects including eChucK
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use