from Hacker News

Show HN: A singing synthesizer for the browser with automatic 3-part harmony

by zebproj on 12/26/24, 5:14 AM with 34 comments

  • by _nivlac_ on 12/26/24, 6:54 AM

    I've also enjoyed Google's blob opera, for something similar!

    https://artsandculture.google.com/experiment/blob-opera/AAHW...

  • by zebproj on 12/26/24, 7:10 PM

    Thanks everyone for the suggestions and kind words.

    Some details:

    The source code for this project can be found on github [0].

    I am using an AudioWorklet node with custom DSP using Rust/WebAssembly. Graphics are just done with the Canvas API. The voice leading is done algorithmically using a state machine with some heuristics.

    The underlying DSP algorithm is a physical model of the human voice, similar to the model you'd find in Pink Trombone [1], but with some added improvements. The DSP code for that is a small crate [2] I've been working on just for singing synthesizers based on previous work I've done.

    0: https://github.com/paulBatchelor/trio

    1: https://dood.al/pinktrombone/

    2: https://github.com/PaulBatchelor/voxbox

  • by butz on 12/26/24, 11:10 AM

    Add "display:block;" to canvas to fix the issue with vertical scroll appearing. Also, you might want to consider looking into vh and vw units to fill canvas to viewport without using javascript.
  • by hunter2_ on 12/26/24, 6:19 PM

    95% of the time, I can only get 1 voice at a time. 5% of the time, I can get 2 or 3 voices at a time (1 variable pitch, the others fixed pitch) but I have no idea what input causes this rare behavior. Can you add some help text explaining what various input sequences will achieve?

    Android Chrome with touch input (Pixel 8 Pro).

  • by smusamashah on 12/26/24, 2:42 PM

    This is awesome fun. Reminds of Google Blog Opera and Pink Trombone.

    Can we have multiple voices when using multiple fingers please?

    Edit: I can't sing or play music but this is making me feel like I am making someone sing nicely, it's relatively lot easy to play with.

  • by kitshunt on 12/26/24, 1:00 PM

    Source code is here: https://github.com/PaulBatchelor/Trio

    It's written in JavaScript and Rust (compiled to WASM).

  • by brunorsini on 12/26/24, 8:23 AM

    Fun! I'd love the option to increase (double?) range. It would sacrifice precision somewhat, so a toggle would be ideal.

    A toggle for quickly visualizing notes would also be useful, as well as keyboard shortcuts — perhaps while one clicks the mouse on a given note, pressing the keyboard shortcut for another specific note gradually moves pitch in that direction, with programmable speed.

  • by zellyn on 12/27/24, 2:08 AM

    This is so fun. One note: on iOS Safari on my iPhone, it really believes I’m trying to select everything, do drag and drop, etc. I’m sure someone here knows the proper CSS incantation.
  • by ldenoue on 12/26/24, 6:53 AM

    This thing is amazing can you add recording?

    Perhaps some samples you or visitors create?

    Then add a little sampler for beat and it’s a fantastic tool

  • by vunderba on 12/26/24, 5:49 PM

    Very neat. Side note, but one of the more fun aspects of Garageband on the iPad is that you can load string instruments such as an Erhu and play it by physically sliding your finger along the string in a very similar way.
  • by fhackenberger on 12/26/24, 10:58 AM

    This is such a great way to practice! Thank you for creating it! Could you perhaps add pitch indicators on the side and multi touch support? Or maybe it's open source?
  • by ycombiredd on 12/26/24, 10:19 AM

    in Chrome, on my iphone, I can get a cool effect that looks like a glitch, but I wonder if it is a feature. If I hold a note a certain way, where the browser does a “select all”, and then drag my thumb, it drags a thumbnail of the page. When I release it, it keeps the first note and starts a new one using the new position of my thumb. I can create my own harmonies this way instead of the default parts that appear when I hold the note in place.
  • by joshuaheard on 12/27/24, 6:38 AM

    This is awesome! It would be great if you could record a snippet then layer your recordings.
  • by MarkusWandel on 12/26/24, 11:39 AM

    Does anyone make a USB Midi Theremin? That would totally be the right front end for this one!
  • by varunneal on 12/26/24, 9:49 AM

    so beautiful. I can imagine using this a lot if some buttons are added (start/stop harmony, view note/resonance, etc). great job
  • by makapuf on 12/26/24, 5:53 PM

    I'm sorry but I can see a small keyboard with selected notes, can some one describe what makes it 3 parts harmony ? Is it a song thing ? Some chord thing ? There is no description on the site or the github repo.
  • by blaufast on 12/26/24, 7:43 AM

    Neat!