Page 1 of 1

Is it possible to create a sample player?

PostPosted: Thu Jul 09, 2015 4:31 am
by muzzy92
Hi folks, I came across this forum in my search for a diy sample player. I want to use a kick and snare trigger to trigger samples with really low latency. So far I've used the arduino to send out midi notes (so the drummer can play my synth) which is pretty decent. The next step would be to trigger huge kick and snare samples.

I'm wondering if triggering samples (with close to 0 latency) is possible with the Audio Codec Shield attached to my arduino. Perhaps I could convert a sample into a wavetable and play that, which would remove the need for an SD-card reader or something like that. All suggestions are welcome!

Thanks!

Re: Is it possible to create a sample player?

PostPosted: Thu Jul 09, 2015 10:03 am
by guest
because the codecshield uses the SPI lines, it would be difficult to do (an SD card needs SPI as well). you should have a look at the sparkfun wav trigger or mp3 trigger, both will probably do well. im not certain what the latency is, but it is probably less than 10ms.

Re: Is it possible to create a sample player?

PostPosted: Fri Jul 10, 2015 2:10 am
by muzzy92
Thanks for the reply! I've actually bought an Adafruit wav trigger and I noticed there was too much latency for it to be useful in a live setting. I'll check out the sparkfun version to see if it's faster.

Re: Is it possible to create a sample player?

PostPosted: Sat Jul 11, 2015 10:32 am
by guest
if those dont work for you, the Teensy3.0 and its audio shield might work as well. the limiting factor for all of these, is that the data is coming from an SD card. SD reads sometimes have a few ms delay associated with them. the SD protocol also has a bit of overhead, and can be slow.

Re: Is it possible to create a sample player?

PostPosted: Wed Jul 15, 2015 12:27 am
by muzzy92
Is there another way to load samples without using an SD card? I think I've seen something like SRAM which is able to hold about 10 seconds of audio, but I'm not sure how to implement something like that. Since I'll be using it for drum samples, I won't be needing a lot of storage. Do you have any suggestions for alternatives?

Re: Is it possible to create a sample player?

PostPosted: Wed Jul 15, 2015 9:34 am
by guest
well, the SD card should be ok. i had a look at the sparkfun wav trigger, and it said an 8ms delay time, which is a bit long, but should be playable. but, if you want something else, the other options are individual flash chips or SRAM. i know there is another music shield out there that uses 2 flash chips, so that might work (although i dont think it had a good codec).

flash chips are large storage, and relatively cheap, but a bit slower (although faster than youll need). they are most common in the serial variety, which uses fewer pins, but also eats up your SPI port. they make parallel versions, but the UNO doesnt really have a free 8b bus for transfers.

SRAM is much faster, smaller storage size, and usually parallel. it also can not hold data once the power is removed. usually SRAM sizes are around 2kB. i would discourage using SRAM, as it will be more complicated than its worth.

the best solution, if you dont need to do on the fly recordings, is to use the program memory inside of the UNO. you can put your drum samples in as if it as program, and then call it back. i used this on the midivampires. the UNO has 32kB of memory, so if you think that is enough, it might be the way to go, as its super fast.