Shop OBEX P1 Docs P2 Docs Learn Events
[BOE Bot?] Theremin: feasibility? — Parallax Forums

[BOE Bot?] Theremin: feasibility?

anticipateanticipate Posts: 10
edited 2013-11-19 09:28 in General Discussion
Hey ladies and gents,

I was thinking it might be fun to make [something kind of like] a theremin with BOE Bot or something similar.

Seems like BOE Bot could run a loop, using the Ping)))Dar to get distance (to a hand, eg) and then outputting a frequency [to a speaker] based on that distance. Seems like you could make a pretty crude (and probably annoying :) instrument similar (sort of) to a Theremin.

What do you guys think? Foresee any pitfalls? Have any suggestions?

What kind of hardware could be used to make something a little more polished?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-11-18 18:50
    'Sounds like a fun project! The major difficulty I see is that the BASIC Stamp is a single-process controller, which means that, while it's waiting for an echo from the Ping))), it cannot simultaneously be producing a tone computed from the previous echo. The result will likely be a buzzing noise superimposed over the desired tones, produced by the regular -- but brief -- interruptions

    A Prop BOE or ActivityBoard, OTOH, would be able to handle both jobs simultaneously and could continuously produce those resonant squeals so cherished by Theremin lovers.

    -Phil
  • Martin_HMartin_H Posts: 4,051
    edited 2013-11-18 19:33
    It is completely doable and is indeed a fun and quick project. The Ping))) can certainly be used to measure the proximity of the hand, but you can also use capacitance to do it. At this point I can't resist a plug for my Propeller chip theremin which uses exactly this technique:

    http://forums.parallax.com/showthread.php/143135-Propeller-Chip-and-555-timer-make-a-Theremin

    I used a 555 timer with an antena so that as your hand approaches it changes the frequency of the 555 timer. I then measure the drift of the 555 from the expected frequency and produce audio tones. It might be possible to do everything from the Propeller because I saw a video over at Nerdkits where they used RC decay to measure hand proximity.
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-11-18 19:42
    An important function in real theremins is the second input.
    The second input controls the amplitude of the first input's frequency.

    In essence, real theremins measure the capacitance of each input.
    Ok, the capacitance is part of the tank circuit in the two oscillators.

    There are other things you can measure two of simultaneously.
    A pair of light sensors come to mind.

    As Phil said a Prop would be much better at doing multiple simultaneous things.

    Duane J
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-11-18 19:43
    Martin you beat me to it.

    Duane J
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2013-11-19 06:47
    Yes, you can use a PING))) sensor for this. But, a simple theremin-like application using the BS2 and a light sensor has been a popular activity for quite some time.

    http://uttermatter.com/bs2/EX_Theremin.php

    The Boe-Bot robot kit used to include CdS photoresistors, which were used at the link above. However, we switched to phototransistors several years ago, due to RoHS restrictions. You can use either one for this application. The photoresistors are still available separately from the Parallax store.
    http://www.parallax.com/product/350-00009

    If you use the phototransistor, you may need to experiment with capacitor sizes, which also might mean increasing the pause time to charge a larger capacitor. Depending on the RCTIME values you get from your phototransistor, you also might need change how you adjust that value before using it in the FREQOUT command for the piezospeaker.

    See "What's a Microcontroller?" Chapter 7, Activity 1 for a little more detail on phototransistors that wasn't included in the Robotics text, and a simple test program you can adapt to the theremin activity. It's a free download here:
    http://www.parallax.com/downloads/whats-microcontroller-text

    For a nice article on scale and offset - in other words, how to adjust the light sensor circuit's RCTIME value to something that sounds pleasant on the piezospeaker - see Chapter 3, Activity 3 of Smart Sensors and Applications. That activity is working with values from an accelerometer, but the method is the same.
    http://www.parallax.com/downloads/smart-sensors-and-applications-text

    Whatever sensor you use, have fun with this experiment and let us know how it turns out!
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2013-11-19 09:28
    As the others have said, the basic concept is doable. As Phil mentions, I'd consider investing the 50 bucks in a Propeller Activity board, and learning a little Spin. IMO, it's an easier language than PBASIC. Certainly not to knock the BS2, but using one in a project like this becomes a lesson in workarounds, rather than exploring the potential of your hardware.

    But just don't call this a theremin. I surmise from your original post you probably know real theremins use heterodyne circuits where the sound you hear is produced by mixing a low input signal with a much higher (far out of hearing) frequency signal. What you hear is the difference in the frequencies. More than just a nuance, this approach gives the theremin its unique flavor. Otherwise it's just a simple oscillator.

    As Duane notes, you really need that second input to vary the amplitude (volume). Otherwise it won't at all sound like a theremin.
Sign In or Register to comment.