Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Web Audio API, OMG
Message
From
01/02/2014 10:43:44
 
 
To
01/02/2014 08:34:01
General information
Forum:
Javascript
Category:
Other
Miscellaneous
Thread ID:
01592796
Message ID:
01592841
Views:
43
>>>I sorta came around to javascript when I heard webkit supported something called the Web Audio API.
>>>
>>>It's now available in the last version of FireFox (as of Oct I think) so that means Chrome, FireFox, and Safari all support it. (Opera too maybe?)
>>>
>>>I make Android apps that make music. But it's getting interesting when I store the results of all these apps and all their different users in one place.
>>>
>>>With the Web Audio API you can hear this list right in your browser.
>>>
>>>So check it out, http://openmusicgallery.net
>>>
>>>Experiment with different basslines and drumbeats.
>>>
>>>It's a work in progress. The purpose of the post is to get some feedback, Let me know what you think. Thanks.
>>
>>Cool. Hadn't looked at the Web Audio API before - one hell of a lot of functionality in there!
>>JavaScript looks clean but have you thought about using a more MVC/MVVM approach using something like angularjs?
>
>
>I haven't. I considered using jquery() but half the time it just gets in my way. I like vanilla JS a lot. (I think I found this here: http://vanilla-js.com/)

:-) - good link!

I think they cheated a bit to make the jQuery equivalents look longer than the plain js. If you strip out the script tags (which you'd need in js anyway) the jQuery version is more concise in every case.

The ops/sec figures are interesting though - I'm surprised how much difference there is. Given that jQuery $(''#test-table') is only a wrapper around the .getElementById() it seems odd that is the 34 times slower and I can see that in an app like yours that difference could be a big factor.

>For the sake of discussion what do you think it would gain me and what in general would the result look like?
>
>
>FWIW, I said in another post I can write in JS in 3 days what it takes me 3 weeks in Java.
>
>My main strategy is to create a global variable (in this case omg) and just add properties to that, with no getters or setters or anything.
>
>It's zen for me. What happens if I'm in the View and need to get at a property on the player?
>
>In Java you could through the rigormorale of chains of getters and setters depending where you are.
>
>In JavaScript I just say "omg.player.load()" from where ever I happen to be.
>
>It's not encapsulated in the slightest, and I love it because there's nothing in my way.
>
>
>I could do an MVC thing, but here's the deal:
>
>A. its locks me out of my own code without excessive code to open it back it
>B. its bullcrap that never really pays off.
>
>I'm not gonna rewrite the app with a different UI and save the business logic. Make an iPhone app for instance, and make sure my JavaScript is reusable?
>
>That's never gonna happen.
>
>That might have been an issue 10 years ago when everyone wasn't sure whether to make a web app or rich client, but now its settled.
>
>The different UI I can get through CSS.
>
>So my attitude now is just write the app to do what it has to do, instead of make it ready for day that never comes.
>
>
>JMO. I'd be interested in hearing your approach and what you think I would gain from it.

If your objective is a simple as stated then maybe not a lot.

Building your ui on top of bootstrap might make your ui more adaptable - I notice that at present narrowing the view area on the desktop causes problems with your 'Remixer' side and this is always apparent on, say, a 7" tablet.

The possible benefits from angularjs are numerous - databinding, services, custom directives and much more - but I honestly don't know whether using it would impact on the 'realtime' usage of the Web Audio API.


>One thing I absolutely love is keeping two parallel objects, one with reference to functions and divs and HTML stuff (omg.player) and one that is just the pure data model (omg.data).
>
>When it comes time to post info to the server all I do is JSON.stringify(omg.data) and its ready to go. It's an amazing concept. The data and my data objects are one in the same. Not a layer on a layer, but the data in my program is actually the data of the program.
>
>I make sure everything is like that.
>
>It's sorta MVC when you think about it.
>
>
>>One thing I noticed (and that you're probably aware of) : The 'Pause' button should toggle to a 'Play' option when paused.

I see you changed this :-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform