- Exploring generative art using glsl shaders
bmatcuk / elm-webaudio Goto Github PK
View Code? Open in Web Editor NEWElm library for accessing the Web Audio API
License: BSD 3-Clause "New" or "Revised" License
Elm library for accessing the Web Audio API
License: BSD 3-Clause "New" or "Revised" License
Hey @bmatcuk,
Eariler this summer I tried implementing this gist using elm-usermedia and elm-webaudio, but I was stumped by runtime errors I couldn't figure out. It's just a loop that analyses microphone input, picks out the loudest frequency at a given moment, and plays back an oscillator node of that frequency e.g you can control the oscillator (or potentially any synthetic sound) with your voice or whistle.
The errors seemed to relate quite deeply to Elm itself, and none of the libraries used. (Though I'll have to come back to this.) Nevertheless, using elm-webaudio felt a bit alien in Elm, i.e. not very functional nor reactive. It's true that the WebAudio API is neither of these things, and is indeed inherently mutable and everything not-Elm, but I'm hoping we could improve our interface with it. For my next attempt, I think I would access the WebAudio API through interop with javascript, to see how that feels, which is a nice way of saying I didn't particularly enjoy working with this library in Elm. (Please excuse my frankness -- it's a great effort! And I hope to build on it, but I also believe we could improve.)
I came across this gist on the mailing lists, and it struck me as a potentially better way to model the WebAudio API in Elm. I'm not sure if you've already considered or seen this approach, I'd be interested to hear any thoughts and if you're open to a discussion on how the design of elm-webaudio should be?
Recently, tasks have been replaced by effects and I haven't been able to stay up-to-date on everything, but I'm guessing they could be used to improve on the gist above.
Come on, it'll be so convenient to include!
Hey, I'd like to implement what's necessary for playing with live microphone input.
I've got something basic working for getting user media (see elm-usermedia), now I'm having some problems implementing MediaStreamAudioSourceNode
.
I've made my "progress" available at 04e487c, and aedb5f9 illustrates what I'm expecting. Currently I'm getting function arity errors that I haven't figured out. Grateful for any help and input.
I'm interested in a general discussion, I started working on elm-usermedia with the goal to play well with elm-webaudio. How were you thinking to originally implement this?
I did a quick port to elm 0.16.0 at least enough for the scales.elm example to work.
I'm sure there's still more work to be done:
https://github.com/trotha01/elm-webaudio
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.