Better HN
topnewbestaskshowjobs
Log inSign up

trypwire

114 karma · joined Dec 12, 2012 (13y ago) · 48 submissions

Submissions

comment 5y ago · link · parent

Thanks, fixed :)

comment 5y ago · link · parent

I'd say there are two primary differences between this and any current web audio implementation that I'm aware of:

First is the model/API for actually writing your app. Web Audio is very imperative and, in my experience, doesn't handle dynamic behavior terribly well. Elementary is designed both for functional/declarative expression and for change over time.

The second piece is that Elementary is built around a core runtime which can be embedded anywhere. Web Audio is, as its name might suggest, quite coupled to the browser environment. My goal is that if you've written an audio app that runs at the command line with Elementary, you could package that same thing up and ship it as a VST plugin, on embedded linux hardware, etc.

comment 5y ago · link · parent

Thank you!

As shown in the introduction video, with the `core.on('midi')` callback, MIDI voice triggering is not sample accurate. It's quite hard to invoke arbitrary user code in js and still hit a sample accurate deadline!

That said, the embedded runtime itself supports sample accurate interaction in this way if you're willing to get into a bit of C++.

Currently, building a VST plugin requires just about as much C++ glue as it takes to write the interface. The next step for Elementary though is a solution which addresses that bit too. My goal in the near term is a platform to write VSTs with no C++ at all.

I agree very much with your last comment there, and that is a major impetus for building this tool. I'd love to see what kind of plugins come out when it's that much quicker and easier!

comment 5y ago · link · parent

Why do you say that? I've built the core of the engine entirely from scratch, entirely indepenent of juce. The CLI tool does use juce for opening the audio device, but that's about it.

comment 5y ago · link · parent

Funny you should say that :) I'm currently building a small drum synth, will share it as soon as its ready.

In the mean time, check out https://github.com/nick-thompson/elementary for some examples that you can `npm install && npm start` to hear

comment 5y ago · link · parent

OP here– good point, that's not well explained in the article! And thanks to the others who have answered already, you're pretty much spot on.

The core library, referenced here as `el`, contains a set of factory functions for describing various underlying processing nodes. So when you write `el.lowshelf()` you're just using one of the builtins (like how you might use a div, span, or button in a web app with React)

37.

Functional, declarative audio applications(nickwritesablog.com ↗)

83 points · by trypwire · 5y ago · 34 comments

38.

Elementary Audio: Write Native Audio Apps in JavaScript(elementary.audio ↗)

5 points · by trypwire · 5y ago · 1 comment

comment 5y ago · link · parent

Awesome discussion in here, I'm happy to see it!

I thought I might throw my hat in the ring of shameless self promotion since you might be interested:

I'm working on a project called Elementary Audio, which is a brand new javascript runtime and framework for writing native audio applications– meaning desktop apps, like perhaps the mini-synth you're hoping to make, as well as audio plugins (VST, AU, AAX, etc) and even embedded hardware, all in JavaScript.

The project is still in an early stage (and macOS only right now). I'm planning to share it more widely here on HN once it's ready for beta, but I thought this thread might be interested in it before then.

Website: https://www.elementary.audio/

And here's an example MIDI Synth: https://github.com/nick-thompson/elementary/blob/master/exam...

You could even spin up an Electron frontend to take input from your computer keyboard and send those over to Elementary to render the synth sounds. It's actually an example project I was considering doing myself but you might beat me to it at this point!

Lastly, I'll say briefly that there are a lot of tools out there (as we're seeing in these comments), different things work for different people, and there's no single "right" way to start audio programming– find the path that makes it fun for you, because it's such an awesome field to get into.

comment 9y ago · link · parent

Yea there's a link to the github with a brief blurb about open source on that page. I'm not planning on supporting Csound or LADSPA at this time, but I'm definitely open to pull requests!

41.

Show HN: My open source audio distortion plugin. (VST, VST3, AU)(creativeintent.co ↗)

5 points · by trypwire · 9y ago · 2 comments

42.

The State of Concurrent JavaScript(nickwritesablog.com ↗)

2 points · by trypwire · 11y ago · discuss

43.

Ask HN: Writing a website for my parents' business. Tooling suggestions?

1 points · by trypwire · 12y ago · discuss

comment 12y ago · link · parent

Definitely, and I think your concerns are valid, but if you found that loading each file on demand yielded the optimal performance for your app, wouldn't you go with it? Additionally, I think the method the author is presenting can be very well suited to both partial bundles and individual files. For what it's worth, you and I are in similar positions and it sounds like we have very similar approaches with our own apps. As long as readers understand that this is one possible solution to a nontrivial problem, I'm happy with it.

comment 12y ago · link · parent

It's important to understand that there are tradeoffs with lazy loading. There's a spectrum, right?

On one end, you could serve all of your js bundled with browserify on the first page load, which, for SPA's will frequently block rendering until the entire bundle is downloaded, parsed, and executed. If your bundle is small, who cares? Once your app grows to a large enough size, that initial delay might no longer be worth it.

On the other end, you could serve almost no assets with the initial page load, and request what you need when you need it. Your initial render will be blazingly fast but any first interaction might be slowed by the latency involved in going to get the relevant assets needed to execute the interaction.

Somewhere in the middle you may find a solution involving sending half of your assets initially and requesting the other half when you need them.

It's not helpful to write off various methods of asset loading because of assumptions about latency, bundle size, or DOMContentLoaded event delay. The important part of this article is that it speaks to the various approaches to this problem. I'm guessing the author took the time to weigh the pros and cons of these approaches, chose this one which particularly works for him, and wrote about it to share his findings.

This isn't a trivial problem with one solution. Dig into the performance of your apps while wearing multiple hats and take what works best for your situation ;)

46.

Ask HN: How early is too early to apply to a startup?

1 points · by trypwire · 13y ago · discuss

47.

Web Audio API user? You don't need that ScriptProcessor(ncthompson.com ↗)

1 points · by trypwire · 13y ago · discuss

48.

Show HN: Flow, a WebRTC/Web Audio HTML5 experiment.(trypwire.flow.jit.su ↗)

6 points · by trypwire · 13y ago · discuss

12