Close
0%
0%

Tweacman: a sample scrubber & WAV audio player

A pocket-sized digital reel-to-reel with exquisite tape-like control of sound over time

Similar projects worth following
57 views
0 followers
TWEACMAN is a pocket homage to my first Teac and my first Walkman. It's a music player-wither. Playback any part of any song at any speed, any pitch, any direction, with effects, or scrub it manually with your finger. It uses a nifty new kind of analog rotary encoder that translates subtle finger movements into digital sound on a budget.

The RV112-FF
The RV112-FF

Lately I'm really enamored of these RV112-FF dual 360-degree potentiometers from Taiwan Alpha. Really they are analog rotary encoders; they give a really precise and subtle finger interface to digital instruments. Most rotary encoders this precise cost a lot more and are big complicated weird components. These look just like normal pots, and they almost are. Each unit has two separate potentiometers arranged 90 degrees apart. By combining A/D readings from those two pots with a bit of trigonometry, you can calculate the absolute angle of the shaft around a complete rotation. (If you hate trig, don't worry; my AI intern Claude has just written a nice Arduino library for reading the RV112-FF.) Just like a standard rotary encoder -- but unlike a standard potentiometer -- you can spin the RV112-FF around and around forever. No matter where you twist it, the reading is reported as an absolute floating-point angle from 0 to 360 degrees.

To show off these nifty knobs I made TWEACMAN, a two knob pocket-sized sample scrubbing toy. Like an old-school reel-to-reel tape deck TWEACMAN plays WAV files from a SD card at speeds from 0.001x to 1000x, forward or backward, or you can twist a knob to scrub your recording back and forth across a virtual play head. There's a few other audio tricks available as well, and a handy Bluetooth interface you can use from your phone.

I built this project around SparkFun's ThingPlus RA6M5 board, which features a Renesas RA6M5 MCU. In 2026 we've got a crazy number of options for miniature ARM-based dev boards! The Think Plus RA6M5 has a handy feature set for the kinds of musical toys I like to make. 

  • The board exposes six of the RA6M5's 12-bit A/D converters, with which I can read up to three RV112-FF knobs. (An ESP32 can only read one RV112-FF with its two A/D channels.) 
  • The RA6M5 also has two 12-bit D/A converters with their own integrated output amplifiers; together they make a respectable medium-fi stereo audio output. 
  • It's also got an onboard capacitive touch controller, with two touch pins exposed on this board so I can give my circuit board two buttons without extra parts. 
  • There's a FPU so I can do all my audio work in floating-point with no performance penalty. 
  • And there's another Renesas chip on this Thing Plus board, a DA14531MOD, with which I can serve up a more sophisticated wireless interface. 
  • The board also includes a complete battery management system so my device can be powered by a single 3.7v LiPo cell, rechargable by a standard USB cable.
The complete circuit

Renesas provides a complete development kit for the RA6M5, but I often prefer the Arduino environment for my MCU projects because of its vast set of open-source libraries and its great online community. SparkFun provides a port of the official Arduino Renesas core that adds support for this particular board. All my code from this project is open-source and Arduino-compatible.

But the truth is, I can't really call this "my" code because my AI intern Claude did all the heavy lifting. I mainly wrote specs, reviewed Claude's work, made the major decisions and did QA. Working this way is a profound change from how I've developed technology for most of my life. It's both humbling and empowering. Claude and I are doing work in days that used to take me months to complete by myself. It's a rush! 

  • 1 × Thing Plus RA6 SparkFun mini development board hosting the Renesas RA6M5 MCU and DA14531MOD BLE transciever
  • 2 × Taiwan Alpha RV112FF Lovely hi-res analog rotary controller in the form of a dual 360-degree potentiometer

  • Hello Knobs!

    Mykle • 6 hours ago • 0 comments

    For starts, we wrote the RV112FF decoding library for Arduino and an AudioKnobsDemo to test it. In that demo the two knobs on our breadboard sweep two audio oscillators across the audible range. When they get close together you can hear a beat frequency between them. 

    ATTENTION: when you install and run this sketch (and plug in some speakers) you will have to crank the knobs a few times before you hear anything at all on the audio jack. That's because the sketch first needs to calibrate them. These low-cost pots have some manufacturing variations and aren't always perfectly as described in the datasheet. They might have a slightly shorter range than all the way from 0 to 10k ohms, and the two tracks might not be perfectly 90 degrees apart, and you might have other circuitry between the pots and your pins that alters the range. So before the library can give an accurate reading on a RV112FF it needs to measure the maximum, minimum and true offset angle. We can measure all that in two turns of the knob, and calibrate around it. 

    KnobsDemo.ino gives an example how to manage this in your sketch. Until the knobs are calibrated their angle will read -1, but don't test for that. Instead call isCalibrated(), and ignore the results of read() until isCalibrated() returns true. Once a knob is calibrated it will stay that way until power-off. (The smart thing will be to save that calibration info to non-volatile RAM and load it at startup; we'll get to that soon.)

    This sketch doesn't just make audio waves -- it can also make squiggles on your screen! If you turn on the Arduino Serial Plotter you'll see it plot a bunch of signals. For each pot (knob1 & knob2) we plot the raw A/D value for both wipers, the calculated angle in degrees, and the calculated pitch. Eight values in all. Above you can see a plot of all of them at once. It's kind of pretty, but hard to read. The next plot is simpler:

    This is a plot of just the two wiper readings in knob 1 (blue and red), showing some details of these signals as I turn the knob slowly by hand right after a reboot. You can see that the two pots' readings are 90 degrees apart, and each pot sweeps a value from 0% to 100% and back. (Inside the pot, on each track the supply current is fed to the center of the track and grounded at both ends, unlike a standard pot which feeds current at one end of the track and grounds the other end.) Notice how the sketch starts to report the angle measurement (pink) once isCalibrated() returns true, which happens after the shaft has turned a bit less than two full rotations. That's one complete turn to find the maximum values, and a second time around just to be sure.

    Our RV112FF library reports the absolute position of these rotary encoders as an angle from 0 to 360 degrees. Sweep past 360 and you're back to 0. But sometimes we might want more degrees than that! Our MultiTurnKnob library built on top of RV112FF lets us count how many degrees the rotor has spun since the count was reset, similar to how Arduino's PJRC Rotary Encoder Library counts turns of a rotary encoder. The accumulated angle is a signed float, where negative values are counter-clockwise. With this, we can map our accumulated angle onto any other parameter. For instance, we can map four complete twists of the knob (pink, above) to an oscillator sweep up and down the audible frequency range (blue).

    (The slight wiggly-ness in this plot is due to slight wiggly-ness in my fingers; it's not due to noise or the components.)

    RA6M5 TRICK: The RA6M5 datasheet reveals that there are two output amplifiers on its D/A pins. These reinforce the low-impedance analog signals from the D/A pins, making the output louder and cleaner when pugged into a line-level audio input. We packaged this trick in our RA6M5AnalogTuning library. See the sketch for how to activate those amps on this MCU. 

    (Please know that this signal probably can't drive your nice headphones;...

    Read more »

  • Initial setup

    Mykle • 3 days ago • 0 comments

    My development setup: my M1 Mac Mini running MacOS 26 with the command line developer tools installed. I installed Claude Code and the latest Arduino release (2.3.10), then asked Claude to install SparkFun's Arduino core for the Thing Plus. That two-step process is explained here: first get the official core for the Portenta through the board manager, then download the RA6M5 package from Sparkfun and move it into place.

    I also gathered all the datasheets into a directory where Claude and I could read them: That includes the RV112-FF pots, the RA6M5 MCU datasheet and user manual, the bluetooth chip, and Renesas' capacitive touch design guide. Because I don't really like to use the Arduino GUI I had Claude set up a Makefile-based command line build system for me that uses arduino-cli under the hood to compile and upload firmware. We still used the app for its built-in Serial Monitor and Serial Plotter.

    Here's how I plugged it together on the breadboard: 

    Eech, what a salad. The four A/D pins are wired to the wipers of two RV112-FF dual pots, the two D/A pins to a STX-3120-3B audio jack, and the two touchsense pins into two thrown-together touch probes made from scraps of header and perfboard.  (Before I made those I used slices of carrot as touch sensors; they worked perfectly on the first day, but they slowly dried up and stopped working at all by day 4.) 

    I had to pry the bottom +- power rail off of my breadboard to be able plug these pots in, because they have little PCB-clutching toes on them which don't want to be added to the circut and don't line up with the breadboard holes anyway. With that rail out of the way they hang over the bottom edge of the board as shown. One could maybe bend their toes back with a needlenose plier instead, and then return them to position at build time, if one needed to plug them into the breadboard at some other position.

    What else? There's a power switch to ground the EN pin, which shuts down the board (mostly). There's power and ground to the tracks of the pots, and some 100nF caps between the pot wipers and ground, optional but recommended, which filter out high-frequency noise to get more precise readings. There's also an unused second power switch and a bunch of excess spaghetti I should have maybe cleaned up before the photo shoot. Below is a much clearer diagram you can follow to set up the same circuit on your own breadboard:

    With all of this hooked up and installed, we were ready to plug in the USB cable and say Hello World ...

View all 2 project logs

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates