Audio Barber Pole by Erick Tejkowsi
11-08-01




This week we'll go on a mind-bending trip into the realm of audio illusions. Using a few simple commands and an interface that you can build in minutes, we'll look at, er listen to, an unusual audio phenomenon, made famous by Roger Shepard.

Background

The renowned scientist, Roger Shepard, figured out a neat audio trick that involves a sequence of musical tones. When played in succession, these notes seem to forever increase in pitch, though they aren't really doing so. Some have termed it an "audio barber pole". Whatever you call it, it's pretty weird (and I know how much ResEx readers like weird). So, this week we'll put together a simple project that demonstrates this nifty trick.

Build the Interface

Launch REALbasic and open the default window: Window1. Add the following controls to the window:

Arrange the interface however you wish, but it might look like this:

11-08_interface.jpg (9k)

Add the Code

With our interface built, double click the Window Editor to open the Code Editor. Select Edit-New Property and create two new properties:

11-08_properties.jpg (4485bytes)

Next navigate to the Action event of PushButton1 and enter the following code:

11-08_pushbutton1.jpg (9k)

Then, navigate to the Action event of PushButton2 and enter this code:

11-08_pushbutton2.jpg (20k)

To the Action event of Timer1 add this bit of source code:

11-08_timer1.jpg (28k)

Finally, type this code into the Action event of Timer2:

11-08_timer2.jpg (15k)

Conclusion

When you're done, select Debug-Run to hear the mysterious rising tones. If you'd like to download this week's example instead of typing it in, you can download the completed project. See you next week!