Stopping a Web Audio oscillator at cycle completion (or zero-crossing)

When calling osc.stop(), a running oscillator is stopped immediately, which can result in a nasty click. This is because the oscillator is stopped right in the middle of a cycle.

Here’s a nice tutorial on how to get rid of the click, using automation curves for smooth gain fade-outs:

But there’s another way: When stopping the oscillator, we could just wait for cycle completion before actually stopping it.

Continue reading “Stopping a Web Audio oscillator at cycle completion (or zero-crossing)”

A piano sustain pedal to MIDI USB adapter

I like my MIDI USB keyboard. But unfortunately, it does not have a sustain pedal jack. That is why I built an adapter, which translates the pedal input into MIDI messages.

All it took was an Arduino Leonardo (Pro Micro module with ATmega32U4), a breadboard, a 7-segment LED display, two resistors, 2 toothsticks, a 6,3mm mono jack socket and some jumper wires. The LED display with its two resistors are optional, of course.

Arduino Code

#include "MIDIUSB.h"

bool isPedalPressed = false;
int pedalPin = 3;

void setup() {
	pinMode(pedalPin, INPUT);

	// turn on pullup resistor as described in
	digitalWrite(pedalPin, HIGH);

void loop() {
	//Pedal pin is by default HIGH, because of pullup resistor
	//When pedal is pushed down, pin should be connected with GND, so that it gets LOW

    if ((digitalRead(pedalPin) == LOW) && (isPedalPressed == false)){

        //channel 1, CC 64 (Sustain), Value 127
        controlChange(0x00, 0x40, 0x7F);
        isPedalPressed = true;
        ledDisplayOne();  //optional

    if ((digitalRead(pedalPin) == HIGH) && (isPedalPressed == true)){
        //channel 1, CC 63 (Sustain), Value 0
        controlChange(0x00, 0x40, 0x00);
        isPedalPressed = false;
        digitalWrite(LED_BUILTIN, LOW); 
        ledDisplayZero();  //optional


// First parameter is the event type (0x0B = control change).
// Second parameter is the event type, combined with the channel.
// Third parameter is the control number number (0-119).
// Fourth parameter is the control value (0-127).
void controlChange(byte channel, byte control, byte value) {
	midiEventPacket_t event = {0x0B, 0xB0 | channel, control, value};

Martina Gödel, Johannes Schmidt, Sebastian Zimmer – Niklas Luhmanns Zettelkasten: ein “preadaptive advance” digitaler Datenbanken?

On September 26, the Luhmann team and me will be talking at Basis Zwei in Hannover about the challenges of creating the Niklas Luhmann Archive.

Please find more details here:

Two Service Worker & Push Notification GOTCHAs

I have spent my day diving into Service Workers and Push Notifications since I wanted my webapp STQ (a German Star Trek trivia quiz app) to send out push messages to users. This has probably been the most wanted feature ever since.

Addy Osmani’s guide on PWAs and this codelab by Sam Dutton on implementing push notifications are a great start. But since the technology is still cutting edge, there were a two gotchas along my way, which I want to share.

Continue reading “Two Service Worker & Push Notification GOTCHAs”

Der Ton beim Tatort ist NICHT schlecht! Er ist zu gut!

Im Netz mehren sich die Beschwerden bezüglich einer vermeintlich schlechten Tonqualität beim Tatort:

Nun fordert Prof. Ingo Kock, Dekan der Fakultät Ton an der Filmuniversität Potsdam-Babelsberg gar, dass 70-Jährige den Tatort-Ton abmischen. Das kann nicht die Lösung sein! Zumal es Kollateralschäden geben würde.

Continue reading “Der Ton beim Tatort ist NICHT schlecht! Er ist zu gut!”

Uni Köln Campus with VR View

Boris Smus and Google have released another great little helper for putting VR content on the web: VR View.

VR Views allow you to embed 360 degree VR media into websites on desktop and mobile, and native apps on Android and iOS.


I tried it out today during a coffee break. I captured a “photosphere” of Cologne’s university campus with the Cardboard Camera App on a Samsung Galaxy S7. This is due to the fact that Germans apparently do not have access to the default Google Camera in the Play Store.

Continue reading “Uni Köln Campus with VR View”

Interview with Paul Adenot, Web Audio Spec Editor

If you are anything like me, you are curious about the current state and the future of Web Audio. So I asked one of the Web Audio API spec editors, Mozilla’s Paul Adenot, if I could shoot some questions. He said sure, and was so kind to take some time and answer them elaborately. Here are his answers, stuffed with lots of useful information. Continue reading “Interview with Paul Adenot, Web Audio Spec Editor”

Should your web audio app have a limiter?

Did you come across digital clipping in web audio apps? I certainly did several times (mostly in my own apps though). This undesired effect occurs when you play several sound sources at the same time, which results in a signal that is louder than the maximum of 0 dBFS. Since a digital system is unable to reproduce higher amplitudes, you will hear nasty distortion and get an unworthy waveform looking like this:

Continue reading “Should your web audio app have a limiter?”


I just wanted to mention that I did this thing called Beatsketch last year. It lets you make music on the web without having to know much about making music.

BeatSketch from Sebastian Zimmer is a collaborative music production tool that Sebastian developed for his Master’s degree in Computer Science. A song consists of multiple tracks, and each track is backed by a grid-based sequencer. Any changes you make are synchronised between connected collaborators immediately. It also supports mixing the final song down to a WAV file for downloading. An impressive set of features and a very useful exploration of possible methods of implementing collaborative working.

Chris Lowis on Web Audio Weekly #43

Continue reading “Beatsketch”