About 20 years ago, I worked as an independent consultant at a major telecom. I wrote a program that did some stuff, and couldn't get it to communicate on the network. Developers there didn't get root on a machine, and there was limited access to tooling, so I reached out to the sysadmin. A day later he came back to me and said, "everything here's good, check with the firewall guy." The firewall…
In a previous experiments, I used spectrograms instead of raw audio as inputs to neural networks, while training them to recognize pitches, intervals, and chords. I found that feeding the networks raw audio data got nowhere. Training was extremely slow, and losses seemed to be bounded at unacceptably high values. After switching to spectrograms, the networks started learning almost immediately --…
An particularly interesting characteristic of Fourier transforms is time-frequency duality. This duality exposes a beautiful deep symmetry between the time and frequency domains of a signal. For example, a sinusoid in the time domain is an impulse in the frequency domain, and vice versa . Here's what a 1-second 20hz sine wave looks like. If you play this on your audio device, you'll hear a 20hz…
While working on Pitchy Ninja and Vexflow , I explored a variety of different techniques for pitch detection that would also work well in a browser. Although, I settled on a relatively well-known algorithm, the exploration took me down an interesting path -- I wondered if you could build neural networks to classify pitches, intervals, and chords in recorded audio. Turns out the answer is yes. To…
For over two decades, I've hosted websites on managed servers. Starting with web hosting providers, going to dedicated machines, then dedicated VMs, then cloud VMs. Maintaining these servers tend to come at a high cognitive cost -- machine and network setup, OS patches, web server configuration, replication and high-availability, TLS and cert management, security... the list goes on. Last year, I…
Lots of developments since the last time I posted about VexFlow. VexFlow is ES6 Thanks to the heroics of SilverWolf90 and AaronMars , and the help from many others, VexFlow's entire src/ tree has been migrated to ES6. This is a huge benefit to the project and to the health of the codebase. Some of the wins are: Real modules, which allows us to extract explicit dependency information and generate…
Lots of commits into the repository lately. Thanks to Cyril Silverman for may of these. Here are some of the highlights: Chord Symbols This includes subscript/superscript support in TextNote and support for common symbols (dim, half-dim, maj7, etc.) Stave Line Arrows This is typically used in instructional material. Slurs Finally, we have slurs. This uses a new VexFlow class called Curve . Slurs…
I spent a little more time experimenting with k-means clustering on images and realized that I could use these clusters to recolor the image in interesting ways. I wrote the function save_recolor to replace pixels from the given clusters ( replacements ) with new ones of equal intensity, as specified by the rgb_factors vector. For example, the following code will convert pixels of the first two…
Cross posted from Google+ . My coworker at Google, Tony Rippy, has for a while been working on a fascinating problem. Take all the pixels of a photograph, and rearrange them so that the final image looks like an artist's palette -- something to which you can take a paintbrush and recreate the original image. He's got some really good looking solutions which he might post if you ask him nicely. :-)…
In my last post, I went over some of the basics of the Web Audio API and showed you how to generate sine waves of various frequencies and amplitudes. We were introduced to some key Web Audio classes , such as AudioContext , AudioNode , and JavaScriptAudioNode . This time, I'm going to go take things a little further and build a realtime spectrum analyzer with Web Audio and HTML5 Canvas. The final…
The Web Audio API is a W3C draft standard interface for building in-browser audio applications. Although the draft is well specified, it is almost impossible to find useful documentation on building applications with it. In my quest to deeper understand HTML5 audio, I spent some time figuring out how the API works, and decided to write up this quick tutorial on doing useful things with it. We will…
Most of my work last week consisted of writing music theory code. VexFlow now has a neat little music theory API, that gives you answers to questions like the following: What note is a minor 3rd above a B? What are the scale tones of a Gb Harmonic Minor? What relation is the C# note to an A Major scale? (Major 3rd) What accidentals should be displayed for the perfect 4th note of a G Major scale?…
Spot the difference: Before After Still can't tell? Let me help you out. We have: Slightly greater spacing between the tablature stave lines. This makes it more consistent in appearance with printed tablature. Stave lines are cleared before fret numbers are rendered, vastly improving readability. Font sizes for fret numbers and annotations are bigger. Associated notation and tablature staves are…
Finally... finally... finally... we have the humble beginnings of what could be considered "documentation". I present to you The VexFlow Tutorial . Although still in its infancy, the tutorial covers everything you need to start using VexFlow in your own code. My plan for the next few weeks is to make this document as comprehensive as possible, and write up a separate API reference. I hope that…
I just discovered the Vim xmledit plugin. With features like tag-completion, auto-wrapping and unwrapping, quick navigation, etc., it has, in a matter of minutes, measurably decreased my level of frustration while editing markup in Vim. Installation The quickest way to install the plugin is by downloading the latest . vba from the plugin site , and run the following commands: $ vim xmledit.vba :so…
It turns out I'm on twitter. I have absolutely no idea what I'm going to do with it. Maybe I'll tweet every time time the compiler yells at me... or when my kernel panics... or when my browser frowns . Whatever it is, I'm on twitter: twitter.com/11111110b That's seven ones and a zero, followed by a bee.
I'm shocked and appalled at the fact that there is no generic regex substitution function in the GHC libraries. All I'm looking for is a simple function equivalent to perl's s/.../.../ expression. After digging around a bit, I found subRegex in regex-compat . While this works well, it does not use PCRE, and as far as I can tell, there's no support for ByteString s. Grrr. Anyhow, I took the…
I've been out of touch for a while, and it took me way too long to set this up; but hey - better late than never. :-) After looking into various options for the VexFlow mailing list, I eventually decided to use Google Groups. It's super easy to setup and manage, and has all the features I'll ever need. If you're interested in hacking, discussing, or simply keeping up with VexFlow, sign up here:…
That's right folks! All the VexFlow code is now available in the VexFlow GitHub Repository . It's distributed under the OSI approved MIT License, so feel free to tinker, tweak, hack, fix, fork, and redistribute it. A lot of the core infrastructure (e.g., contexts, formatting, etc.) is ready and stable, and most of the work that needs to be done is adding support for various types of modifiers,…
I finally got most of the duration and beaming support worked out last weekend, and I gotta say that the generated scores by VexFlow (and VexTab ) are starting to look pretty good. In VexTab notation, you can now set the duration of the subsequent notes using the colon ( : ) character. By default, note durations are set to eighth notes. Here's an example of a line that generates a half-note…
I love tools. Tools keep my projects predictable and smooth. Tools help me code fast and release fast. VexFlow has gone through many iterations of design, implementation, and deployment, and I couldn't have brought it this far so quickly without my tools. (Well, automated testing had a lot to do with it too, but that's for another post.) Yesterday, I added a new tool to my toolbox - SCons . I…
The last few weeks have been relatively quiet on the VexFlow side. I've been vacationing in Cape Cod with my wife and 3-month-old. Obviously, vacation is never fun without a few good coding sprints. I started work on incorporating standard notation into VexTab . The first thing I needed to do was create a class to convert fret-string pairs to notes. In order to support alternate tunings, I created…
I spent some time this week trying to get secure online backups working for all my machines. So far, I've been managing most of my data and workspaces with replicated Git repositories. I have scripts that allow me to maintain roaming profiles across my machines (almost) seamlessly, and these scripts try to ensure that these profiles are consistently replicated. My profiles include things like dot…
So I spent this weekend rewriting the VexTab parser. The original version, though it served its purpose as a quick prototype for the language, was severely limited due to it being built primarily out of regular expressions. The new parser uses a recursive-descent algorithm, and fully supports the original grammar. Adding new syntactic elements to the language is now simple, as is adding support…
I have about 340 tests now for VexFlow, and one of the things I find really impressive is the speed at which browsers currently load, execute, and render web-pages. Since the code exercises the browser on a few different dimensions (heavy JavaScript, lots of DOM manipulation, a few new HTML5 features), I decided to pit the major browsers against each other and run a few benchmarks. Test Suite on…