![]() | ![]() | ![]() |
| |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
![]() |
| | Tools |
| | #1 |
|
Hey there, I have a microprocessor which outputs music in square-waves form, and now I need some improvement there, which is the natural damping effect which music instruments have, or the "Attack-and-release" method. However, I can't get it to work, despite how I wired these correctly. I followed the reference from this site: Making Music ![]() Since this thing requires a buffer, I wired it up that way: ![]() My circuit has a problem: when I put that test pin to +5V, the sound was cut off, and then when I ground it, either the sound becomes distorted or it decayed in an improper manner. By right, when I charge it, it should get louder, and then when I discharge it, the sound will bleed off and decay until I hook up the test pin back to +5V. | |
| |
| | #2 |
|
Did you set RB0 as an input? Did you then output a high to RB0? Did you then momentarily toggle RB0 to an output? Same with RB4.... ie: Did you use them as open drain outputs as shown in the example code? You OpAmp circuit doesn't look right. Put the buffer after R3 in the diagram above. What are the supply voltages for the LM324?
__________________ Inside every little problem, is a big problem trying to get out. Last edited by kchriste; 31st October 2009 at 07:19 AM. | |
| |
| | #3 | |
| Quote:
In that case, the RB0 is an output - it comes out the square wave, which then the envelope is applied by using the RB4, and with the 220 ohm and the 4.7µF capacitor. | ||
| |
| | #4 |
|
The attack/decay circuit is completely wrong and will not make the square-wave change its volume. It needs a voltage-controlled-amplifier (VCA) to do that. A long time ago, music keyboards used a CA3080 transconductance amplifier IC as a VCA. Now you could use an LM13700 transconductance amplifier. It has a DC input that controls its gain. Years ago, I made a background music circuit for an expensive intercom system that used a JFET to fade-in and fade-out the music. The JFET was a voltage-controlled-attenuator. It also had bass-boost and sounded pretty good.
__________________ Uncle $crooge | |
| |
| | #5 | |
| Quote:
Are they any other transconductance amplifier that could be recommended? I only can find SMD versions of the LM13700, when I want the DIP ones. | ||
| |
| | #6 |
|
You must study how to control the gain of the LM13700 with voltage. Manufactures do not use DIP ICs anymore. There are very few hobbiests who use transconductance amplifiers anymore.
__________________ Uncle $crooge | |
| |
| | #7 |
![]() The way the original circuit (At the very top of this thread) work is this: RB4 and RB0 are set to input mode. (High impedance) The output for RB4 is set high but nothing happens because the pin is in high impedance input mode. Same for RB0 but it's output is set low. Then you start switching RB0 to output mode and back to input mode at a 1Khz rate. Then, at the same time, you switch RB4 to output mode for apx 5ms and then back to input mode. This charges C1 up to apx 5V. Now R2 acts as a pullup resistor for RB0 which is behaving like a open drain FET being switched at 1Khz. C1 supplies the voltage for the pullup function, but since C1 now is slowly discharging through R2 and the RB0 open drain circuit, you get a gradual decay in the square wave at RB0.
__________________ Inside every little problem, is a big problem trying to get out. Last edited by kchriste; 1st November 2009 at 02:20 AM. | |
| |
| | #8 | |
| Quote:
I havent looked at this in great detail but as soon as i saw the basic schematic i assumed that same thing. The modulation comes in the form of varying the pullup voltage for the RB0 pin which in turn means that the output amplitude gets modulated in accordance with a charging (or discharging) cap voltage which is exponential. This would modulate the envelope in the same way a string eventually comes to rest after being plucked. What i havent looked at is how exactly they are modulating the 'square waves'. If they are modulated with respect to 2.5v instead of 0.0v there could be a problem in the sound of the output because we dont want to change the relative amplitude of the negative and positive half cycles, but i have no way of looking into this effect since i dont have the source code. It's worth a try though i think without worrying about that just yet. I would bet they took that into consideration when they wrote the code and did it so that the amplitude is relative to 0v. Last edited by MrAl; 1st November 2009 at 02:37 AM. | ||
| |
|
| Tags |
| attack, envelope, filter, release |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| Latch release? | wod | General Electronics Chat | 3 | 11th October 2009 10:01 PM |
| Attack of the Killer Dust Bunnies | Styx | Chit-Chat | 10 | 11th July 2008 09:48 PM |
| GPRS AT comands for Release 99 | Mking | Electronic Projects Design/Ideas/Reviews | 0 | 28th April 2005 08:26 AM |
| HOW TO RELEASE PHONE LINE ?? | jrgmayo | General Electronics Chat | 6 | 15th April 2005 05:10 PM |