Pages: [1]   Go Down
Author Topic: Polyphonic audio (not synthesised) IC  (Read 567 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

I'm trying to make an electronic instrument which simulates a real drum; think of a bongo-drum or steel-drum. The richness of the sound requires the audio to be actual recordings of the real instrument, rather than synthesized audio. Because the instrument can be played very quickly, and potentially multiple tones at once, the system would need to be able to play back the samples (and potentially the same sample) simultaneously. I don't want the musician to have to be wired up to a computer in order to use the instrument, so I need something small and portable.

My current progress is that I have created an instrument using an Arduino and piezo sensors for input processing, which then feeds a Raspberry Pi the tone index and velocity values for playback. The Pi is running a python app using PyGame which loads all of the possible sounds - around 18 - and plays the tones as required. This works fairly well as a proof of concept, but the Pi has a lot of things I don't need like graphics, network interface, etc. Something like the WAV Trigger looks like the right kind of thing for development, but wouldn't be practical if it went to a production level.

TL;DR: I'm looking for a way to trigger multiple short-ish (~4 sec), high quality audio tracks at the same time, preferably in IC form which can be built into a board which I eventually create.  Is there anyone who has some experience in this who could point me in the right direction?

Thanks


« Last Edit: July 16, 2014, 12:43:12 am by ArclightSA » Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 547
Posts: 27363
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm working on a sampled drum sound card, but I was leaning towards 1 sound per processor/SD card module, and having as many cards as needed.
75% prototyped, keep getting distracted by other projects.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 1
Electronics engineer, computing masters, guitar and steel pan player .. also learning how to do zero carbon flying :-)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi ArcLightSA

Your project is exactly what I'm wanting to build as well.

I'm currently learning the steel drum with a local group.
I'm already sufficiently proficient that I can join in when they do public performances.
However I don't own one - so practice is impossible unless I can borrow one - like I did over the summer.
There's also a a family of pans in a steel bans - soprano, tenor, double guitar pans, tripple cello pans, and the bass which is either 4 or 6 pans in a semi-circle.

I'd like to become good on all of the instruments - but there's absolutely no way I could afford to buy one of each.
Hence the project to create an interface that lets me practice at home.

I've been looking at what's available and to me it looks like the Arduino Mega with its 16 analogue inputs would be a good base module.
The faster processing power of the Ardunino 'DUE' might reduce latency though?

Then linking directly to a Sparkfun WAV Trigger looks perfect - particularly as it can output up to 8 sampled sounds at once.

There's also the 'WAV Trigger Serial library'
https://github.com/robertsonics/WAV-Trigger-Arduino-Serial-Library

Which looks tailor made for the project.

For piezo transducers I'm looking at these from the local component shop 'Maplin'
http://www.maplin.co.uk/p/3v-ceramic-piezo-transducer-2718-yu87u

They do around 8 different types though and I'm not sure how to choose the best one.

I reckon that its important that there's low latency - ie ideally no noticeable delay between striking the 'note' and hearing the sound.
The system needs to be able to play two notes struck at once - and really needs to be able to have a struck note continue to sound even after the next note is struck - at least until the sound sample has decayed away.

One idea I've had is that if the WAV Trigger board has 8 channels then the serial message from the Arduino could cycle through the channel numbers so that the sampled sound could keep playing.

In other words - assuming there's two beaters (drumsticks) in use.

The first note played (stick 1) would be coded to play on channel one on the Trigger board,
The second note played  (stick 2) would be directed to channel 2
The third note played (stick 1 again) would be sent to channel 3

So the first note would still be playing when the third note is triggered,

When the system has got to channel 8 it starts again at channel 1.
Provided the sound sample has decayed to zero before the 9th note is played then there's be no abrupt cut off of the note.
It should mean that some rather beautiful chords can be formed using the 'sustain' of the samples.

An unintentional effect would be that a single note played repeatedly would create an overlapping cascade of tones - even though on the real instrument the same tone would simply be reformed with each hit of the stick.

For initial testing I'd though that maybe the Sparkfun MIDI shield could be driven by the Arduino and the MIDI stream simply connected to a MIDI player or computer for testing.

Would you like to swap design ideas and see if we can create a beautiful instrument working together?

Andy

Logged

Helsingborg, Sweden
Offline Offline
God Member
*****
Karma: 24
Posts: 576
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I would go for a teensy 3.1 and a teensy audio adapter. Apparently it uses buffers of 128 samples which would give you a latency of about 3ms.
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 354
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Since the sample is so short you can put it in the arduino's flash memory. You can modify this code http://playground.arduino.cc/Code/PCMAudio to have multiple channels you can add each sample and divide by how many there are. Or you could use (a+b)-((ab)>>n) where n is how many bits you have for example for 8 bit audio you shift to the right by 8 or divide by 256. The advantage of the second formula is that it is louder but still avoids peaking. Also the arduino is fast enough to handle this.
Logged

Helsingborg, Sweden
Offline Offline
God Member
*****
Karma: 24
Posts: 576
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I do not think that 8bits of sampling and 8 khz sample rate was what OP had in mind
Logged

Offline Offline
Sr. Member
****
Karma: 11
Posts: 354
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The arduino can do better than 8khz. Just change the #define to what you need. I posted some code here http://forum.arduino.cc/index.php?topic=264342.0 (see my most recent post). That shows how to play multiple samples at different sample rates at the same time. 
Logged

Pages: [1]   Go Up
Jump to: