Mini Museum: Slide Rule

A slide rule, its case, and an instruction manual.
These were the calculators of the early 20th century.

To really appreciate the benefits of the Digital Revolution, it helps to take a look at the state-of-the-art in personal calculating devices in the mid-20th century. Slide rules — very precisely manufactured sliding rulers with markings in various mathematical scales — were how engineering was done, back in the day. (I have reliable reports from the era that engineers would sometimes carry their slide rules in holsters, like we might carry smartphones.)

These are thoroughgoing analog devices. Input and readout are both analog, and the number of significant figures tends to be more a function of both the user’s eyesight and their chutzpah. The input numbers are lined up along various scales, and the result is read on others with the help of the hairline cursor. One SF of precision is easy to get. Two isn’t difficult, even for a novice. Three is doable; four is dubious (without techniques like splitting the problem up). Anyone claiming five or more without a complicated process is probably trolling you.

Slide rules quickly went out of fashion with the advent of the portable digital calculator around the late 1960s/early 1970s. While a skilled slide-rule user could do many more operations than someone with a simple four-function electronic calculator, scientific calculator models with trigonometry, exponents, logarithms, and more meant a quick end to the reign of the slide rule. The technology is still holding on in general aviation with the E6B Flight Computer, but even that’s on the way out. ForeFlight and similar apps are far more capable and intuitive.

Nevertheless, slide rules helped design the machines that built the modern age.

Posted in Lore, Math, Mechanical, Mini Museum, Nostalgia, Tools | Tagged , , , , , , | Leave a comment

Mini Museum: Player Piano Scroll

Player piano “word scroll,” with the words and melody
to “It’s A Sin To Tell A Lie.”

Digital music has actually been around for a while. Player pianos have been around since the turn of the 20th century. A long scroll of paper is mechanically pulled past a series of holes normally under vacuum. When a hole in the paper passes over one of these holes, air is admitted and a note is struck on the piano.

A scroll such as the one shown above can preserve fairly exact timings, allowing for some of the performer’s musical expression to be recorded on the scroll. Ragtime music will still have its characteristic asymmetric rhythm, and Bach will still sound like some great celestial clock.

The technology has been used to run pipe organs and calliopes, as well. Here’s a rendition of “Rasputin,” written by Boney M. The song is decades newer than the instrument, but it sounds great. (There’s footage of the song cards being fed through, starting at 1:44.)

Posted in Digital, Drexel, Mechanical, Mini Museum, Nostalgia | Leave a comment

Mini Museum: Morse Telegraph Relay

Sometimes, you find the coolest things at antique stores. While on vacation last year in Maine, I came across a Morse model 4-C telegraph relay (circa 1900). It looked complete, so I bought it to add to my collection of cool historical tech. Once the contacts were cleaned off and the settings adjusted, it turned out to work quite well.
(Oxidation is an insulator, so vintage “patina” or no, it had to go.)

Here’s a clip of it sending “HELLO, WORLD” in Morse code.

The Morse 4-C relay, sending “HELLO, WORLD”.

To a computer engineer, vintage relays are a fascinating tease of possible alternate timelines. With even as simple a device as this (a pair of electromagnets moving a contactor) you have the basic building elements of a computer, provided a NC contact was added. And there’s even a spare contact screw for one.

With such a device, you can build logic gates. By combining them, you can make flip-flops, which can themselves be combined into memory devices, registers, counters, and all of the other pieces needed for a computer. We could have had computers in the 1800s!

…And not only does it still work, it’s crazy efficient for an electromechanical device! It will strike at about 2.5V (depending on settings), and draws only 25mA at that voltage. If I weren’t running it loose and loud to get that nice clicking sound for demonstrations, it could probably be driven directly by a microcontroller pin (or two of them ganged, worst case.) The whole works, in fact, is powered from a USB port! (The diode across the coil is to snub electrical noise when the coil is depowered.)

It’s kind of surprising to see such efficiency in a device that was already old enough to graduate high school around the time my grandparents were born. It’s a reminder that, although earlier eras didn’t have all of our technological knowledge, they still very much had competent engineers who often came up with amazing solutions, even with limited technology.

It’ll make a great first exhibit for the new Mini Museum of Computing History that I’m making.

Posted in Digital, Mini Museum, Nostalgia | Tagged , , , , | Leave a comment

Constructors in FreeBASIC

FreeBASIC continues to impress me with its modernity. I already found out that it’s possible to implement C-style pointers in FreeBASIC — and it turns out that you can have C++ – style constructor functionality, as well (code that runs automatically when an object is instantiated.)

For our “object,” we’ll use a custom FreeBASIC type :

type node
    x as double
    y as double
    visited as ubyte
    end type

It would be nice if we could assign default properties to these values automatically when they are allocated. Looking through the documentation, it seems provision is made for this:

type node
    x as double = 0
    y as double = 0
    visited as ubyte = 0
    end type

This works, of course. But what if we wanted random values — would that work?

type node
    x as double = rnd*100
    y as double = rnd*100
    visited as ubyte = 0
    end type

It turns out that this works, even when allocating an entire array of the type:

dim as node lotsOfNodes(1000)  'This will allocate the memory AND assign default values!

There was only one question, at this point. How far could we go? Was it possible to call a function and therefore run arbitrary code? Yes!

'Demonstration of "constructor"-type initialization

'Copyleft 2022, M. Eric Carr / Paleotechnologist.Net
'(CC:BY-NC-SA)

const MAXNODES = 20

declare function myFunction(x as double) as double

type node
   x as double = myFunction(100)
   y as double = myFunction(100)
   visited as integer = 0
   end type
   
dim as node f(MAXNODES) 'Nodes are initialized as they are created
dim as integer n

for n=0 to MAXNODES-1
   print f(n).x,f(n).y,f(n).visited 'View the contents to check initialization
   next n

sleep

function myFunction(x as double) as double
   static callCount as ulongint 
   callCount=callCount+1
   return rnd*x
   end function
   

Maybe they’re still not true “objects” — but they pass the duck test (with the possible exception of not having similar destructor functionality.) At any rate, it’s fun to see a language that’s ultimately still a descendant of 1964 Dartmouth BASIC capable of things like running arbitrary code implicitly on object creation.

…I wonder if it’s thread-safe?

Posted in BASIC, Coding | Leave a comment