MIDI, wireless, touch pad, guitar, PICAXE!

alband

Senior Member
Hi there, first post in a while, and first post without "OT" in the title in an even longer while.

First off, I'm at uni so time is scarce to say the least. With the Xmas hols coming up soon, I want to get this project planned and ready.

Second; you might want to get a coffee/tea/stiff drink ready, this is long (or not bother reading it at all!).

I have a project and some ideas on how to do it. However, it's reasonably expensive, so before I go buying everything in order to make it, I'd like to run it by the guys who know everything (which will hopefully include every necessary detail about the project by the end of this post).

The current situation: I have a guitar with a built in effects pedal. This pedal has 5 controlling POTs and a bypass switch. Currently, I have easy access to the bypass/engage switch and two of the 5 POTs so I can change these with relative ease while playing. The pedal is turned on and off when a jack is plugged into the guitar.
Side note: The guitar also has two other things built in, a sustainer (one of the pick-up coils becomes a driver coil to drive the strings indefinitely) and a special set of pickups. Currently they run off two separate (common ground) 9V batteries. The sustainer (uses up a 340mAh battery in about 3 hours) runs off one battery; the rest (barely any current draw) runs off the other battery. However, the sustainer circuitry senses when a jack is plugged into the guitar (the tip of the jack breaks two contacts) and then grounds all the other devices' grounds to the common ground, effectively turning on all the other systems. The two 9V batteries can be easily removed (picture) and put in a charger to recharge.

What I want to achieve:

1. I want to be able to control all the dials and switch on the fuzz factory via MIDI. During performances I control various effects boxes using my computer using a USB/MIDI interface. I would like to be able to do the same with the fuzz factory. It would also mean I can effectively "save" settings which would be invaluable for this pedal; given a small difference in (just touching sometimes) a particular dial can have a huge effect on the sound. Also, lots of setting combinations sound terrible, but a select few sound fantastic.
I would want to have MIDI control of the bypass switch DURING performances, so for example during a verse the FF (fuzz factory) is bypassed, then when I get to the chorus it turns itself on. However, I wouldn't need the dials to be MIDI controlled DURING a song, only changing settings BETWEEN songs. However, there are two dials that I, physically, would want to be able to change during a song (the two I can currently control).
As for bypassing and engaging the FF pedal itself, the only way I can think to do this is using a SPDT relay?

2. MIDI touch pad (yes I'm a MUSE fan). This isn't an immediate need but something I would definitely plan on doing at some point, if not during Christmas. It's quite a simple concept. A resistive touchscreen is fitted to the guitar, the position of a finger is read as X,Y coordinates. The values of the coordinates are used as MIDI inputs, like a foot pedal position. So, it allows two parameters to be controlled. This would be used live, during a performance, so it needs to be fast (more on that later). It would also need to have two modes. Firstly where the last touched position is "held". That is easy enough to achieve as it just means X,Y values be continually send until the touch pad is no longer touched. And secondly, where the values "fall" back to zero when the finger is released. Also easy, just send (0,0) when the finger leaves the pad. I would also like it if it had some LED's behind it to make it glow (RBG). Also, the touch pad assembly needs to be completely surface mount. This shouldn’t be too much of a problem. The screen is dead thin and I can have its circuitry in the back with the other circuits. No extra routing should be needed. This is a video which has a good demo of the real thing. Skip to about 1/2 to just see the bit about the touch pad.

3. Change the batteries. I'll probably handle this one. I intend to put eight 1.2V 1200mAh NiMH batteries in place of the current 9V ones. Just so you know what kind of power supply we'd be dealing with.

4. Wireless. (Oh no!). Yes it would prefer it if the MIDI data exchange were wireless. My reasoning is actually pretty simple (aside from it being "way cool"). I currently use a normal audio cable coming from the guitar, that isn't wireless yet. However, if the MIDI data exchange were wired, I would need TWO more cables running from guitar to effects unit/computer. This is because it would have a MIDI input (touch pad) and MIDI output (FF controls) so, if done in a wired manner; it would need two separate MIDI cables to send and receive the data. I could reduce this to one cable where that cable has a PICAXE at each end talking to each other, but that is still too many cables for my liking. So this leads to the question of what wireless method. IR would just be too dodgy. Anything blocking a direct line of sight (e.g. me if I'm facing the wrong way) would disrupt it. Obviously it would need and RF solution. There are many to choose from though and I have never done any before. The criteria for the wireless devices are:
  • It can exchange data fast enough to keep track of the MIDI touch pad.
  • It must have 100% reliability. If a transmission to bypass the FF at some point during the song got lost, it would spell disaster.
  • It needs to have good range. 10m range would be good, >30m would be better.
  • It needs to be small. Conditions in the guitar are pretty cramped. I'm going to be moving stuff around inside it to make more room. I'll attach some pictures at the end to show what I've got to play with.
  • Obviously, the closer the price is to free, the better.

EDIT: Missed an item from the list: I want to still be able to use the guitar as an ordinary electric with any amp with any cable.
 

Attachments

Last edited:

alband

Senior Member
Part 2

Right, that's the main brief; here are my ideas and thoughts so far for each of those goals:

1. Fuzz Factory. The FF control is probably one of the more difficult parts of this build. Until I last drafted up this post, my solution wasn't great, it's now slightly better than that, I'd say. I would replace each POT in the FF circuit with a dual gang POT of the same value and taper. I would wire up one of the gangs (is that the right wording?) to the FF circuit and the other would replace the POT in a micro servo (btw, I don't think that circuit diagram for the FF is 100% accurate, but will do for now). The shaft of each of the dual gang pots would be connected to the output of the servo (which I would modify so it could rotate continuously). As I said earlier, I want to be able to turn two of the POTs by hand whilst playing. Those two POTs would be mounted with their shafts sticking up out of the guitar (much like any guitar control). The servo would be attached to the shaft through the BACK of those POTs. It would also have some form of crude clutch so that I can turn them against how they have been set by the servo. That little set up will be tricky, but I think possible. As for the other three POTs, I can attach the servo directly to their shafts.
With that set up, (assuming I have sorted the control of the servos via a PICAXE) I can change the values of the POTs by changing the servo positions, and can hear the effect of these changes in real time (because the audio circuit through the FF is separate from the PICAXE control circuit). I can arrive at a setting for the POTs that I like the sound of and ask the PICAXE to either save locally or send back the positions of the servos, and then later, I can recall that setting by changing the servos back to those positions.
So between songs (the easy part) the PICAXE needs to be able to receive instructions to and then change servo positions, remember what it last set each servos value to and then tell the main controller what these were in order to save them. Easy enough.
DURING a song, it just needs to be ready to receive and act upon the command to bypass the FF (could be set as an interrupt so it doesn't need checking perhaps?).

2. MIDI touch pad. This is where things get tricky. I'm not precisely sure how the resistive touch screen works but I can work that out by myself. The result would be reading two ADC values between 0 and 127 (probably 10bit resolution, scaled and fitted between 0-127... maths), storing them in byte variables then sending them back to the MIDI network (via wireless hopefully!). Now, as some rough estimates based on what is possible and what I want to replicate, I need to be able to send about 3000 of these bytes per second. That figure is based on:
Code:
Need to be able to go from top left corner to bottom right corner of pad, and back, 6 times in 1 second, smoothly.
For it to be smooth, each value from 0 to 127 to 0 should be sent along the way.
That means 256 x 6 values to be sent per second for each axis
That means 3072 values to be sent per second
So, I need to be able to do a cycle of reading each ADC value, and sending them in 0.6ms. So that's one more thing the PICAXE has to be able to do during a song. It only needs to send value when they're changing, obviously, but as soon as they change, it must be up to speed with the values it's sending. Zero latency would be best!

3. Battery. I have a cunning trick for charging it, but it need not take up forum space.

4. Wireless. This is the trickiest bit. Wireless modules need to be chosen that can do the job. First, to outline "the job":
  • They need to be able to send and receive data without software switching. I.e. If I'm using the touch pad to send data FROM the guitar, but at the same time, the command is send TO the guitar for the FF to be bypassed/engaged, it must be able to cope (hopefully should just send the FF command TO the guitar between messages FROM the guitar).
  • Needs to have sufficient range. 10m would be good, 30m would be better, but it NEEDS to be reliable, not 30m on a good day, 1m on a bad day.
  • Needs to be able to cope with the data rate. As mentioned before, the touch pad would send about 3000 bytes per second when it's touched. So minimum data rate should be around 3kbps.
  • Low power, obvious really. Needs to be considered.
  • Low price. Similar to power. Free would be best!


I haven't done wireless modules before (surprised?). I've looked around and, well there is so much on offer, I'm clueless as to what is best. I had a look at the PICAXE wireless kit and it won’t cut it, for a start it's one-way. There are various Bluetooth modules around that offer a nice secure connection but they all seem a bit too short range. I found a couple of good looking modules on eBay, both with apparently excellent range and fast enough data rate:

http://ciseco.co.uk/downloads/documents/datasheet%20-%20XRF%20v1-6.pdf
http://droboticsonline.com/ebaydownloads/APC220Mannual.pdf

So those two look good to my untrained eye, but what to a trained one? Or could someone tell me what I should be looking for?
Another concern I have is with the RF modules interfering with the audio circuitry in the guitar and vice versa. The audio circuitry will be run off the 9.6V NiMH pack directly, the servos off a 5V regulator, and the rest of the circuitry either from the same 5V regulator, or from a 3.3V regulator (depending on what voltage levels are needed for the wireless, I would choose a 3V PICAXE if it was easier). Would this shared power source cause a problem?
Also, the Fuzz Factory pedal (to my unextensive knowledge) is basically an oscillator circuit, which can oscillate at any frequency. Would this cause a problem with the wireless modules? They would be within 10cm of each other in the guitar.

I found quite a few other wireless modules on my favourite online market place. This one was a popular hit. It is quite suspiciously cheap. It appears to have a lot of the wanted specs. It only seems to lack in the range department, where it claims 100m. Would still be 100m if enclosed in my guitar though?

5. MIDI This would be done at the base station end. That PICAXE would convert whatever it receives from the guitar into MIDI messages that can go into a MIDI input somewhere (via an optocouple etc.). It can also take MIDI messages and convert them into serial messages to send to the guitar. Unfortunately MIDI seems to be one of those topics that's been covered so much it's barely visible. But it should be up to me to dig it out. I believe it requires hersetup, hersin, hersout and a knowledge of MIDI spec 1.0?​

So finally, a summary of the questions:
  • Can anyone thing of a better way to do any of the things I’ve suggested as solutions to my problems?
  • Is this the correct wording: “I would wire up one of the gangs”?
  • Do the first two modules I posted look any good? Have I missed some obvious characteristics of them that make them useless for this application?
  • Would there be a problem with the audio circuitry running off the same battery as the rest of the circuitry (the rest of the circuitry being powered through voltage regulators)?
  • Does anyone know if there would be a problem with the Fuzz Factory interfering with the wireless modules? (I have managed to get my guitar to pick up radio before now using the Fuzz Factory)
  • Would the range of any wireless module be heavily reduced by being put inside a guitar?

Thanks greatly in advance for reading any part of this if you have and for any time spent helping me with it.

I'd also like to give Manson's a special mention who modified this guitar for me in the first place. Absolutely excellent job, well worth the price.
 
Last edited:

Jamster

Senior Member
Phew...
Most I've read on the Forum, but here goes:
1) Your way seems excessive, I personally would just use a digital pot, like: http://www.sparkfun.com/products/10613 Obviously it will depend on the value you require but it seems a lot cheaper and simpler, albeit slightly harder to control. For the pots you require physical control over I would still control them with the above method but have a physical pot as well (perhaps mounted on the guitar?). For bypassing the switch SPDT Relay is probably the best way provided you don’t mind the current draw.
2) Very soon e will come along and post a few links for you, one will be Wilf’s touchscreen routines and the other will be the links to the MIDI threads… :)
3) That’s easy then…
4) Wouldn’t it be easier to buy just one cable but with 5 cores? Gnd +V, Sound, Rx, Tx – That sorts out batteries as well…
I’m not really an expert on wireless so I am going to leave the module analysis and recommendation to someone who knows what they are doing.
5) That is probably easiest, and Yes they are the fundamentals of MIDI.
I wish you good luck with your (ambitious) project, and am looking forward to the end result,
Jamster
 

alband

Senior Member
Thanks for reading it Jamster! It is one of the longest post I've seen :confused:

1. I initially thought "digital POT" when I first thought of the problem. But I (looks like VERY foolishly) though that digital POTs wouldn't be electrically the same as a real POT, which an audio circiut such as the FF would need. However, I looked at the datasheet for the one you posted and more or less the first line of it indicated how these digipots actually work. They appear to use a network of resistors in series that a wiper can somehow hop between, thus acting exactly like a real POT. I would probably want at least 9-bit resolution though. Currently I can't find any 5k digipots that have more than 8-bit. Would there be a clever way of combining two digi pots to get VERY high resolution? I'm still trying to arrange it in my head but I think it would be possible. However, the end-to-end resistance must still be 5k.
I have though found a nice little dual 10k, 10-bit, non volatile, SPI interface dual digipot. For the two POTs I want to control, I agree, keep the digipots doing the work, but have some real POT (the ones I currently use even) to read what value to give the digipots.
Questions then:
  • Would a digipot work in that FF circuit, provided it had the same end-to-end resistance? I think it would, but just to check.
  • Can anyone think of a clever way of arranging a couple of digipots to achieve higher resolution (or alternatively, a sure proof as to why it can't be done)?

2. I look forward to hearing from him!
3. Hopefully, yep.
4. I would want to be able use the guitar as a normal electric too. I should have said that as a criteria, I may edit that into my first post. So I would want to be able to go to ANY amp with ANY cable and still be able to use it as just an ordinary guitar. So I wouldn't want to need a special cable and converter all the time, else not be able to play it. So, it HAS to have the ordinary 1/4" jack and cable. It also has to have an internal battery pack because it is now an active guitar (unavoidable bi-product of the sustainer kit), but that's not a problem. However, it does mean I'm not keen on adding any other cables to transfer data.
5. Must say, I'm NOT looking forward to the MIDI part, ah well.

Thanks for the good wishes, and thanks for the digipot suggestion. Probably just saved a lot of hassle and money there!
 

Jamster

Senior Member
I think the easiest way of getting higher resolution is like:
Code:
 Pin1
     |
     |
    ._.
    | |
 V1 | |--.
10K |_|  |
     |   |
        ._.
        | |
     V2 | |--.
     1K |_|  |
         |   |
           Pin2
It should work as 'tens' (V1) and 'units' (V2).
Jamster

P.S. Sorry about not posting link, it's bookmarked for future use.
 
Last edited:

hippy

Ex-Staff (retired)
First off, I'm at uni so time is scarce to say the least. With the Xmas hols coming up soon, I want to get this project planned and ready.
With scarce time and a very ambitious project I'm not sure how feasible it all is, and wouldn't consider it myself as a job which could be completed in just a few weeks over Christmas. Perhaps break it up into sub projects so it's much easier to digest and attempt.

For the wireless there should be 2.4GHz WiFi - perhaps ZigBee or Bluetooth - solutions possible and 11Mbps should give enough bandwidth with room for retries to avoid data corruption. There are commercial wireless links for MIDI which is about the same baud rate you are looking at. If you were hoping to use cheap 433MHz modules then I'd say that's unlikely.
 

alband

Senior Member
Hi there, end of term panic so just a short post.

You're right Hippy, I don't have that much time, but my holiday is over a month long so I do have a fair bit. I would probably do it in stages anyway. Starting with the battery. Then the FF controls, then wireless then XY pad. Once I have the parts, the battery should take a day so I would hope I could also get the FF controls and wireless done this Christmas.

I'm not sure I understand the reasoning behind needing 11Mbps? Also, the Xbee (is that the same as ZigBee, seems to be) modules seem to have a max data rate of 250Kbs. I still don't understand why I'd need quite that much, but then again, you don't have the position in this forum you do for no reason. Thus I've started looking up Xbee. This will take time (penny for every time we've read "Xbee"?), but is for me to do, not asking for help on that. Found a couple of modules in particular I like. So for the wireless, I'll leave it on Xbee for the moment, with research needed.

As for the POTs. I've decided that actually 8-bit resolution should be ENOUGH. I'll use the 10-bit chips where available, but I can cope with 8-bit I think. 300deg travel divided by 256 steps = almost 1deg resolution, which should be enough. HOWEVER, I hadn't realised something. For the two POTs I want to be able to control live, I can't use digipots. This video adiquately shows why (just watch the beginning if you can bare). The first few pitch sweeps take about 60deg. So, when those two POTs are being used like that, they can't be inputs to a PICAXE that then changes digipot values as the resulting sound would be in "steps" (YUCK!). When being used like that, the actual POTs being turned MUST be in the circuit. This requires switching the FF circuit between the digipots and actual POTs.
Each POT input is three contacts, I believe I could get away with only switching two of these. I can already think of two ok solutions for this:

Have the FF circuit normally connected to the digipot. Have dual gang POTs where one gang is an input to the PICAXE, so it knows when the POT is being turned. When the POT is being turned, the PICAXE switches a relay to make the FF run off the REAL POT.

OR. Just have two physical switches used to switch between REAL and digipots. I already have two DPDT switches in the form of push/pull POTs in the volume and tone contols for the guitar.

Both are adiquate, I think I prefer the first. Anyway, the ball is in my court for the moment and I don't have time to return just now so this thread will have to be on hold for the moment.

Thanks for the help as always. This project has already been heavily shaped by it :)

David
 

Jamster

Senior Member
Meant to mention in the last post regarding cables instead of wireless the idea of using two sockets:
1) Standard audio jack for normal use.
2) Extended port which will transport data and audio (separate cores) and then split at the other end terminating with a Jack-plug and a plug to go into system.

Just a thought should wireless seem too far away.
Jamster
 

alband

Senior Member
Hello, I'm back from uni so I have time again.

However, I've been planning and researching and hit problems.

I worked out that actually, I would want at least 9-bit resolution but that this was easily possible. I worked out that to achieve that resolution for the 5k pots, I could put 2 of the 10k pot in parallel, which would half their value, provided they each had the same value. So that sorted that issue, however, after maticulasly learning the datasheet for them, I discovered that the end voltages of the POT cannot exceed 5V :eek: So that's those completely out the window.

The ONLY digipot solution is this. It has some bad setbacks though:

  1. Minimum voltage must be 9V (which is what the FF runs at, I was planning on using a 9.6V supply from batteries so that could be touchy?
  2. They don't come in 10k versions, 20k is the closest.
  3. They're almost a £5 each!
  4. They just have the one circuit per chip.

Asside from those they're quite nice. 10-bit, seperate power supply from logic and POT, and the even have a 0v crossover window sync input to allow the wiper to change position when an audio signal has zero amplitude (complex to achieve though).

To solve problem 2, I can use the same tactic as I would have for the other POTs. If I put "n" in parallel, the resistance is one "20K/n". So, for the 10K POTs I need two chips, for the 5K four. That is 14 chips though, which is ruddy expensive. The workaround: Not all of the POTs (as far as I can tell) need to be their exact resistance. 3 of them are being used as rheostats. This is the bit I currently need help with.

Here is a schematic of the FF circuit. Case by case for each POT:

Stab. Originally 5K rheostat. If I use two of the new 20K POTs in parallel, I get a 10K POT with 1024 steps. I can only use half of these to get my 5K travel, which is high enough resolution; SORTED.
Gate. Originally 10K rheostat. I just need one 20K POT. Again only use half the 1024 steps, I still have 9-bit relsolution and 10K travel; SORTED.
Volume. Originally 5K potetial divider. Since this is a potential devider, can it be any value? I'm guessing it needs to be 5K because otherwise they would have used 10K in the FF circuit, but I can't see WHY it needs to be 5K. Conformation of that would be really helpful.
Drive. Originally 10K potential divider. Again, it's a potential divider, so could any size POT be used? Again, I'm guessing it needs to be 10K just due to how it's arranged; it looks more complicated than a standard potential deivider layout. Again, help would be appriciated on that.
Comp. Originally 10K rheostat. Same as Gate, if I use just use half the travel of one 20K digipot, I have 9-bit resolution, which will suffice.

So, take into account that I only need 2 digipots for stab, one each for gate and comp and assume four needed for volume and two for drive, I would only need ten digipots. However, if it is possible to use fewer for the volume and drive POTs I could only need 6 which would be excellent. So could someone who is good with their analogue circuitry confirm how tollerant the volume and drive POTs can be of their values?

As for the other aspects of the project. The Xbee looks good. Done plenty of reasearch on them, and they look very nice and easy to use.

@Jamster: I know it probably sounds bizzar, but I'm not keen on defacing the guitar to do this project. So, if it all went to POT :)rolleyes:) I could take everything out and would be left with the same guitar I had before. Last time I was "sure" I wanted to do a mod to it, I drilled a hole in it. Since then I've undone that mod but I still have the hole :/ Just don't want a repleat of that. Also though, if I had a cable solution, whereby I made my own cable, I'd be limited by the length of that particular cable, and would have to make other ones of different lenghts if I wanted different range. Another good suggestin I hadn't initially thought of though, plus you've been reading my lengthly posts, so thanks on both count!

Cheers,
David.
 

alband

Senior Member
Given up hope waiting for replies, but then I can understand my posts are long and probably boring to read. So, in hoping for an answer, here is JUST the question from the last post:

Here is a schematic of the FF circuit. Could someone who is good with their analogue circuitry say how tollerant the "volume" and "drive" POTs can be of the values they have in the schematic? Ideally, i'd like to replace them with 10k POTs. Is it likely anyone might even know the answer to this?

I would really appriciate help on this because any other options than being told are either very expensive or basically impossible.

Thanks loads to anyone who replies,

David.
 
Top