atlastrafficmonitor / atlas-traffic-client

0 stars 2 forks source link

Work on effects #7

Closed BrianNewsom closed 9 years ago

BrianNewsom commented 9 years ago

Hey all, specifically @ianks,

This is by no means where I want it to be, but I finally understand how to apply effects to a sound. It was far more simple than I was making it, so I'm glad to have figured that out. It doesn't necessarily need to be merged but I wanted you guys to look at it.

It is at least a simple POC for random composition - here I am just pulling notes out of a G Pentatonic scale, applying a little reverb and delay and then calling it good. My code is pretty awful though - specifically:

Anyways, long way to go but here's some of the progress I've made.

ianks commented 9 years ago

Javascript scoping is really strange and I don't fully have a grasp on it. However, I do know that in an inner function references can be a bit weird. In particular this always refers to the current object, so sometimes you need to store that for reference later. I'm not sure if this is what you are referring to.... but check this post out.

You may have to define the function like:

function MyClass(){
  this.foo = bar
}

// as opposed to
var MyClass = function(){
  this.foo = bar
}

but I'm not entirely sure on that....

BrianNewsom commented 9 years ago

Thanks man, that finally fixed it. I don't understand the rationale but it's awesome to have it working and know how to get around that.

ianks commented 9 years ago

Yeah I'm not sure why you can't use lamdas attached to vars there. I'll have to look into that....

Looks good man! Nice work. Before we merge it in, can you run grunt to check/fix any JSHint errors?

BrianNewsom commented 9 years ago

Sweet, will do. Definitely needs some cleaning up still.

On Dec 3, 2014 11:06 AM, "Ian Ker-Seymer" notifications@github.com wrote:

Yeah I'm not sure why you can't use lamdas attached to vars there. I'll have to look into that....

Looks good man! Nice work. Before we merge it in, can you run grunt to check/fix any JSHint errors?

— Reply to this email directly or view it on GitHub https://github.com/atlastrafficmonitor/atlas-traffic-client/pull/7#issuecomment-65457376 .

BrianNewsom commented 9 years ago

Is this one okay at this point? If not I don't mind holding off earlier. The next step would be the song api thing @ianks mentioned.

ianks commented 9 years ago

:+1: Lookin' good. Merge'r in.