Skip navigation

Category Archives: Synth

First of all, I may have been neglecting this blog, but I haven’t been neglecting NusachDB, a growing collection of Jewish liturgical tunes. It’s up to almost 1000 tunes, though with all the double-counting (for various reasons that I don’t want to get into right now), it’s probably about 400 or so unique ones. While working on NusachDB, which involves transcribing tunes found on the internet, I came across some, well, awful design. One site has its recordings stored as Flash applets, which is annoying enough, but it doesn’t actually have any controls. You can press play or you can press stop; pressing play starts the recording from the beginning and pressing stop stops it. No pause. No way to rewind. As you can guess, transcribing this is extremely annoying and an enormous waste of time. Well, a bit of digging (by which I mean just looking at the source) shows that these are .swf files, which I can download. Great, that’s a good first step! But how do I retrieve the music inside?

At first I figured it was some sort of bundle, like .app, with various resources (like the music I needed) inside. Finder doesn’t seem to think so. I googled it, to no avail. There are plenty of commercial programs that will do this, some costing $100. $100 for sound conversion? Sounds like a scam. This is a simple enough task that it shouldn’t take a program that costs more than $5 to do, so it smells like someone is trying to make some very cheap money out of this. I might as well try it myself. The Wikipedia page doesn’t have anything useful on the file specification, but maybe I can open it as a text file or something just to see what would happen. Probably nothing interesting, but… wait, I right-click the file to open it in Sublime, but one of the programs listed in the menu is The Unarchiver?

Turns out .swf is an archive format after all. The Unarchiver opens it with no problems. So yeah, don’t be an idiot and buy a program to open a downloaded Flash applet, because it’s simply not necessary and might well be an enormous waste of money.

Secondly, a recent Chrome update broke the Microtonal Synthesizer. Very sad. I got emails about it — at least it still worked in Safari, which is usually a few versions behind Chrome. Well, had some time yesterday to try to debug this; obviously there was a change in the API that broke AudioLib.js, the underlying sound library I use for the synth. (One of these days I’ll make my own, I suppose.) The synth is supposed to use WebAudio, but it was using the PCM fallback, which is terrible in every way. I couldn’t believe that Chrome decided to stop supporting WebAudio, so it must be something else. Unfortunately, it also wasn’t obvious where the code chose the right framework to use. It took a while, but eventually I found the switch — a for loop over the available audio frameworks that enclosed the creation of the audio object in a try block. If object creation failed, it would move on; if it succeeded, it would return the new object. This of course relies on an exception being thrown in case of failure. Not sure if it’s the best design. But it’s interesting that there was no catch block to deal with the exception. So I decided to log it instead, and the culprit was soon discovered: a method of the AudioContext that was renamed because who needs backwards compatibility anyway? It was throwing an exception because the method was undefined, so it was causing the audio object creation to fail and the for loop to go to the next iteration until the PCM fallback succeeded. That’s a simple enough fix — call the correct name of the method — and hey, now the synth works again! Check it out. There’s nothing new there yet, but it still works, so that’s something!

Unlike the overtone series of the previous post, there is nothing physical or natural about the undertone series, despite its very similar construction.  The overtone series consists of notes at frequencies f, 2f, 3f, 4f, and so on; the undertone series, on the other hand, consists of notes at frequencies f, f/2, f/3, f/4, and so on.  The undertone series is the mirror image of the overtone series.  If you start at one particular note and go up for the overtone series, you’d go down by the same amount for the undertone series.  It’s available in the Offtonic Microtonal Synthesizer as Undertone (C8).

Read More »

I’ve added a new scale to the microtonal synthesizer for your enjoyment.  The preset is called Harmonic (C1), and it’s the first 127 notes of the harmonic scale beginning at C1.  I think it’s pretty cool!

Before they invented valves, trumpets were limited to only playing certain notes.  A trumpet in C could maybe get a low C3 out (it sounds kind of terrible), but it could play its first few harmonics fairly easily.  Middle C (C4), G4, C5, E5 (a bit flat), G5, Bb5 (very flat), C6, D6, E6, Ft6 (that’s F half-sharp), G6, Ab6, A6, Bb6, B6, C7, …  Actually, it’s REALLY not easy to play that high, but you’ll notice the notes are closer together as you go up.  What’s going on?

Read More »

The Microtonal Synthesizer has been updated.  I used it to explain to someone how to listen to beats and realized that I couldn’t set the cents of notes.  Turned out I was forgetting some factors of 100 in one of the functions handling the text fields, and “50” was magically changing to “0.05”.  This is now fixed.  (Update: as I was writing this post, I noticed that changing the frequency of a note wasn’t working.  It should be now.)

So I might as well explain how beats work.  Let’s say you have a note at some constant frequency of f.  This means that you have some sort of wave that repeats at a frequency of f; if f = 440 Hz, then the wave repeats 440 times per second.  It’s not a simple sine wave; the shape of the wave is what gives instruments their characteristic sounds.  A sine wave sounds more like an “ooh”, while a brighter sound like “aah” will be a more complex shape.  For now, though, let’s assume we’re talking about simple sine waves.

Read More »