I work as exhibit specialist at a non-profit hands on science and technology museum, and I am thinking of using Sonic Pi in order to refresh the internals of one of our exhibits.
We own a mid-1930s horn speaker radio that has been internally converted to play historically accurate “stations” at the turn of a knob (one of the radio’s original Bakelight knobs). The knob turn-shaft has four electrical contacts, which trigger WAV playback on four respective standalone audio players (BrightSign brand). The existing system is outdated and barely functional - 2 of the 4 audio players have died, and the relays that trigger them are so touchy that it requires an unreasonable effort to “dial in” a station.
My plan is to reuse the existing knob and attach a linear potentiometer to it, which can be read with a Pi Cobbler from Adafruit. This will give me 1024 points of accuracy, as I can write the output from the Pi Cobbler to a text file.
My question concerns the external file I/O capabilities of Sonic Pi. The documentation doesn’t specify whether or not strings, integers, or variables can be read from an external source. Would it be possible to read an integer, between 0 and 1024, from a text file? I could then use it to modulate the amplitude of several live loops, each loading a WAV sample from disk and “listening” for the integral value for its current amplitude at any given time.
Let me know if I need to provide more info. Thank you!