News:

SMF for DIYStompboxes.com!

Main Menu

DIY looper/sampler chronicles

Started by cloudscapes, March 15, 2012, 12:39:15 AM

Previous topic - Next topic

cloudscapes

Yeah on second thought I might just go ahead and do the modulation on-chip. I was just being lazy, already having an AVR solution. But it'll keep the PCB space lower and it'll be a learning experience.

You're right about Bascom basically doing the hard stuff under the hood. I stuck with it for years. Maybe I should have moved on to more advanced compilers after the first.

The DMA stuff is way over my head. I thought that was used to interface parallel RAM? What would I get out of what you're describing that I don't already get just by triggering an interrupt ever 10ms and reading the 4 ADCs only then?
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

free electron

Quote from: cloudscapes on March 24, 2012, 03:38:13 PM
The DMA stuff is way over my head. I thought that was used to interface parallel RAM? What would I get out of what you're describing that I don't already get just by triggering an interrupt ever 10ms and reading the 4 ADCs only then?
DMA is your delivery guy. You can use it with many peripherals, accessing parallel RAM is only one example.
What are the benefits? Less processing power used for background tasks like reading the pot values, more power (cycles per one sample)  for processing audio data or other important things, like an LFO for example.
Simplifying the process a little bit, because there are also interrupt priority levels and stack operations - what your program needs to do now is to break every 10ms, jump to the timer ISR, start conversion, wait until its done, read the result, change the channel, repeat it 3 times.
Using DMA+ADC the converter works in background and fully automatic doing all four conversion and storing them. When they are ready, the delivery guy knocks at your door (DMA interrupt) and serves you all the data. 
It's just one way to optimize the performance and make use of the features the PIC32 has onboard. 

cloudscapes

Quote from: free electron on March 25, 2012, 09:28:21 AM
DMA is your delivery guy. You can use it with many peripherals, accessing parallel RAM is only one example.
What are the benefits? Less processing power used for background tasks like reading the pot values, more power (cycles per one sample)  for processing audio data or other important things, like an LFO for example.
Simplifying the process a little bit, because there are also interrupt priority levels and stack operations - what your program needs to do now is to break every 10ms, jump to the timer ISR, start conversion, wait until its done, read the result, change the channel, repeat it 3 times.
Using DMA+ADC the converter works in background and fully automatic doing all four conversion and storing them. When they are ready, the delivery guy knocks at your door (DMA interrupt) and serves you all the data. 
It's just one way to optimize the performance and make use of the features the PIC32 has onboard. 

I looked up a bit of this.

I'm thinking, seeing how this is my very first project using this architecture, compiler and language, that I should stick to simply upgrading/translating previous AVR experience and making sure I can get that much. With the added flexibility and horsepower of course. The ADC "struggle" was an example of that, but I was already familiar with the concept of ADCs and what they were used for. DMA, however, I'm still not sure what it does exactly, after reading. It's way over my head, so I think I'll skip it this time around seeing how so far I've got lots of cycles per sample.

Tonight I'll measure exactly how long the new ADC code is taking every 10ms interrupt.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

Crossfade

Another thing I want to implement is some kind of realtime crossfade at the loop point. Not an audible one, though. Just enough to get rid of the nastiest of the pop/click at loop point. Say 100 samples worth. How I incision doing this:

As soon as a new loop recording is done, all samples are saved but the actual played loop will be 100 samples shorter. Only a couple milliseconds worth, it won't make a difference to the ear. As the loop playback hits (total loop length - 100), it adds (first of extra samples / 100), to the current one and divides the result again by 1.5 or 2 (I'll have to experiment with that whether I want a linear crossfade or log). The next sample adds a little bit more of the second of extra samples. And so on. Not the most efficient of algorithms so I'll figure something better out. But that's the gist of it.

It'll be realtime and not "cooked" into the saved samples, because I want to be able to move the loop point around dynamically.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

didn't have much time to work on this lately because of job and because I'm building vibratos for a while, but tonight I made this:

~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

wavley

New and exciting innovations in current technology!

Bone is in the fingers.

EccoHollow Art & Sound

eccohollow.bandcamp.com

cloudscapes

revised design, assuming I can cut squares in metal without hacking a finger off

~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

markseel


cloudscapes

thanks  :icon_biggrin:

started working a little on it again. got a MAX297 filter ic working to de-alias the sound at lower samplerates instead of having that "samplerate reduction" effect, which I don't want in this looper. today I'll try and control it with the PIC32 via PWM so that the filter sweeps along with the samplerate.

maybe I'll get some audio samples up!

I'm also thinking that now that my breadboard is getting rather messy (6 ics) and not immune to background noise (inherent of high speed electroncis on breadboard), that it might be worth it to pay the $40 to design and have manufactered one or two prototyping PCBs with a solid base, along with sockets for expandibility.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

#49
the 9-digit display isn't set in stone.

it's not the electronics that bother me (they make chips for this, and I could make my own co-processor without too much difficulty just to drive the display), it's the square holes in metal. filing is a pain, and hammond boxes are too thick for nibblers.



a much bigger rectangle for a backlit LCD might be easier than 3 smaller holes, but 7-seg digits are so much sexier! or maybe I can have one long rectangle, still with the 7-seg displays but with space between the three groups, and a blinking led between them. or something.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

frank_p


You could bring the boxes to a machine shop to broach them;  if you do so, make the plain segment between the windows a bit larger or you might have a few broken/unusable boxes.


markseel

#51
I agree, seven segment leds look great.

Check this out:
http://www.adafruit.com/blog/2012/02/22/review-–-the-solder-time-led-watch/

You could use different colors for each set of digits (red for three digits, blue for next three, yellow, and so on) but you'd have to use a separate led driver for each group due to brightness differences and forward voltage differences for varying color.  Or use different current limiting resistors, whatever.  But I think that would look cool.

Or what about using a small OLED display with a serial interface?
http://www.sparkfun.com/products/8537


cloudscapes

yeah I have a couple small oleds I got from ebay, a few lcds too. I think it's a bit overkill for what I need. a character LCD is the absolute max, and it won't be as high contrast as bright 7-seg displays.

the numbers in the graphic above are 7mm by 4mm, exactly based on some I found on mouser. a little small for reading, but at least the contrast is high.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

markseel

What did you use to draw the mock-up?

CynicalMan

Maybe make holes like this

and file down the points? It could be a cool bubbly shape display.

cloudscapes

Quote from: markseel on April 28, 2012, 09:51:16 PM
What did you use to draw the mock-up?

just photoshop CS3

Quote from: CynicalMan on April 28, 2012, 10:58:39 PM
Maybe make holes like this

and file down the points? It could be a cool bubbly shape display.

I've always had trouble drilling those kinds of holes. the bit and/or box tend to move around out of alignment when it hits the outline of a neighboring hole.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

cloudscapes

#57
A little update.  :)

It got sidetracked by my 1000th-page contest entry, another design, and general life. The great part is my 1000th-page entry uses the same architecture that I will use for this looper, the PIC32! I learnt a great deal about it, and C programming (which I hadn't really done when I first started the thread). The looper project is clearer now, and I'll slowly start work on it again now that I've made this:



Commercial dev boards are all so complicated, packed with features I'll never need, so I decided to design my own. At the moment, it's just the minimum. A beefy 100 pin PIC32, the crystal, a 3.3v and 5v power supply and what the pic needs to stay alive (the decoupling caps are SMD under the board). Also, a way to mount some pots for digital control, with the 0-3.3v all connected up, and the wipers to the pic's ADCs. This will probably be the first dev board of a few. Once I get RAM, the DAC and the ADC pretty much done, I'll include those right on the next version of the board, as well as whatever refinments I need.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}

wavley

Please tell me that you are planning on offering up some boards when you're done!!!!  This project looks like the only looper that will fit the bill of replacing my Boomerang+ with all the features that I would really need/use.  Plus it will look really sweet next to my Phase II when I get it done!

I <3 cloudscapes!
New and exciting innovations in current technology!

Bone is in the fingers.

EccoHollow Art & Sound

eccohollow.bandcamp.com

cloudscapes

I can't guarantee it'll feel much like the 'rang, though.  ;) I used to own one and felt it wasn't for me.
~~~~~~~~~~~~~~~~~~~~~~
{DIY blog}
{www.dronecloud.org}