Pages: [1]   Go Down
Author Topic: I made a theremin. Kinda.  (Read 939 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello.

I used an Ultrasonic Ping))) Sensor coupled with a speaker and some Arduino magic to make what I think might be referred to as a sonically digital theremin. Here's a video of it in action (https://www.youtube.com/watch?v=wF1uo4gXYqU) and the code is in the description of that video. I'm not entirely happy, however, with the sound quality coming from it. I think some of it is coming from the fluctuations in the reported distance from the sensor, do to a poor accuracy, and some of it from the fact that I'm using the speaker from an old rotary telephone handset with no amplifier. You'll notice in the code that the length of each tone is 10ms, which I take it is rather large. The problem is, as it gets smaller, the audio gets even worse, such that I've found 10ms to be the best for now.

I guess what I'm trying to ask, is what can I do to get this closer to sounding like a true theremin? Would replacing the ping))) sensor with a 10cm-80cm IR sensor improve it? The range seems to fit the job better than the ~43cm ping sensor.

Thanks a bunch.
Logged

Offline Offline
Faraday Member
**
Karma: 61
Posts: 2898
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I would think about your algorithm for making the output sound before you change the sensor.   I watched your nice video and it doesn't seem like the sensor is the real problem.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cool, thanks! Have you looked over the code? What exactly should I do to the algorithm to improve it? Where is it failing?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Ultrasonic Ping))) Sensor length distance fluctuations and pitch reports no problem, you may need to adjust the scope of IR sensor under. . . Non-professionals
Logged

Offline Offline
Faraday Member
**
Karma: 61
Posts: 2898
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well,  you are generating your tone for 1 millisecond,   and then stopping it.

And the going and reading the sensor again.  How long does that take ?

Your could try leaving the tone running ( instead of stopping it ),   and go and get the next ultrasound reading,    and then stop the tone  immediately before you start the new tone.

That might reduce that slightly annoying vibrato effect that you have there.

If you are getting "noise" in your ultrasound measurment,   you could try smoothing out the frequency you are asking for by averaging successive measurement samples.

You are generating square wave sound.   You could try generating sine wave sound,  or using a filter to reduce the harmonics.

Thats some suggestions of things you can try in a few minutes with software changes without going and changing the hardware ( possibly unnecessarily ).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'd be worried that it would take longer to average the signals, which would make the tone even quieter. Also, how do I generate a sin wave instead of square?
Logged

Pages: [1]   Go Up
Jump to: