News:

SMF for DIYStompboxes.com!

Main Menu

Expression pedal multiplier

Started by Mojsisije, March 09, 2014, 11:05:48 AM

Previous topic - Next topic

Mojsisije

Ok, so I have a rather large pedalboard with about 5-7 pedals with expression inputs, which I'd very much like to use, but I don't want to have 7 expression pedals on or around my board because it's huge as it is. I couldn't find any readily available DIY projects or schematics for something like that, and commercial choices were a bit too expensive for me since I'm a bit isolated from most of the world. So I thought, why not make a programmable unit that splits the signal to the devices, something along the lines of an Expressionator. So after some research, I've found the main components, an Arduino for the brains, an AD5206 digital potentiometer to get the most faithful replication of the signal, and something to indicate and assign the units, so naturally pushbuttons and RGB LEDs. So first, some background on my way of thinking with this thing:

The expression pedal's signal will be read through the analog input of the Arduino.
To keep the sweep consistent and remove anomalies, set some arbitrary values for the min and max of the sweep, and make them update when it finds a lower/higher value at the analog input.
To prevent spikes from pushing too much, recalibrate back to the arbitrary values after a certain period of time.
Map the read values to serial values readable by the digital pot (Analog in goes from 0-1023, digipot takes 0-255)
Use pushbuttons to assign which of the digipot's 6 internal potentiometers will be mapped to the expression pedal.
While it's at it, use the microcontroller to make different taper variants.
Indicate everything with RGB LEDs


Ok, so with that in mind, I set out on my quest and gathered the required materials. Due to the limited number of pins on the Arduino, I used shift registers to manipulate the LEDs. Specifically 74HC595's, 3 of them, for a total of 8 LEDs, 6 are used and 2 more can be added for future implementations, I have the idea of adding multiple inputs as well, to add sequencers and whatnot, and making them assignable per output, so a total of 36 combinations, but that's all theoretical for now.
I got the first prototype running, but I have some things I'd like to smooth out, so I thought I'd get some more brains into this.

Namely, I didn't go much outside the box with this, in the way that I didn't explore anything outside of the functions I already knew. So here's something I'd like to fix before I make any schematics or project files:
- Try to reduce clock cycles on the code, so that the time between the expression read and send to digipot is minimal.
- Fix the tapers on the STEP and 4x LOW-HIGH modes. What I'd like is to divide and map the read values to 8 values from 0-255 to send out to the digipot, with the minimum sent value being 0 and maximum 255. This could be extended to 10 values if need be, I just want a few steps in it to get that arpeggiator sound. On the Low-High mode, I want it to be mapped so that in the domain of 0-1023, it sends the values of 0-255 4 times. So for the first quarter of 0-1023 it goes 0-255, for the second quarter also, and so on.
These functions in the code DO work, but not perfectly. And I'd like them to be smoother, because the 4xLow-High doesn't really go to a full 255 in the toe-down position of the exp.

Here's a little video of the prototype I have so far. Pedals used in the video are an EHX Ring Thing and Eventide Pitchfactor, the expression pedal being a Roland EV-5.
Note: the PF Mix B only goes to 9 because it calibrates to the exp pedal upon power-up, and I've done some value changes and didn't reset it before making the video, it works fine now though.



Anyway, here's the code so far, a schematic will be posted soon enough, I just have to get a bit more free time, so in a few hours to a couple days at most. Any help, comments, questions, or anything really is hugely appreciated, I don't think I've done the best job with this and would like to get this going as a project.

http://www.mediafire.com/view/arv9060swa8s2zs/Expressionator_v1_0.ino

Processaurus

Wow!  The stair step expression pedal I've been wanting to do for a long time.  You actually did it!

Mojsisije

Now that you've said it, I could probably just implement a mod for a 1-in-1-out box which just alters the expression taper!

But the stair step mode isn't perfect yet, the last step doesn't go to 100% of the sweep, meaning it never reaches full toe-down value, but just barely under it. Also I don't know if it's really proper. Here's the logic behind it and any input is encouraged:

The analog in from the expression pedal goes from 0-1023 (ideally, in reality it's more like 20-970, but for simplicity's sake let's say it's ideal)
Those values get mapped to values from 0-255, so 0-255 is the full range being sent to the digital potentiometer, which then converts the value to a potentiometer value of 0-10K ohms.
Now, I need the best solution to slice those 0-255 values into 8 discrete values. My logic was map them to 0-8 (or 0-7 can't really remember) and then multiply by a factor, I believe 32 and then reduce by 1 to get a maximum of 255, but that doesn't work so well.

Any thoughts?

Btw, I'll post a schematic for the whole thing as soon as I get the hang of this new drawing software I got.

free electron

One way would be to use a bit shift operation. Here's a pseudo code:

uint8_t input, output;   //input = your input value mapped to 8bit,
input >>= 5;         //right shift the value by 5  bits, getting a 3 bit output: 0-7
output = input << 5;       //left shift the value by 5 bit to get the 8 bit output for the digital pot

Basically is a simplest bit crushing (bit depth reduction) algorithm.
If you skip the last left shift operation, the output variable could be as an index indicator to read values from a table if you want to set the value of each step separately.
In that case:

uint8_t step_array[8] = {STEP0value, STEP1value,.....STEP7value}; //array containing the values for each step
input >>= 5; //input is now 3 bit, 0-7
output = step_array[input];



Cool project! I have been working on something similar last year. Only 4 channels, but i plan to add multiple tappers, LFOs etc. Project is on hold due to lack of time...




micromegas

Hi, a little bump here.

I've been interested in this thread since I found it weeks ago.

Did any of those projects arrive to a good end? I would like to try something similar.
Software Developer @ bela.io

Mojsisije

I've had a lot of work with college so I've stopped improving this, but I've since boxed it and use it on my pedalboard, it works really well, apart from the two modes that could use improvement.
I could draw a quick schematic if you're interested.

karter2000

Quote from: Mojsisije on May 13, 2014, 07:50:51 PM
I've had a lot of work with college so I've stopped improving this, but I've since boxed it and use it on my pedalboard, it works really well, apart from the two modes that could use improvement.
I could draw a quick schematic if you're interested.

I'm interested!

ElectricDruid

I don't know whether it helps, but I can tell you how I'd go about something like this, and perhaps you can use the best bits, or the bits that suit your situation.

Firstly, you want to get the 10-bit input from the ADC into a full range 8-bit output for the digipot. I'd use some "calibration mode", either at boot-up, or accessed by some combination key press (or both - boot-up the unit whilst holding down X) like you mentioned. When in calibration mode, the unit checks for the minimum/maximum ADC values. These are stored (in EEPROM if there is some, or Flash Mem if you can). You can then use those values to calculate a scaling factor which will ensure that you get a reading of 255 at the toe-down position.

Once you've converted your input into a neat 8-bit number, you've got something you can work with.
The different tapers can be done with lookup tables. A table of 256 entries isn't that big, but if you're really short of memory, use a smaller table and add a little bit of linear interp. If you had 32 entries in the table, you could use the upper 5-bits of your 8-bit variable to look up the value, and use the 3 lowest bits to interpolate between that and the next one. Doing a three bit multiply is only a few instructions even on a chip with no multiply.
For the stair step effect, someone has mentioned bit crushing, but an alternative to doing it by down shifting and then upshifting is just masking the low bits off with an AND. <value> & 0xF0 would reduce the input value to sixteen levels. 0xE0 gives you only eight levels, etc.

It sounds like a great project. Good luck!

HTH,
Tom

Mojsisije

Quote from: ElectricDruid on May 26, 2014, 04:45:43 PM
I don't know whether it helps, but I can tell you how I'd go about something like this, and perhaps you can use the best bits, or the bits that suit your situation.

Firstly, you want to get the 10-bit input from the ADC into a full range 8-bit output for the digipot. I'd use some "calibration mode", either at boot-up, or accessed by some combination key press (or both - boot-up the unit whilst holding down X) like you mentioned. When in calibration mode, the unit checks for the minimum/maximum ADC values. These are stored (in EEPROM if there is some, or Flash Mem if you can). You can then use those values to calculate a scaling factor which will ensure that you get a reading of 255 at the toe-down position.

Once you've converted your input into a neat 8-bit number, you've got something you can work with.
The different tapers can be done with lookup tables. A table of 256 entries isn't that big, but if you're really short of memory, use a smaller table and add a little bit of linear interp. If you had 32 entries in the table, you could use the upper 5-bits of your 8-bit variable to look up the value, and use the 3 lowest bits to interpolate between that and the next one. Doing a three bit multiply is only a few instructions even on a chip with no multiply.
For the stair step effect, someone has mentioned bit crushing, but an alternative to doing it by down shifting and then upshifting is just masking the low bits off with an AND. <value> & 0xF0 would reduce the input value to sixteen levels. 0xE0 gives you only eight levels, etc.

It sounds like a great project. Good luck!

HTH,
Tom


I've learned that due to the nature of the expression pedal, it can fluctuate the minimal and maximal settings, and even if calibrated upon startup, it's possible that the min/max value is never reached again, which is why I set it to auto-calibrate continuously from arbitrary values upon startup, and then reset to those values after a set period of time for optimum performance.
Thanks for the other tips though, I'll look into them when I have time!

I'm really busy with college lately, so I'll try to get a schem and new version as soon as I can get a day to dedicate myself to it. I'm sorry for the huge delay but I've got to make money and finish my courses before hobbies get the attention they need.

micromegas

Don't need to apologize man.

I understand you position perfectly: I have almost 30 projects on hold because of college. But I rejoice myself when I think I'll have my EE grade finished in October
Software Developer @ bela.io

cannedwalrus

Hey, did you ever happen to publish documents for this?

ElectricDruid

#11
Quote from: Mojsisije on March 20, 2014, 10:10:11 PM
I used shift registers to manipulate the LEDs. Specifically 74HC595's, 3 of them, for a total of 8 LEDs, 6 are used and 2 more can be added for future implementations

One query about this - The 74HC595 has 8 outputs per-chip, so why did you need three of them? That'd give you 24 outputs.

HTH,
Tom


pruttelherrie

Quote from: ElectricDruid on October 23, 2017, 08:23:31 AM
Quote from: Mojsisije on March 20, 2014, 10:10:11 PM
I used shift registers to manipulate the LEDs. Specifically 74HC595's, 3 of them, for a total of 8 LEDs, 6 are used and 2 more can be added for future implementations

One query about this - The 74HC595 has 8 outputs per-chip, so why did you need three of them? That'd give you 24 outputs.

I'll answer for him:

RGB leds :)

ElectricDruid

Quote from: pruttelherrie on October 23, 2017, 12:21:41 PM
Quote from: ElectricDruid on October 23, 2017, 08:23:31 AM
Quote from: Mojsisije on March 20, 2014, 10:10:11 PM
I used shift registers to manipulate the LEDs. Specifically 74HC595's, 3 of them, for a total of 8 LEDs, 6 are used and 2 more can be added for future implementations

One query about this - The 74HC595 has 8 outputs per-chip, so why did you need three of them? That'd give you 24 outputs.

I'll answer for him:

RGB leds :)

Aaaah! Ok, that makes sense. Thanks.

T.

pinkjimiphoton

nekro bump!!!
moron here!! would LOVE to see the schematics etc for this project if still available!!
thanks!
  • SUPPORTER
"When the power of love overcomes the love of power the world will know peace."
Slava Ukraini!
"try whacking the bejesus outta it and see if it works again"....
~Jack Darr