HW 4 - Nyquist and The Whizzler

Note that this fourth homework assignment has two distinct parts that are unrelated to one another. In the first part, you're going to create and Audacity Plugin using Nyquist that can be used to generate a custom note for your own instruments. In the second part you'll be using Web Audio Oscillators to audify The Whizzler.

A Custom Nyquist Instrument (30%)

In lecture we discussed how one can make a custom instrument using the Nyquist programming language and also how one can create a plugin for Audacity using this language. Create your own two custom instruments that do not sound similar and can be tuned to specific frequencies in a similar fashion to how the pluck plugin works. Note that your instruments should not be ones that are already available. They should be something you build using your own harmonics and envelope. They should be interesting!.

Audifying The Whizzler (70%)

First: Fix The Whizzler - to get you familiar with how The Whizzler works first you must fix a few things:

NOTE: Change the title of your The Whizzler to say the musical key it will be played in. Note that as we discussed in class, you may choose any real musical scale, except for a Major scale or a Natural Minor scale (which would sound similar in this program). A Harmonic Minor scale or a Blues scale, or whatever else (as long as it's real) is ok. So, your Web page now may have the title, The Harmonic A Minor Whizzler, or whatever key you choose to use.

NOTE: Boris Smus' Web Audio API online book may come in handy while working on this portion of the assignment.

Download the The Whizzler JavaScript application and add it to a NetBeans HTML5 Web Application project. Try running it. You should get an interesting, interactive and unusual Web page that lets you make weird patterns using Whizzles. You're going to audify it. To do so, first use Web Audio's Oscillator Nodes to construct and waveshape a good, rich (but fairly short, i.e. 1/2 second) tone to represent a whizzle. Then, each frame, update the tone and gain of your whizzle.

So what's the appropriate tone? Well, first of all you are to pick a minor key and pick 48 consecutive notes in that scale that can be played. Then, depending on what part of the canvas the whizzle is currently on, play one of those notes. Note that further to the left should be low notes and to the right high notes. Note that the note should be evenly distributed in order by pitch. So, you'll need to determine the x-location of the location where a whizzle is to determine which pitch to play.

So what's the appropriate gain? Well, we'll increase note volume on the grid from the bottom to towards the top. For this, use 100 different gain values, with the bottom row being the quietest (but not silent). This should also be evenly distributed.

What's the significance of color? Well, think of each color representing a different musical instrument, meaning it has its own custom harmonics using a custom wavetable, and is customly shaped (you may use filter nodes to do so). You may do whatever color-instrument mappings you like, and they may change each time the site loads, but note that all colors used must be mapped to a unique instrument and if two whizzles use the same color, they should use the same instrument.

Note that you'll need to carefully manage your node objects in order for your program to work properly. You should pre-build a whole bunch of them, one for each whizzle, and keep them somewhere (i.e. an array) where you can get them when you need them, and hook them up to premade Gain Nodes. This way you won't have to keep constructing these things, which is computationally expensive.

Continuous Notes - Provide a radio button that lets the user toggle continuous play on and off. While in continuous play frequencies are continuous, but on the same scale. So you would not only be using 48 notes, but all frequencies in the range of those 48 notes as well.


SBU CS

Web page created and maintained
by Richard McKenna