Gaetino

Audio library

Recommended Posts

Hi,

I just received my Papilio Pro board. I'm newbie to fpga world, and long time user of arduino platform.

I wanted to convert my audio library made for arduino Due to the Papilio : http://groovuino.blogspot.fr/

 

Obviously, I use ZPuino, and until now it works great. I had to change the timer usage, I use the DELTASIGMA (great sound !) instead of Due DAC, had to change some constant definitions, but nothing too difficult (nice job for ZPuino developpers !)

 

Now, of course, I would like to use more advanced features of the Papilio. Here are some questions :

 

. RAM : when I declare a variable, or a table,  is it automaticly stored in the RAM ? My goal is to make some audio effects like delays that need a lot of RAM.

 

. FFT : If I understand the FPGA, it's a lot of gates that can be phisicaly programmed to make the functions I need. So I guess it's possible to "program" some FFT functions. I think that ZPuino doesn't use all the FPGA gates (at least on the Papiio Pro), so it must stay some "place" to add these functions. But can it cohabit with ZPuino ? in other words, can I load several systems on my board and make them exchange data ?

will I have to learn VHDL ?

The FFT would allow me to make some audio effects which need a lot of CPU, like filters, choruses...

 

Thanks in advance, this board seems really great !

 

Gaétan

Share this post


Link to post
Share on other sites

I'm sure someone knows how ZAP is working on this forum...

I just need an answer at least on the RAM question (or you can tell me if it's a silly question) : Is ZPUino able to use the 8 MB of the papilio pro board ? And are the declared variables automatically stored in RAM without adding special code ? 

 

Thanks,

 

Gaétan

Share this post


Link to post
Share on other sites

Hello Gaetan, sorry for the delayed response. I took a little vacation at the end of the week. :)

 

That's really great to hear about the success you have already had with audio on the ZPUino and Papilio Pro. Let me answer as many of your questions as I can:

 

 

I just received my Papilio Pro board. I'm newbie to fpga world, and long time user of arduino platform.

I wanted to convert my audio library made for arduino Due to the Papilio : http://groovuino.blogspot.fr/

 

This is very exciting, we will be happy to help with this in any way we can.

 

 

. RAM : when I declare a variable, or a table,  is it automaticly stored in the RAM ? My goal is to make some audio effects like delays that need a lot of RAM.

 

Yes, all of the variables will be automatically stored in the SDRAM of the Papilio Pro, there is 8MB of space available so you should have plenty of room to work with.

 

 

. FFT : If I understand the FPGA, it's a lot of gates that can be phisicaly programmed to make the functions I need. So I guess it's possible to "program" some FFT functions. I think that ZPuino doesn't use all the FPGA gates (at least on the Papiio Pro), so it must stay some "place" to add these functions. But can it cohabit with ZPuino ? in other words, can I load several systems on my board and make them exchange data ?

will I have to learn VHDL ?

The FFT would allow me to make some audio effects which need a lot of CPU, like filters, choruses...

 

Actually, if I'm not mistaken, Alvie has already implemented some FFT functions for the Sound Puddle project. We should ask Alvie where we can find them and what is in place. At the very least it will be a great starting point.

 

Jack.

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for the reply, and no problem for the delayed answer. I was too impatient...

 

Alvieboy, I like your soundpuddle.

 

Unfortunately, it seems that the FFT library used in soundpuddle is a C library, loaded to the ZPuino.

I'm looking for a bit file, or VHDL code which could implement physically the FFT functions in the FPGA gates, so it wouldn't take ZPuino CPU time.

Because 96 MHz CPU to generate 44 kHz sounds is a little bit short to put too much functions (only 2000 instructions per cycle). If I want to make a 3-Osc synth, with filter, delay, sequencer... I'm sure it's impossible to add FFT functions, even if it is optimized in assembly.

But maybe it's impossible, or I'll have to make the whole synth code in VHDL. Arrrrrrgh.

If someone has got an idea...

 

Gaétan

Share this post


Link to post
Share on other sites

If you want a 3-Osc synth you will probably find that putting the 3 oscillators in hardware will make like much easier.

 

The FFT algorithm would be best done by some kind of co-processor that has operations to make the FFT fast (like FFT blocks for size 2, 3, 5, 7) but since the FFT algorithm requires different work to be done depending on the length of the input it cannot be made into a simple piece of hardware that just gives you the FFT, such an implementation would require a different implementation for every size.

 

Most of the effects you want to do are actually much much much easier to do in VHDL than in software because you can literally have them be a network of busses that clock a sample between modules every sample period, then the modules can do whatever work they do in parallel. The CPU should be saved for things like control that requires many decisions or for other parts that require large numbers of decisions and things that are difficult to implement in hardware.

Share this post


Link to post
Share on other sites

Thanks, that's what I was afraid of. So I will have to learn VHDL. It's hard to start a new language, but it seems so powerful...

 

Before that, I will finish adapting my library. For now, I implemented watable oscillators, filters, envelopes, it sounds good. I will then implement sample playing. With Arduino I had to read them from the SD card. Now, with 8MB of memory on the Papilio, I will load them in RAM, so save CPU and have more polyphony. 

Share this post


Link to post
Share on other sites

Wow ! Great thanks !

I think that's exactly what I was looking for. And if I don't manage to start with this tutorial video you made, I should stop coding now...

The FFT filter on opencores seems interesting too. I will try to implement it.

I will take some time to understand everything, and will post my results, or my troubles.

When I finish to convert my audio lib for ZPUino I will post it on github, maybe you or someone could use it (for retreocade ?) or optimize it.

Share this post


Link to post
Share on other sites

Ok.

Just Another question : for now, I use RAM to store samples. But maybe it could be great to add an SD card to store big sound libraries. Is the SDfat library from arduino will work ? Or do I have to use smallFS or something else ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now