Prop'rSound: A Sound Processor for the Guitar using the Propeller Microcontroll
Christof Eb.
Posts: 1,247
Hi All,
are there Guitar Players here? Well, I know there is already a high end·Guitar sound processor "Coyote".
Guitar amplifiers do not have great frequency bandwidths and the are even made to generate distortion, so the question is, what can be done·with Propeller onchip possibilities?
This is at some experimental stade and does need only an input like the microphone input on the protoboard and an output like the demoboard. So if you have a demoboard or the sound hardware of it, you can play with this software. At the moment there is no user interface. So you have to recompile for other sound parameters. In the version that is attached, the echo and reverb is activated and the distortion is desactivated, you might think elsewise, that the sound would be that bad....
The great benefit of Propbasic ist, that it is fast enough to write the sound processing not in assembler but in basic language. Many thanks, Bean!!!!
Propbasic gives enough performance for calculations between two samples!
The software runs on a demoboard. It can be tried with the onboard microphone. Some LEDs display input level.
The sample rate and therefore bandwidth is limited.
This gives higher adc bit resolution (sigma delta) and
gives more time for calculations between samples.
The time for echo delay can be longer with the onboard RAM.
The onboard RAM and the onboard adc and dac possibilities are used.
cog0 starts cogs
cog1 reserved user interface (not yet implemented)
cog2 adc and dac with reverb
cog3 ... cog7 for sound modules/tasks
The sound -13bit signed value- is passed through the modules through the global variables sslot(0..7).
A changement in the global variable "SampleNo" signals, that there is a new sample for processing.
At the moment, the parameters for the sounds (mostly in percent values 0...99) are given as
start values of variables. Have a look at the beginnings of the tasks.
Compressor, Reverb, Distortion, and Echo are implemented at the moment.
The basic idea for the user interface is, that the parameters are changed in a global parameter field and a local sub called "ReadParameter" shall read the parameters into the local parameter variables, after a global variable called "NewParam"·was changed. I want to use two pushbuttons·ABORT and OK and a potentiometer as RC to change parameters. Output on a serial parallax lcd. If there is interest, I can share some clearer definition of the way, the parameters are passsed to the sound modules later as a suggestion for a standard.
Feedback is welcome!
Ideas for sound modules?
How can one do the best sigma delta adc on a protoboard? (For the guitar input on the demoboard I use a preamplifier LM358N, but still the noise level could be better.)
In the new Elektor there is a feedback killer which works by shifting the frequency of the input. Such a frequency shifting module would be interesting (vibrato?). Can one simply multiply the signal with a sine signal to mix the frequencies?
....
Have fun!
Christof
are there Guitar Players here? Well, I know there is already a high end·Guitar sound processor "Coyote".
Guitar amplifiers do not have great frequency bandwidths and the are even made to generate distortion, so the question is, what can be done·with Propeller onchip possibilities?
This is at some experimental stade and does need only an input like the microphone input on the protoboard and an output like the demoboard. So if you have a demoboard or the sound hardware of it, you can play with this software. At the moment there is no user interface. So you have to recompile for other sound parameters. In the version that is attached, the echo and reverb is activated and the distortion is desactivated, you might think elsewise, that the sound would be that bad....
The great benefit of Propbasic ist, that it is fast enough to write the sound processing not in assembler but in basic language. Many thanks, Bean!!!!
Propbasic gives enough performance for calculations between two samples!
The software runs on a demoboard. It can be tried with the onboard microphone. Some LEDs display input level.
The sample rate and therefore bandwidth is limited.
This gives higher adc bit resolution (sigma delta) and
gives more time for calculations between samples.
The time for echo delay can be longer with the onboard RAM.
The onboard RAM and the onboard adc and dac possibilities are used.
cog0 starts cogs
cog1 reserved user interface (not yet implemented)
cog2 adc and dac with reverb
cog3 ... cog7 for sound modules/tasks
The sound -13bit signed value- is passed through the modules through the global variables sslot(0..7).
A changement in the global variable "SampleNo" signals, that there is a new sample for processing.
At the moment, the parameters for the sounds (mostly in percent values 0...99) are given as
start values of variables. Have a look at the beginnings of the tasks.
Compressor, Reverb, Distortion, and Echo are implemented at the moment.
The basic idea for the user interface is, that the parameters are changed in a global parameter field and a local sub called "ReadParameter" shall read the parameters into the local parameter variables, after a global variable called "NewParam"·was changed. I want to use two pushbuttons·ABORT and OK and a potentiometer as RC to change parameters. Output on a serial parallax lcd. If there is interest, I can share some clearer definition of the way, the parameters are passsed to the sound modules later as a suggestion for a standard.
Feedback is welcome!
Ideas for sound modules?
How can one do the best sigma delta adc on a protoboard? (For the guitar input on the demoboard I use a preamplifier LM358N, but still the noise level could be better.)
In the new Elektor there is a feedback killer which works by shifting the frequency of the input. Such a frequency shifting module would be interesting (vibrato?). Can one simply multiply the signal with a sine signal to mix the frequencies?
....
Have fun!
Christof
Comments
VERY COOL!!
I like the way you used ASM..ENDASM to create a multi-line comment.
As soon as I get a chance I'll try it on the demo board.
Thanks much for posting this.
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Use BASIC on the Propeller with the speed of assembly language.
PropBASIC thread http://forums.parallax.com/showthread.php?p=867134·
While you are right about the bandwidth limitations of guitar amplifiers, I still get nice harmonics well in excess of 10KHZ out of my guitars. These can cause havoc with your sampling if you don't sample fast enough or put an anti-alias filter in front of the ADC, and aliasing sounds *nasty*.
I also ran into pretty ugly distortion issues at very low volumes (very noticeable as the string decays).
Nice implementation though [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
thanks for the compliments... At least I can say, that I have done the code using the inline assembler this way......
Hi BradC,
you have adressed something, when you write about the signal to noise ratio. Yes, especially when the compressor is raising the gain factor, the noise can be heard.
Without the 2nd capacitor between 3.3V and the input pin, the noise is about 67/4096.
With it, it is 15/4096.
If you use a resistor soldered directly to the pins (suggestion of Phil for the am radio) 7/4096, which is about 9 bit usable dynamic range.
I have got an idea this night, I want to use 2 ADCs with different ranges in parallel. Depending on the signal strength, the input shall be switched automaticly. I am curious, if this will work....
(I don't know yet, if I will solder this guitar soundprocessor, but it is very interesting to experiment with the sound. And it is rather easy to try something with this PropBasic.)
What exactly is a "stroboscopic tuner?"
Christof
Yeah, those are the sort of figures I was seeing. Sounds like hell when plugged into an amp. As the string decays you get what sounds like a low level hash superimposed over it.
I'm not entirely sure how you would manage the dynamics, but its a neat idea. I had a theory initially that the noise was going to be fairly common-mode across the board, so I tried 2 ADC's driven from the same signal source (isolated by buffers though) and tried to use some commonality in the noise to help eliminate it. Failed.
The best way to try an idea like that is grab a prop-proto board and get soldering. They are especially resistant to having plated holes ripped out with numerous re-works [noparse]:)[/noparse]
It's worth soldering up to play with. I twiddled with mine for weeks. I even tried using external 13 bit ADC's and 12 bit DAC's, but the DAC's I chose had very nasty settling noise causing distortion almost as bad as the propeller DAC limit cycles. Got some really great multi-tap tape echo effects out of it though. Thought I was Hank Marvin there for a while [noparse]:)[/noparse]
Probably harder to explain than it is to build. I'd suggest googling "stroboscopic tuner" to get some background before you read the next bit.
What I did was build a board with 32 leds on it. Using the on-board ADC, one cog times what it thinks are about 5 string cycles. From this it has a pretty good guess at what note I'm playing. This cog also toggles an output pin when the signal is positive. The note data gets sent to a separate cog that runs the leds in a simple one led chaser at whatever the fundamental frequency of the note is x 32. So the leds do one complete cycle every string cycle.
The cathodes of the leds are all gated on by the positive indicator output pin.
The idea behind this is if the string is perfectly in tune, 50% of the leds should light up. If the string is flat then they slowly rotate right, and if its sharp they rotate left. The closer I get to the right note, the slower the leds appear to rotate.
Now, if the guitar output a perfect sine wave, you'd see 50% of the leds, but with all the other harmonics in there you get some odd displays with harmonics and partials. Still so much easier to tune with than anything else I've used.
A picture is worth a thousand words.
http://forums.parallax.com/showthread.php?p=838371
I've been meaning to get the code and schematic cleaned up and posted, but I'd been waiting to give it a real good go. I guess given I've been gigging with it since September last year and using it as my only tuner, I'd have to say it's been pretty well tested. I've used it to re-intonate a couple of guitars also and my luthier seemed to think I was pretty close.
One thing it does *not* currently do is actually tell me the note I'm playing (well, it does if I plug a TV into it, but I don't carry those to gigs). It will only tell me how close that note is to being spot on. It's something I always planned to add, but I just don't seem to need it. I'd have to be pretty deaf to be out a whole semitone.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Life may be "too short", but it's the longest thing we ever do.
Nice work. I'll have to try it out someday soon.
I play some guitar but mostly Pedal Steel Guitar. While distortion and guitar can work for some types of music, distortion and Pedal Steel Guitar don't get along.
The LM358N is fine for certain types of applications but for low distortion audio applications, a low noise op amp such as the Burr Brown series will provide much better results. As a matter of fact many solid state guitar amp & effects pedals mods are based on swapping the manufacture supplied op-amp with a Burr Brown equivalent. They are also used in allot of Professional audio equipment and pedals such as:
CD / DVD / SACD player upgrades.
DAC output buffers.
ADC input buffers.
Low distortion filters.
Audio amplifiers.
Crossovers.
Guitar amplifiers
Guitar preamps
Guitar Pedals
Etc........
One model that I've used in my amps is the OPA2604.
Over view from from the data sheet:
FEATURES:
l LOW DISTORTION: 0.0003% at 1kHz
l LOW NOISE: 10nV/