Dynamically generating MIDI in JavaScript

Last weekend I open-sourced a small side project consisting of a JavaScript library that generates MIDI in a simple manner. As an example, the code to generate a MIDI file that plays 3 notes (C, E and G) would look like the following: // We pass some notes to |MidiWriter.createNote| to create the MIDI // … Continue reading Dynamically generating MIDI in JavaScript

Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part II)

In this article I build an interpreter for the DBN language from the parsed AST generated by the grammar we defined in the previous article in PEG.js. If you haven't read the first part, I strongly recommend to do so, otherwise this will make little sense to you. It should be quite easy to follow … Continue reading Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part II)

Writing an interpreter for DBN using PEG.js and canvas (Part I)

In this first part of the article, I will define a grammar for DBN (Design By Numbers) and generate a parser for it that outputs an AST (Abstract Syntax Tree), so I can interpret the syntax tree it later on with JavaScript and draw it into an HTML5 Canvas. John Maeda created the DBN language … Continue reading Writing an interpreter for DBN using PEG.js and canvas (Part I)

Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part I)

In this first part of the article, I will define a grammar for DBN (Design By Numbers) and generate a parser for it that outputs an AST (Abstract Syntax Tree), so I can interpret the syntax tree it later on with JavaScript and draw it into an HTML5 Canvas. John Maeda created the DBN language … Continue reading Writing a JavaScript interpreter for DBN using PEG.js and canvas (Part I)

Solitaire Encryption Algorithm implementation in F#

I first read about the Solitaire algorithm in the novel Cryptonomicon, by Neal Stephenson. Being a geeky kid fascinated by computers I thought that it was a brilliant idea, but my curiosity didn’t go so far as to make me write an implementation of it (you can find a perl version in the book, which … Continue reading Solitaire Encryption Algorithm implementation in F#