search


Art, Music and the Black-Box
Mon Apr 09 00:00:00 UTC 2018

One of the best way to learn programming is to read other people's code and modify it. This is what we will do in the next class. We will look at some code together and discuss. Then you will pick examples from Quil and Klangmeister . You will modify and play with other people's code and I will be there to guide your exploration and answer any questions that you may have

A useful tool when experimenting with Klangmeister is Wolfram Alpha

(connect-> (sine 440)
           (gain 0.1)) ; Try adjusting the gain.

When you run this example of Klangmeister you can hear it. The gain is defined as multiplication of the sine wave. You can use Wolfram Alpha To see the graph of that sign wave. For example, you can type into Wolfram Alpha
Plot 0.1*sine(x) vs sine(x) x=400 to 500
Wolframe Alpha will show you a graph of 0.1*sine(x) and sine(x) super imposed from x = 400 to 500. Now you can see your sound too!

We have not covered everything in Clojure but we have covered enough so that you can experiment.

Here is what you should already know
  • Invoking functions
  • Defining your own functions with defn
  • Understand namespace: how to create namespace and how to reference names in a namespace
  • Creating global names using def.
  • Creating local names using let
  • Creating list and vectors.
  • Accessing data in a vector using the nth function
Black-box testing

There will things you wouldn't understand, but that is OK. The first step to understand is to ask the right questions so that I can answer. Or you can do your own research by reading documentation and asking Google/Bing/Baidu

We will use a technique called Black Box Testing to experiment with code we didn't write or understand. It is technique use to reverse engineers systems and hacking into systems. As we test the blackbox, we are constantly ask questions like what, why, how, and what if? At first we will give random inputs and observe the output. Base on this understanding we will craft input to test our understanding about how the blackbox works. Blackbox testing is just another form of the Scientific Method