“Scripting for the Web” offers an interdisciplinary approach to the production and execution for a unique presentation of student produced media artifacts relative to their expressed interests but focused on deployment via the use of javascript on the World Wide Web. Students work inside and with a variety of javascript tools with self-assigned production goals and responsibilities relevant to their chosen project.
I spent a lot of time working on my updated portfolio website this semester. Here's an excerpt of the reflection post I wrote (because the actual post is really long):
"Originally, this whole redesign was done to satisfy requirements for a professional development class I was taking. I didn’t intend to change as much as I did, but rather make some minor adjustments. However, I didn’t account for the fact that there were two major things have changed since I last redesigned my portfolio. First, my main focus has changed from attempting to acquire commercial work to getting a full-time job. Second, photography has grown from something I was dabbling in to a real hobby. I needed an aesthetic that would better show off my modern and professional design sense and a system to naturally integrate my photography."
The full post may be viewed here: http://emilyserven.net/2017/12/19/blog-development-3.html
Hi Everyone, Over the past few months, I have been working on a number of projects that incorporate scripting for the web. I contribute to multiple private repositories as well as my personal public repository which can be found at github.com/mtgagliano. Live examples of my design and development work can be found at Veritonic and my personal website MattGagliano.com. Feel free to browse my work and reach out via the social channels posted on my website! Matt
http://jeromeetienne.github.io/threex.proceduralcity/examples/demo.html
A city procedurally generated using three.js
I was originally going to procedurally generate terrain for my midterm using the plerin-noise function. I found the method used here an interesting alternative.
REINFORCEjs is a Reinforcement Learning library that implements several common RL algorithms supported with fun web demos, and is currently maintained by @karpathy. In particular, the library currently includes:
Dynamic Programming
For solving finite (and not too large), deterministic MDPs. The solver uses standard tabular methods will no bells and whistles, and the environment must provide the dynamics.
Right: A simple Gridworld solved with a Dynamic Programming. Very exciting. Head over to the GridWorld: DP demo to play with the GridWorld environment and policy iteration.
Tabular Temporal Difference Learning
Both SARSA and Q-Learning are included. The agent still maintains tabular value functions but does not require an environment model and learns from experience. Support for many bells and whistles is also included such as Eligibility Traces and Planning (with priority sweeps).
Deep Q Learning
Reimplementation of Mnih et al. Atari Game Playing model. The approach models the action value function Q(s,a) with a neural network and hence allows continuous input spaces. However, with a fixed number of discrete actions. The implementation includes most of the bells and whistles (e.g. experience replay, TD error clamping for robustness).
Policy Gradients
The implementation includes a stochastic policy gradient Agent that uses REINFORCE and LSTMs that learn both the actor policy and the value function baseline, and also an implementation of recent Deterministic Policy Gradients by Silver et al. To make a lot of this happen (e.g. LSTMs in particular), the library includes a fork of my previous project recurrentjs, which allows one to set up graphs of computations over matrices and perform automatic backprop.
I do not include the demo for policy gradient methods because the current implementations are unfortunately finicky and unstable (both stochastic and deterministic). I still include the code in the library in case someone wants to poke around. I suspect that either there are bugs (It's proving difficult to know for sure), or I'm missing some tips/tricks needed to get them to work reliably.
Example Library Usage
Including the library (currently there is no nodejs support out of the box):
For most applications (e.g. simple games), the DQN algorithm is a safe bet to use. If your project has a finite state space that is not too large, the DP or tabular TD methods are more appropriate. As an example, the DQN Agent satisfies a very simple API:
// create an environment objectvar env = {};
env.getNumStates = function(){ return8; }
env.getMaxNumActions = function(){ return4; }
// create the DQN agentvar spec = { alpha: 0.01 } // see full options on DQN page
agent = new RL.DQNAgent(env, spec);
setInterval(function(){ // start the learning loopvar action = agent.act(s); // s is an array of length 8//... execute action in environment and get the reward
agent.learn(reward); // the agent improves its Q,policy,model, etc. reward is a float
}, 0);
In other words, you pass the agent some vector and it gives you an action. Then you reward or punish its behavior with the reward signal. The agent will over time tune its parameters to maximize the rewards it obtains.
The full source code is on Github under the MIT license.
Tone.GrainPlayer implements granular synthesis. Granular Synthesis enables you to adjust pitch and playback rate independently. The grainSize is the amount of time each small chunk of audio is played for and the overlap is the amount of crossfading transition time between successive grains.
Play the buffer at the given startTime. Optionally add an offset and/or duration which will play the buffer from a position within the buffer for the given duration.
Sync the source to the Transport so that all subsequent calls to start and stop are synced to the TransportTime instead of the AudioContext time.
EXAMPLE
//sync the source so that it plays between 0 and 0.3 on the Transport's timelinesource.sync().start(0).stop(0.3);//start the transport.Tone.Transport.start();
EXAMPLE
//start the transport with an offset and the sync'ed sources//will start in the correct positionsource.sync().start(0.1);//the source will be invoked with an offset of 0.4Tone.Transport.start("+0.5",0.5);
Buffer loading and storage. Tone.Buffer is used internally by all classes that make requests for audio files such as Tone.Player, Tone.Sampler and Tone.Convolver. Aside from load callbacks from individual buffers, Tone.Buffer provides events which keep track of the loading progress of all of the buffers. These are Tone.Buffer.on(“load” / “progress” / “error”)
CONSTRUCTOR
newTone.Buffer(
url
,[
onload
],[
onerror
])
url
The url to load, or the audio buffer to set.
TYPE:AudioBufferORString
onload
A callback which is invoked after the buffer is loaded. It’s recommended to use Tone.Buffer.on('load', callback) instead since it will give you a callback when all buffers are loaded.
TYPE:Function
OPTIONAL
onerror
The callback to invoke if there is an error
TYPE:Function
OPTIONAL
DEFAULTS
{
url:undefined,
reverse:false
}
EXAMPLE
varbuffer=newTone.Buffer("path/to/sound.mp3",function(){//the buffer is now available.varbuff=buffer.get();});
EXAMPLE
//can load provide fallback extension types if the first type is not supported.varbuffer=newTone.Buffer("path/to/sound.[mp3|ogg|wav]");
Get the buffer as an array. Single channel buffers will return a 1-dimensional Float32Array, and multichannel buffers will return multidimensional arrays.