# Violin bow position tracking with SMD LEDs and photoresistors

Objective: Marking labels indicating the positions of the violin bow on an acoustic signal, for example, a single musical note played by a full-length bow. The following video shows the example I am talking about, please just take a look from 1:00 to 1:03: https://www.youtube.com/watch?v=XIKPHsVyxKs

If divide the bow into three parts with equal length, roughly two markers can do it. So what I want to do is put those two markers on the corresponding acoustic signal, like this:

The objective is to figure out "oh, at this and that moments, the bow has traveled 1/3 and 2/3 of the whole length, respectively" when looking at the acoustic signal. A naive way is to simply divide the time axis of the acoustic signal by three, but it cannot be assured that the velocity of bowing is constant.

Method: According to the article http://www.ubicomp.org/ubicomp2013/adjunct/adjunct/p211.pdf which used a pair of colored SMD LEDs (as emitters on the bow) and color sensor photoresistor (as receiver on the violin) to tackle the problem. However, the circuit and the explanation of figure 3 are not clearly described, which made a lot of problems for me.

Problem: In short, based on my understanding, by installing SMD LEDs with different colors on the bow (red and blue marks in the case of the above figure), and a color sensor photoresistor on violin which detects the time-varying voltage when illuminated by SMD LEDs on the traveling bow, the objective described in the first place could be achieved. The following figure explains the idea:

So the peaks in the figure indicates the positions of both LEDs. By aligning the time-varying voltage and the acoustic signal, the objective shown in the first figure is solved.

1. Is the above statement correct, achievable or not?

2. If so, how to set the circuit on both two ends (emitters and receiver)?

I am fairly unfamiliar with hardware and electrical components, hope you can help me if possible, thank you very much!

EDIT: I've implemented the LEDs and photoresistor as detector, and it works as I desired. Here comes the other problem: the alignment of the recorded audio signal and the time-varying voltage detected by the photoresistor. What came to my mind is a acceleration-sensed LED installed on the driving point of the bow, which makes a blink at the moment the player drive the bow. The idea is to blink the LED once the change of the acceleration direction is detected by a component. Such change in acceleration direction will thus make a impulse on the displayed time-varying voltage which indicates the onset of the audio signal.

How could I achieve such acceleration detector combined with a LED, with an acceptable size to be installed on the violin bow?

• That's an intriguing project! The setup described in the pdf seems to be more complex than what you describe above, involving multiple infrared LEDs to measure the movement of the bow and also a colour sensor to detect absolute position. I'm afraid the short answer is that if you are 'fairly unfamiliar' with electronic hardware then this is probably beyond you, sorry. However I wonder if you could achieve what you want using a pair of LEDs at known positions on the bow plus a tiny video camera at the bridge, and use image analysis software to track the LED positions? – nekomatic Feb 2 '15 at 11:28
• I think you'd be better off simply putting some reflective dots on both the violin and the bow, and using a tripod-mounted video camera and motion capture software to track the positions of both items. – Dave Tweed Feb 2 '15 at 12:04
• Thanks for your comments, seems you have a similar suggestion of motion capture. However, it seems more complicated to me. @nekomatic I just grab the simpler setup for bow position detection, and I am willing to hear further suggestion though I am unfamiliar with it. Because the motion capture seems only to capture the motion of the bow, it doesn't make sense, for me, to answer the question "oh, at this moment the bow has traveled 1/3 length of the bow from the bottom" when looking to the acoustic signal. – Fred Feb 2 '15 at 12:31
• I think to help further we are going to need more information on what level of electronics expertise you do have: what sort of circuits have you built before, if any? It sounds as though the hard part of this project is not the electronics but the mechanical and optical arrangement of the components and the analysis of the resulting data: what are your skills in these areas? – nekomatic Feb 2 '15 at 14:13
• Thank you. Actually the main part of this project is analyzing the acoustic signal, also my main knowledge, which is automatically trimmed by the markers made by the sensor. So I am stuck in this very first step. As far as I could remember, I did a fundamental circuit measuring the current through potentiometer, simple LED circuit and optical fiber before, but they were just basic exercises in the class. I think I could study my own with some particular instruction. – Fred Feb 2 '15 at 15:08

I like it. Keep it simple to start with. With two LED's of the same color. Then you'll just see two peaks as the led's go by... you'll have to figure out which end of the bow the signal is from. (or do some color tricks later.) For the LED drive circuit, a 9 volt battery, two white leds (Vf ~3.0 V) and a resistor to limit the current. Something around 300 ohms would give ~10 mA of LED current.

On the detector side, I might use a photodiode. But lets's keep it even simpler. Get another 9 volt battery, a light dependent resistor (LDR) and another resistor whose value we will need to determine experimentally. The LDR decreases in resistance when the light shines on it. So put the two resistors in series with the battery and measure the voltage across one of them as you move the led around. Depending on which resistor you choose (fixed or LDR) your signal will either be an increasing or decreasing voltage as the led goes by. Now play with fixed resistor value to give reasonable signals..
And now make some music :^)

• Thank you very much for answering, I can't wait to try it out. To clarify, on the detector side, there will be a series of LDR, fixed resistor and battery. I can pick the fixed one for measuring parallel voltage and read the value through DAQ system. As for the LED side, one of the problem is the determination of which end of bow the signal is from, which can be solved by using different colors of LEDs. Is the statement correct or not? Just a quick idea, is it possible to apply different power supply for each LEDs so the measured voltage might differ in the peak values? – Fred Feb 2 '15 at 16:52
• Yeah that's mostly correct. With different color LED's, I think you'd want two detectors with a color filter over each one. Making one LED brighter is a nice idea that you should try. You might also get different responses from different color led's because they put out different amounts of light... or a different spectral response form the LDR. Getting fancy you could blink the leds at different rates and detect that... though LDR's are not very fast so for blinking you might want a photodiode. Play around on your lab bench first, before you put anything on your violin. – George Herold Feb 2 '15 at 17:03
• Thank you! I might have further problem when playing around, wondering if I could still ask for your help at that time if possible :) – Fred Feb 2 '15 at 17:12
• This is a reasonable suggestion for getting started, but see my answer for possible shortcomings. If a 9 V battery is too heavy to mount on the violin or bow you could use two lithium coin cells in series for 6 V or one on its own for 3 V which would be adequate for a red, green, orange or yellow LED as these typically have Vf about 2 V. You could also consider an RGB light sensor instead of LDRs, see link in my answer. – nekomatic Feb 3 '15 at 11:29
• Why create a decoding problem,when using two colors solves it? – Scott Seidman Feb 3 '15 at 11:44

You can certainly try a setup with two different coloured LEDs and two colour matched optical sensors (e.g. LDRs with corresponding coloured filters, or two outputs from a colour sensor IC) but the problem I foresee with trying to derive the bow position from the sensor responses is that the signal from the LDRs will vary not only with the movement of the bow along its stroke but also with the angle of the bow relative to the violin, which will not always be the same if you are trying to capture data from 'natural' playing, and with any changes in ambient illumination unless you are careful to eliminate this or filter it out.

Some other methods you might want to consider are:

• A small video camera mounted on the violin body that records the motion of LEDs or reflective dots on the bow, which you could then track and convert to bow position using image analysis software. After isolating the dots in the image the analysis could be as simple as calculating their left/right position across the frame - I think this would be much easier than attempting to analyse motion capture of violin and bow from a fixed camera.
• An alternating pattern of dark and light bars on the bow that would be illuminated by a line light source, e.g. a bright LED shining through a narrow slot, and a single optical sensor to measure the reflected light. This would give you a pattern of high and low responses from which you could determine the bow position. It won't by itself give you absolute position but you suggest you always intend to capture a whole bow stroke, so you can assume that (e.g.) the first peak in the response always corresponds to the first bright bar on the bow.
• An ultrasonic proximity sensor mounted either on the violin body or on the player's right hand or wrist, perhaps combined with some sort of target on the hand/wrist or violin respectively to increase the reflection of the ultrasound. If this works this should give you a signal corresponding fairly well to the absolute position of the bow.

Sparkfun would be one source for possible sensors (optical, proximity) and have distributors in many countries if you're not in the US, but many other companies also offer these types of sensors.

• Thank you for these informative alternatives. I just tested the circuit on bread board and it worked. I was also concerning about the weighty battery issue, but alternative battery and LEDs would solve it probably. I think the most problem comes from, as you said, the rotation of the bow while playing. For this, taking the article mentioned in the original post for reference, a ring of SMD LEDs as each marker on the bow could probably do the work, I guess. – Fred Feb 3 '15 at 14:43

I have an idea but it requires some DSP knowledge and programming skills. I assume bow movements are clearly distinguishable on the signal monitor. If you filter the record with a sufficiently narrow pandpass filter, near to lowest frequencies. The waveform you will have will be a function of the speed of the bow as frequency modulation. What you have to do is just counting the alternations belong to the particular movement, dividing them to 3, counting 1/3 and mark, once again and mark, that is all.