Go Down

Topic: how to drive a speaker from a r2r ladder (Read 9083 times) previous topic - next topic

CrossRoads

http://masteringelectronicsdesign.com/how-to-derive-the-summing-amplifier-transfer-function/

Use 10K resistors for all, increase R4 if need more gain.
Op Amp like a TL072, any kind of low noise op amp. 
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

HCPUNK

i'm sorry, i don't know how a non-inverting amplifier works, i discovered the op-amps just a week ago, at school. however, as soon as i'll get my Arduino, i'll verify by myself if the "software" solution (the one described above) would work properly, or if i should use those non-inverting amplifier to mix the signals. another issue is the one related to the memory: i know i can store my samples data into the flash memory, but how can i retrieve them? i gave a glance to the PROGMEM reference page, but i didn't understand how the reading functions work

CrossRoads

// read back a 2-byte int
displayInt = pgm_read_word_near(charSet + k)  <<< tells arduino to get the data from location k of array charSet

// read back a char
myChar =  pgm_read_byte_near(signMessage + k); <<< tells arduino to get the data from location k of array signMessage

Not clear to me that you can tell the compiler where to start the array at, or if you need to define the arrays as being 4096 bytes long in the
pre-setup code, such as:
byte sound_array1[4096];



Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

HCPUNK

Not very clear to me too.. however, i've estimated that the average length of each sample, played at 1byte/32us is just 0.131s, not enough to reproduce a drum snare, hi-hats, kick, cymbal.. but i can't make bigger arrays, because i'm already out of memory.. any ideas?

CrossRoads

External memory, make samples a big as you want.
2 seconds of drum sound forced to decay off to fit in memory, sampled at 32K to achieve 16KHz bandwithd, is 64K of memory. Adds up quick! And not realistic sounding either.
Go with external memory, read back the samples and feed into separate D/A converters and mix together in analo world.

I have a design I did, because I wanted to go electronic and stop lugging my set all over, where I used a PC to load up sounds into shared memory, then had my playback circuit read it back from memory thru D/As. Trigger was a microphone inside a practice pad, hardness of the strilke was captured used to control volume of playback by having the D/A output go thru a voltage controlled ampifier.
Had all the pieces prototyped, tested with components that gave good results, had a method to load up banks of memory using a PC Junior (this was like 1987).
Then we packed up to buy a house, things got delayed a few months, we finally moved, the Roland type digital drum sets came out, and Ijust never got back to doing anything with it.
Now, everything less expensive, especially memory (4 gig USB stick, $8!, surprised they are not free in cereal boxes), speeds are faster. I could see buildiing a ATMega per sound channel with meg of memory or something, build up 16 channels or something, master controller to have pc connected to each download to each one to load up memory for playback by the atmega with a strike detection circuit per card or something.

I'm gonna have to dig up my old design, update it for these new times!
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

HCPUNK

it's such a pity that you gave up with your project, it sound really interesting!!

what i'd like to build is something like the Roland Octapad, and it should be the project i'll show during my high school exams.
it should feature 6 or 8 pad (multiplexed into only one analog pin), a midi out (whose channel and patch should be selected from the arduino itself, and velocity read from the function described above), a few sound banks (drum sounds and some sine, square waves and a rough piano sound as well), a built-in speaker, a headphone out and a vu-meter. so yes, an external memory (and a lot of work) is what i need. any hints about the first one?



PS: in italy we usually find fingers or hairs or mice into any kind of food box.. maybe someone has found a memory stick as well, who knows :)

Go Up