Getting Started With The Web MIDI API
Getting Started With The Web MIDI API
A typical MIDI setup might consist of a digital piano keyboard which can send messages relaying information such as pitch, velocity (how loudly or softly a note is played), vibrato, volume, panning, modulation, and more to a sound synthesizer which converts that into audible sound. The keyboard could also send its signals to desktop music scoring software or a digital audio workstation (DAW) which could then convert the signals into written notation, save them as a sound file, and more.
MIDI is a fairly versatile protocol, too. In addition to playing and recording music, it has become a standard protocol in stage and theater applications, as well, where it is often used to relay cue information or control lighting equipment.
... read the whole story at www.smashingmagazine.com.Learning Elm From A Drum Sequencer (Part 1)
Learning Elm From A Drum Sequencer (Part 1)
Throughout this article, I’ll link to the work-in-progress Ellie versions, though I developed the sequencer locally. And while CSS can be written entirely in Elm, I’ve written this project in PostCSS. This requires a little bit of configuration to the Elm Reactor for local development in order to have styles loaded. For the sake of brevity, I won’t touch on styles in this article, but the Ellie links include all minified CSS styles.
Elm is a self-contained ecosystem that includes:
- Elm Make
For compiling your Elm code. While Webpack is still popular for productionizing Elm projects alongside other assets, it's not required. In this project, I've opted to exclude Webpack, and rely on
Mixing Generators Into Iterators
Mixing Generators Into Iterators
Let’s do a quick recap of generators (read our primer on generators here). Generator functions return generator objects when invoked. A generator object has a next
method, which returns the next element in the sequence. The next
method returns objects with a { value, done }
shape.
The following example shows an infinite fibonacci number generator. We then instantiate a generator object and read the first eight values in the sequence.
function* fibonacci() { let previous = 0 let current = 1 while (true) { yield current const next = current + previous previous = current current = next } } const g = fibonacci()
... read the whole story at ponyfoo.com.