synesthesia revisited

Today’s post is a revisit of the synesthesia topic. Earlier I talked about an innovative new means of creating colorized tablature to promote this cross-wiring of the senses in new piano students…


Last weekend (for this installment), I thought it would be interesting to attempt to write a MIDI version of this so that I could create that same sort of feedback using color. Only this time, I would be playing the notes directly on my Yamaha digital keyboard.

Screen Shot 2019-05-04 at 5.20.32 PM


The magic mostly comes from the new feature navigator.requestMIDIAccess() that’s been recently added to Chrome in JavaScript.

USB cable

Of course, this needs a Type A to Type B USB cable to connect the computer with the Yamaha digital keyboard. Mine is a P-45 in case you were wondering. It also requires Yamaha’s USB-MIDI driver (available from their website).


As usual, I’ve provided the source code so that you can also play with this if you’d like. Just verify that you’re on the OG-missing-C8 branch if you’d like the latest. At the moment, the master branch is just the original fork of ScottMorse’s work.



The latest version now renders tablature in realtime as well as indicating the notes on the keyboard. It will do accidentals, rests and chords so far (just in quarter notes).

Screen Shot 2019-05-18 at 7.20.24 PM

john lennon is spinning in his grave

In case you haven’t heard, Paul McCartney is the darling boy of the EU’s Article 13 which hopes to stab out YouTube’s heart with a spork. Since Google owns YouTube, it’s naturally worried about all this. To make matters worse, the EU’s Article 11 link tax is quite possibly aimed at Google itself. The former Beatle has stepped up to urge the European Parliament to…


From the tone and use of ALLCAPS you’d almost think this were the Crusades and they’re all mounted on horses pointed south, defending Christendom.

Let’s not forget though that in a public ranking of all Beatles songs ever made, topping the worst-of-the-Beatles list at #213 is none other than Good Day Sunshine.

From Vulture’s article:

Revolver (1966): Paul McCartney was welcome to write all the happy, upbeat, cheery-cheery songs he wanted. But this one is beyond the pale. It’s blaring, received, and strident. Even by McCartney standards (“Getting Better,” “Hello Goodbye”) the title is inane. It could have been “Yum Food Delicious,” or “Hot Sex Baby,” or any other three random words McCartney took out of his Young Man’s Collection of Positive Synonyms — and note that of these three choices McCartney chose the blandest. McCartney’s piano playing, which graced so many Beatles songs, right up to “A Day in the Life,” is a parody of itself. It’s the worst song in the Beatles’ classic period. And it ruins Revolver, otherwise the most consistent and mind-blowing collection of pop-rock songs ever conceived by man.

John Lennon’s song Imagine was liked much more and for good reason. I think the sentiment resonated more with the average person. But now I’d like to mashup the lyrics a bit in honor of Paul’s recent audacity. Note that I only changed the words in italics below so I’m not far from John’s original sentiment in the last stanza about no possessions (to include even the possession of songs themselves).

Imagine there’s no money
It’s easy if you try
No credit cards before us
Behind us only sky
Imagine all the people living for today

Imagine there’s no currency
It isn’t hard to do
Nothing to buy nor pay for
And no religion too
Imagine all the people living life so free

You may say I’m a dreamer
But I’m not the only one
I hope someday you’ll join us
And the world will be as one

Imagine no possessions
I wonder if you can
No need for greed or hunger
A brotherhood of man
Imagine all the people sharing all the world

I can’t imagine for even a single minute that John Lennon would have begged the European Parliament to protect his song rights from anyone.

Shame on you, Paul McCartney. If you’re mad at YouTube, don’t blindly lash out at the Internet-at-large and encourage the advent of “Lawyer-fest 2019”. You’d have to be daft to support legislation which gives full reign to every vulture of the world to now feed on the average Joe attempting to run a website.

old-fashioned milk bottles meet iot

If you remember from my last post on the subject, I’m into those old-school glass bottles of various sizes. Here’s the typical size and lid type that I’ll be talking about:


The lids seem to come in a variety of colors and are probably made from ABS plastic—they work well and last a while. Everything cleans up nicely and I’ve had quite a few of these in my pantry for the last five years now.


There are times, though, when I wished that it were easier to tell what’s what. I honestly have a variety of things which kind of look the same: masa, ground corn meal, pancake batter, semolina flour, etc. They’re all vaguely yellowish. The same is true for the many flours which I buy.

My usual routine is to put a small Post-It type of note of some kind on the front of the bottle. But sometimes these fall off. I have been known to tape them on.

It would be nice if I had a way of easily identifying the contents of the bottle as well as preserving things like nutritional information or the instructions that you might find on the back of a Cream of Wheat box. I could also record the date of purchase and/or the expiration date but I’m not that fussy.

High-tech version

Today’s creativity involves the idea of self-identifying bottles. I’ve just purchased some tiny RFID tags which I hope to embed inside my own self-made bottle caps. I’ve just spent an hour designing the cap in Autodesk Fusion 360 and it’s now getting a test print to see if it fits. When the tags arrive I’ll carefully measure one and then design an internal cavity to accommodate the tag inside the cap. Given that the tag is completely embedded, it should be waterproof as well and should stand up to being repeatedly washed.


The usual tactic with respect to printing these with an embedded object is to create two jobs out of the part (1st half, 2nd half) and then insert the tag in between the print jobs. My own GetToDahChoppa project would be the way of chopping that. For this project it will be easier to just insert a pause command at the magic moment in the gcode file so that the printer pauses, alerting me to insert the tag and then I’ll manually resume. As long as I don’t include internal supports, this technique should work fine.

I thought I’d create a NodeJS-based server which sits on a Raspberry Pi computer which minimally includes an RFID reader. It would host a database of the RFID numbers and their corresponding information for each bottle in service.

The system should include a mechanism for simply reporting which bottle is being held up to the reader as well as several convenience features to include fetching the nutritional information given a UPC symbol. I’m guessing it would be nice to have something which actually scans UPC symbols but that’s not strictly necessary since it doesn’t take much to just type them in.

I guess I’ll have to type in the instructions or include a photograph of the box’s instructions.

Interface choices

I guess now, I’ll need to determine what kind of interface this will have. I could include a TFT panel. I think this would be the normal way of communicating things back to the user. In this way, you could click tabs on the screen if you wanted more information. I would assume that this would use Kivy as the graphical interface. It’s possible but I’d have to have somewhere near the pantry with power and the correct orientation, distance and lighting for the panel. And it must also work out with respect to the distance of the reader.

At the moment, though, I’m thinking that it might be interesting to push the report information to an Echo Dot that’s in the same room. In theory, you would hold the bottle’s top to the horizontally-mounted reader. There would be a delay of perhaps three seconds and then you’d hear Alexa say “Cream of Wheat”, having initiated an Alexa Skill of some kind. I’m guessing then that I might have to say “Alexa, read the instructions” to have her then read from another topic.

Given the way Amazon’s Lambda functions work, it feels like it will be problematic unless I host the database in the cloud otherwise the function wouldn’t easily have access to that information. I dunno, but I kind of like the idea that the database just lives on the Raspberry Pi itself.

I could use a simpler text-to-speech project from earlier, requiring a speaker on the Raspberry. The sound quality is basically similar to listening to Stephen Hawkins reading your panty list. I’ve also been successful using the Snips home assistant interface for doing something Alexa-like without the cloud. The quality of the output voice isn’t as slick as Alexa but it’s good enough.

Hot off the printer

While I’ve been thinking about all this, the first draft print has finished. It’s very nearly identical to the hand-measured original lid only that inner insert seems to be slightly too wide for the bottle. The PLA plastic I’m using is more rigid or I’ve made that wall too thick; it will need a slight adjustment and another test fit before I advance to the next step. It lacks subtle details that aren’t actually necessary on the original lid like central spokes and outer ribs.


I’ll tweak the design and reprint it. And I guess I have to wait for those RFID tags to arrive in the mail before the next phase of this.

switch-case in python

Python is a great language if you’re coding to IoT (Internet of Things) like small devices. If you’re coming from another language though you might be surprised that it doesn’t include the classic switch-case statement construct like you’d find in JavaScript, for example.

Fortunately, I just managed to create something that seems to work and the syntax isn’t too far off from the expected.

def switch(key, default):
    case = {
        0.0: 'zero-point-zero',
        0.1: 'zero-point-one',
        0.2: 'zero-point-two',
        0.3: 'zero-point-three',
        0.4: 'zero-point-four'
    return case.get(key, default)

print switch(0.1, 'Unknown')
Running this would produce “zero-point-one”. This isn’t as robust as JavaScript’s or C’s implementation but this can be adjusted for lambda functions in a similar fashion.



remember internet radio on itunes?

Years ago on macOS and when iTunes first came out, it included an awesome feature—you could easily stream Internet radio from within the interface in iTunes. Apparently that got in the way of Apple’s revenue on iTunes, always trying to sell you something.


iTunes -> click on the down arrow next to Library -> Ctl+click Songs -> Edit List -> add a checkmark next to Internet Radio


And that’s all it takes to return this sought-after feature to iTunes.

Screen Shot 2019-02-11 at 12.06.24 PM

kivy, the hero of iot gui developers

Kivy – An open-source Python library for rapid development of applications that make use of innovative user interfaces, such as multi-touch apps.

The Internet of Things (IoT) is the likely future of gadgets and devices that you’ll have in your homes and cars (if you don’t already) as well as technology that you wear. As a minimal criteria, these things use the cloud to gather and store information. In a way, even smartphones fall into this category if you think about it. Amazon’s Echo device is a good example.

For many of us who self-identify as “makers”, we use small computers with similar capabilities and we create these type of gadgets. Often when we’re coding software in this space, the Python language is the usual choice for the task.

Until now, we’ve not had many options for displaying graphical menus on such tiny screens other than the full “Desktop” GUI of some Linux-like operating system which didn’t really work, to be honest.

Introducing Kivy

A relatively new technology is the Kivy library. Imagine being able to describe the many screens you’d find in an application, whether it’s a smartphone or the touchscreen of a printer or even a watch. Then Kivy takes care of the rest for you, rendering those screens using a graphics engine behind-the-scenes. It even manages clicks and other gestures, getting these to fire off portions of your code.

Kivy comes equipped with an impressive collection of pre-defined screen widgets as well as the ability to create your own custom types. And you get all this for the low, low price of free (unlike its $5K+/year—priced competitor Qt).

I’ve had the pleasure of working on an almost daily basis with Kivy over the last two months and I must say that I’m still just as fond of it now as the day I originally learned of it.

If you’re a coder and you know Python, I would suggest that you add Kivy to your toolbelt. You’ll find that it’s easy to use and worth the effort you put into it.

metro app is metro

I thought I’d share a couple screenshots of a web app I worked on a couple of months ago. I was cleaning up my computer’s Desktop space today and it made me smile, remembering the work that I’d done then.

I doubt if I’ll continue the project since I’m now working on something new.



The site was to be a code-learning area for kids. The requirements for not using/saving personal data was the reason for the interesting username behavior shown above. Usernames are combinations of adjective-noun and passwords then are combinations of color + icon.

to author or to fork?

I was interested in exercising Github’s REST API so I burned out a quick-and-dirty applic-ation to display some statistics.

Screen Shot 2019-01-02 at 1.53.46 PM

Honestly, a tool like this would be useful for a hiring manager in the software develop-ment space. Imagine being able to enter a list of ten accounts and to see a side-by-side comparison of the coders like this.

Puffed-up Like a Cheeto

I’m surprised at the number of Github accounts which are mostly filled with dead forks of someone else’s code with no contributions whatsoever. I don’t know if people are trying to pad their profile intentionally or if they just are unclear of the cloning behavior expected of them most of the time.

A good collection of code should include mostly your own authored work. You’re hoping to give something back to the community. From the standpoint of your résumé, you’re hoping to show what kind of work you’re capable of doing.

So What’s Good?

I think I’d suggest that for anyone who’s looking for a new position as a coder, that Authored percentage value should be above 75%. I suppose the theoretical limit of 100% could potentially be the best and yet it would likely indicate that you don’t help out other coders with their repositories.

Rule of Thumb

If you fork a repository, you should do one of two things:

  1. immediately start creating your own new software from it or…
  2. immediately start working to help the original author so as to create a pull request.

This behavior of fork-and-do-nothing just seems patently wrong to me. If you think about it, it’s almost the equivalent of copying someone else’s résumé content into your own.

ms-dos is now open… 36 years too late

I suppose Microsoft is trying to go with this whole… open source thing that the rest of the world embraced a long time ago. They’ve just placed the source code for MS-DOS out into the public domain about three or four decades after it’s useful. Seriously, guys?

It’s probably lost on most people that this code is utterly useless, unless you have access to a time machine, of course. In order to assemble the code you’d need MASM v1.10 which is a very old Microsoft Assembler program indeed. I remember actually owning that about thirty years ago, believe it or not.

Obvious chicanery

Looks like whoever made this available has added a number of poison pills: file-renaming, garbage characters to prevent assembly, the absence of an old (required) assembler, etc. It’s so blatant it would be funny otherwise.


adj. Not straightforward or candid; insincere or calculating