Reading multiples waves files in the same time

Status
Not open for further replies.

zaord

Member
Hi,
For a pédagogical musical projet, I would need to create a system with several 'layers of sound' meaning one sound file for exemple melody, one for harmony and one for explaiations and I would to be abbe to mute each of those track when I wants duriing playing in the same time.

Do you have any idea of which sound format I should use ?
Do I need to use a external soundmodule or does Micropython could read up to 5 tracks simulaneously ?

I would need also a 3.5mm jack for headphone.

The duration of those simultaneous tracks could be up to 20 min.

Best, and Thanks for your experience sharing
 
I don't think reading 5 audio files with 44khz is possible.
Perhaps it can work if the files are mono and with a lower sampling rate.. or by using two or 3 microcontrollers?

The problem is not the micro. It's the SD card... :) Random access, which is needed here, is slow.
 
Some time ago I created an experimental mp3 lib. Don't remember exactly how many mp3 simultanoulsy were possible.. must have been 3 or 4 @128kBps
I can try and play a bit with it.
However, i suspect, a higher compression would be needed. On the other hand, with mono files.. hmm..
Would be some like 98 kBps ok? Or can we go even lower? AAC would be even better .. would have to look)

However, these codecs have a serious lag on start.
 
5 files can work from a flash memory chip.

Today the WAV file player doesn't buffer enough to allow 5 to work simultaneously from a SD card. SD cards have far too much random access latency.
 
Ok.. so let's calc.
5 files * 44100 samples/sec * 2 bytes per sample * 20 * 60 (20 minutes) :

5*44100*2*20*60 = ~ 530 Megabytes

I'd just use 5 Teensys... doable for 130$ maybe.. (cheap D/As) + 5 SDCards
Not that much.

Edit: 5x Teensy 3.5, + some caps and an headphone amp.
Advantage: Very easy programming (5x the same program) , nothing to think much... The saved time is more worth.
 
Last edited:
Hi Friends, thanks for your replies

You could use my serial flash library for this but I haven't tried it for very large chips. It should work though.
https://github.com/BleepLabs/Serial_flash_sampler_for_Teensy_Audio

You can see some code on how to copy SD to flash here

It does kind of sound like a job for a raspi though.

Do you have any shematic for hardware part ?

I see this project : http://www.hypnotriod.org/beatsqueezer/#/features it use a stm32 and have exactly the feature I need. Do you have any idea how he get reed of those technical solutions ?

Here a short video presenting functionalities : https://www.youtube.com/watch?v=21Yzv0SkbqY&ab_channel=IlliaPikin

This really nice project have a design ressources forlder here : https://drive.google.com/file/d/0Bwjx_HxS4URpSWQ4djlsOFB2UlE/view where the shematic is given. Thanks to you all
Best Regards

Ewen
 
Last edited:
I found here a list of several flash memories. Do you think 1GB is sufficient ?
Which fammilly should I need to works with stm32 or teensy ?
 
Sometimes you just want it done with many nice features that you could never code yourself. That sorted out, now you can actually work on which files you want to play, the UI, etc.

If this is one of those times, consider the Sparkfun WAV trigger or Super WAV trigger.. It's got polyphony, multiple outputs, looping, MIDI, pitch bend, some basic envelopes, and more. There is at least one eurorack module based on it. Only downside is 8-12 ms latency, which might be noticeable with a drum situation.

It has multiple triggers, but if it's still going to need a brain, consider a Teensy of some sort. Could add an audio board to do effects, even. Back on topic!
 
Status
Not open for further replies.
Back
Top