Friday, July 31, 2009

fun with physics




Today I wrote a Mass Spring Damper system in Flash that uses the
positions of genres as determined by a self organizing map as initial
starting positions. Plus, it looks cool:



Here's some of the resources I used:

Euclidean distance
CVector3 Class Reference
CVector3
Mass on a Spring
Coulomb's law in Vector form.
Coulomb's law
Electric charge and Coulomb's law
Vector Addition
What is a Vector
Finding the magnitude or length of a vector
Euclidean Vector
Vector Magnitude
Stress majorization
Force Based Algorithm - Fantastic resource:


set up initial node velocities to (0,0)
set up initial node positions randomly // make sure no 2 nodes are in exactly the same position
loop
total_kinetic_energy := 0 // running sum of total kinetic energy over all particles
for each node
net-force := (0, 0) // running sum of total force on this particular node

for each other node
net-force := net-force + Coulomb_repulsion( this_node, other_node )
next node

for each spring connected to this node
net-force := net-force + Hooke_attraction( this_node, spring )
next spring

// without damping, it moves forever
this_node.velocity := (this_node.velocity + timestep * net-force) * damping
this_node.position := this_node.position + timestep * this_node.velocity
total_kinetic_energy := total_kinetic_energy + this_node.mass * (this_node.velocity)^2
next node
until total_kinetic_energy is less than some small number //the simulation has stopped moving


Mass Spring System - Some C++ code that kinda helped, but not so much.
Mass Spring Damper Example
Harmonic oscillator
Damping



Tuesday, July 28, 2009

OFFICIAL HD Tron Legacy Comic-Con 2009 (2010) TRAILER! VFX Test for 2009 Movie

cache




Sweet, I was thinking that caching those dynamically generated PNGs for the Orchive would be tricky, but it looks like I can just use straight-up caches_page. Nice!

Lazily sweeping the whole Rails page cache
ActionController::Caching::Pages
ActionController::Caching::Pages::ClassMethods
Dynamic setup of caches_page in Rails
Page Caching Resurrected



surreal nudism




Check out this great article Surrealism Meets Nudism by my friend Anna Zalewska.



venus



pro git




Pro Git - Creative Commons book about git. nice.



oss



where i program




Where I program

Here's where I program:




6th floor of the tallest building at UVIC (ECS), looking out on huge trees which ravens sometimes visit, and hills in the distance. about 1km to the ocean.

lab is filled with amazing toys, big professional mackie mixer, 10 channel firewire audio interface, my drums, a keyboard, radiodrum, breath sensors.

life is sweet.


aurora








iss transit








Monday, July 27, 2009

cache




Sweet, I was thinking that caching those dynamically generated PNGs for the Orchive would be tricky, but it looks like I can just use straight-up caches_page. Nice!



Robot Drummer Cymbal Roll - ENGR 466 at UVic, Summer 2009

sweet!

Robot Drummer on Demo Day - ENGR 466 at UVic, Summer 2009

Some students I had helped with their project. Those are my cymbals and drums :)

orchive



I've made lots of progress on the new Orchive site, and wanted to
share them with you. Check out a demo site I've made at:

http://orchive.sness.net/recordings/show/2



There's lots going on there, but a brief tour is:

In the middle of the screen is the new OrcaAnnotator flash player I've
been working on. It shows you a spectrogram or waveform display of
the recording. It starts off fully zoomed out, showing a full 45
minutes of audio. To zoom in, you can either use your mouse wheel or
the "Zoom In" and "Zoom out" buttons, which look like magnifying
glasses.

Zooming in happens around the current playback position, which you
change by clicking either on the progress bar at the bottom of the
screen (the blue waveform), or by clicking on the annotator view on
the top hand side of the screen.

Let's click near to one of the annotations that say "Orca". Then,
zoom in, and keep zooming in until you can see the individual whale
vocalizations in the spectrogram.

Then, to play the audio, press the "Play" button.



Other neat features are:

  • You can edit the text of an annotation by clicking on it

  • You can drag the ends of an annotation back and forth

  • When you edit an annotation, the application will automatically
    save it back to the database (disk icon turns orange when it's saving)

  • You can also click on the disk icon to save the current state

  • The table at the bottom of the screen dynamically updates itself
    with the current annotations in the database

  • You can view either the waveform or the spectrogram view by clicking on it

  • To create an annotation, hold down the "control" key and then
    click and drag. Then just start typing to create an annotation, or
    click on the annotation icon in the control bar.

  • The question mark will soon show a little help screen

  • The coloured bars show what predictions from Marsyas will look
    like. Please note, these are just currently just randomly created to
    show what they will look like, and have no relation to the real data.



It's still very rough with lots of bugs and problems, but it's getting
there. I would appreciate hearing about any problems you have, and
would love any suggestions or comments.

Email me at sness _at_ sness.net!



slow it down!




Slowing down a web connection to test Flash loaders
Manage Apache Download Speed And Traffic Limits With mod_cband - Page 2
Speed limiting example

What I needed was a way to test for a slow connection, but I didn't want to slow down the testing of other parts of the app, so I wanted to have an unlimited number of connections (say 1000), but to limit the speed of each of these to 150kbs:


<VirtualHost *:80>
ServerName orchive.sness.org
DocumentRoot /home/sness/nDEV/orchive/public
RailsEnv development
CBandSpeed 150kb/s 1000 1000
</VirtualHost>




pneumatica




Pneumatic displays - Providing Dynamically Changeable Physical Buttons on a Visual Display

Wow.



Friday, July 24, 2009

Thursday, July 23, 2009

Apple WWDC09 Dr. Ge Wang From Smule

Wow. So cool.

Umm, by the way, this is the field that I work in. yes, life rocks.

resolution




Resolution of a PowerBook Screen
PowerBook G4

Started off at:
1024 x 768

And goes up to:

1440 x 960 pixels on the 15-inch model, and 1680 x 1050 pixels on the 17-inch model)

So, an app 500 pixels high should fit nicely.




Monday, July 20, 2009

reinvent




Reinventing the desktop (for real this time) - Part 1

With my Enlightenment setup, I don't have a desktop, I have a 5-dimensional space that I can run applications in. I like living in n-dimensions.



firefox threads



balanced/unbalanced





Part 7: Balanced and Unbalanced Lines
Balancing Act
How do I connect balanced and unbalanced equipment?


The correct way to connect balanced and unbalanced equipment is an audio
balance transformer

To connect an unbalanced output (typically on a phono connector from
some home audio equipment, eg a CD player) to a balanced input (almost
always an XLR connector). Connect the centre pin to pin 2 of the XLR
connector, and the ground ring to pins 1 & 3

To connect a balanced output to an unbalanced input is trickier. If it's
a floating (passive) balanced output you can connect pin 2 of the XLR to
the phono pin and pin 3 to the ring. If it's an active balanced output
then you may be able to XLR pin 2 to the phono pin and pin 1 to the
phono ring, leaving pin 3 unconnected. If that fails try connecting XLR
pin 3 to the phono pin, XLR pin 1 to the ring and leavin pin 2
unconnected. Both of these approaches may well cause distortion or more
noise.


On-The-Level Impedance Transformer Interfaces
Balanced/Unbalanced Converter
Sound System Interconnection
DI unit




danger cloud



veiled darknet



pdflatex




I had lots of trouble trying to figure out why pdflatex was outputting A4 paper instead of US Letter. Lots of links and information around, but the one that worked for me was to add:


\pdfpagewidth 8.5in
\pdfpageheight 11in


To the preamble of the latex file.


Sunday, July 19, 2009


int debug = 0;

int in_breath;
int in_learn;
int in_active;
int out_midi;

int learning = 0;
int active = 0;

long debounce = 200; // the debounce time, increase if the output flickers

int learnInPin = 6; // the number of the input pin
int learnState = HIGH; // the current state of the output pin
int learnReading; // the current reading from the input pin
int learnPrevious = LOW; // the previous reading from the input pin
long learnTime = 0; // the last time the output pin was toggled
int learnOutPin = 8;

int activeInPin = 7; // the number of the input pin
int activeState = LOW; // the current state of the output pin
int activeReading; // the current reading from the input pin
int activePrevious = HIGH; // the previous reading from the input pin
long activeTime = 0; // the last time the output pin was toggled
int activeOutPin = 9;

int breathMin = 1024;
int breathMax = 0;

void setup() {
if (debug) {
Serial.begin(9600);
} else {
Serial.begin(31250);
}

pinMode(learnInPin, INPUT);
pinMode(activeInPin, INPUT);

pinMode(learnOutPin, OUTPUT);
pinMode(activeOutPin, OUTPUT);
}

void readLearn()
{
learnReading = digitalRead(learnInPin);

// if we just pressed the button (i.e. the input went from LOW to HIGH),
// and we've waited long enough since the last press to ignore any noise...
if (learnReading == HIGH && learnPrevious == LOW && millis() - learnTime > debounce) {
// ... invert the output
if (learnState == HIGH)
learnState = LOW;
else {
learnState = HIGH;
breathMax = 0;
breathMin = 1023;
}

// ... and remember when the last button press was
learnTime = millis();
}

learnPrevious = learnReading;

if (learnState == HIGH) {
learning = 1;
} else {
learning = 0;
}
}

void readActive()
{
activeReading = digitalRead(activeInPin);

// if we just pressed the button (i.e. the input went from LOW to HIGH),
// and we've waited long enough since the last press to ignore any noise...
if (activeReading == HIGH && activePrevious == LOW && millis() - activeTime > debounce) {
// ... invert the output
if (activeState == HIGH)
activeState = LOW;
else
activeState = HIGH;

// ... and remember when the last button press was
activeTime = millis();
}

activePrevious = activeReading;

if (activeState == HIGH) {
active = 1;
} else {
active = 0;
}
}

void printDebug() {
if (learning) {
Serial.print("LEARN");
} else {
Serial.print("learn");
}
Serial.print("\t");
if (active) {
Serial.print("ACTIVE");
} else {
Serial.print("active");
}
Serial.print("\t");

Serial.print((long)breathMin,DEC);
Serial.print("\t");
Serial.print((long)breathMax,DEC);
Serial.print("\t");

Serial.print((long)in_breath,DEC);
Serial.print("\t");

Serial.print((long)out_midi,DEC);
Serial.print("\t");

Serial.println();

}

void doLEDS() {
if (learning) {
digitalWrite(learnOutPin,HIGH);
} else {
digitalWrite(learnOutPin,LOW);
}
if (active) {
digitalWrite(activeOutPin,HIGH);
} else {
digitalWrite(activeOutPin,LOW);
}

}

void doLearn() {
if (in_breath < breathMin) {
breathMin = in_breath;
}
if (in_breath > breathMax) {
breathMax = in_breath;
}
}

void doMIDIcalc() {
float v = ((float)in_breath - (float)breathMin)/((float)breathMax - (float)breathMin);
out_midi = v * 128;
if (out_midi < 0) {
out_midi = 0;
}
if (out_midi > 127) {
out_midi = 127;
}
}

void loop() {
in_breath = analogRead(0);

readLearn();
readActive();
doLEDS();
doMIDIcalc();

if (learning) {
doLearn();
}

if (active && !debug) {
midi_volume(1, out_midi);
}

if (debug) {
printDebug();
}
delay(100);
}

void midi_volume(byte channel, byte vol) {
Serial.print(0xB0 | (channel & 0xf), BYTE); // control change command
Serial.print(0x01, BYTE); // volume command
Serial.print(vol & 0x7f, BYTE); // volume 0-127
}

Friday, July 17, 2009

tm




TraceMonkey the new faster javascript engine for Firefox 3.5. Sweet.



nmap5




nmap5 has just been released. An excellent tool for securing your network.



Shiina Ringo - Identity

OMFG, LOVE IT!

How can it be that I've never heard of her before! That scream is amazing.

Thursday, July 16, 2009

simulating light




Simulating Light - Inside Rendering Technology

A really fascinating article on different kinds of rendering techniques.

How about that for sound? We're doing different kind of path tracing algorithms, I wonder how deeply people have thought about this?



think before forking




On Forking a FOSS project. Think before you fork a FOSS project, it's better to develop a community and conversation, and then we all benefit.



NULL




Fun with none. null in various programming languages.



take a swig




Extend Your Scripting Language with SWIG

We use SWIG in Marsyas to generate our bindings for Python, Ruby and Lua.



light



small updates




Smaller is Faster (and Safer Too) - Google comes out with a way to have small binary diffs of applications, for faster updating. Smart and sweet.



ray



small




There are no small changes in web apps.

So true. I've found that this is much more the case for web apps than for desktop or command-line apps. A lot goes on in web site programming. A lot of people have this idea that it's "just web programming" so it must be simple, but it's not.





Tuesday, July 14, 2009

latency




Latency of media - Really effective graphic showing relative latencies of different media. L1, L2, RAM are little lines and Hard Disk is a massive red bar.



Sunday, July 12, 2009

sense




Stretch Sensor Evaluation Kit User Manual - Super useful, they've got a really nice circuit diagram and explanation in this PDF
SOIC - Small-outline integrated circuit
Characteristics of Operational Amplifiers
LMC662 - CMOS Dual Operational Amplifier
Arduino MIDI out example
circuit-sigh-send.pdf
Sigh Collector
Build and Program circuit for sigh detection. Assemble electronics into carrying case.
Operational amplifier applications
6-pack-arduino-code.txt
6-pack - is an open-ended, highly customisable, and ultra-portable physical controller based on the Arduino board. 6-pack is an Arduino shield consisting of 6 linear potentiometer sliders that can be assigned to different variables in the user's preferred software. It can be used to control a wide array of audio/video applications, from software synthesizers to HDJ systems. All, with a minimal footprint (3,5" x 2,5") and on the cheap (just a fraction of the cost of an equivalent MIDI controller). The project is open source.
Touchpad Midi
Arduino Midi Library
Arduino MIDI Volume Pedal - Nice small little source code, super useful
Operational amplifier
Table 1: Summary of MIDI Status & Data Bytes
Table 2: Summary of MIDI Note Numbers for Different Octaves
Table 3: Status Bytes 176-191; Control and Mode Changes (per channel)
What are MIDI messages and what do they do? PAUL WHITE explains.
MIDI Control Change Messages
MIDI usage and applications
Table 1 - Summary of MIDI Messages
MIDI Basics



void setup() {
Serial.begin(31250);
//Serial.begin(9600);
}

void loop() {
int in = analogRead(0);
//Serial.println((long)in,DEC);
midi_volume(1, in / 8);
delay(100);
}

void midi_volume(byte channel, byte vol) {
Serial.print(0xB0 | (channel & 0xf), BYTE); // control change command
Serial.print(0x01, BYTE); // volume command
Serial.print(vol & 0x7f, BYTE); // volume 0-127
}

Saturday, July 11, 2009

restful



js



rest



url



aws




HotPads Shows the True Cost of Hosting on Amazon

I love Amazon hosting, and if I were to do another project that required big iron I would totally use it again. I still have a few things on Amazon, but most on VPS servers, including the mighty mighty Quantact, one of the best VPS servers out there.

I also have servers on Slicehost, but somehow their servers aren't quite as well tuned as Quantact, but they have some really nice management software.

I have also had good success with iWeb, but their dedicated server got a little too pricey for me.



pretty



names




Naming Things in Code

Giving the right names to things in your code is very important, and something that I think about a lot. I used to ponder longer in the past, but now with Emacs and M-x tag-query-replace, I name things something reasonable to start with, and then if I think of a better name, I globally change the name to something better.




grind



twitter arch



br



mf




Maestro Frankenstein screenshot
Geophonic Music
Joseph Rovan
Arvid - Sensory Overload
Arvid Tomayko-Peters
Geophonics
North American First Leaf and First Bloom Lilac Phenology Data
National Phenology Network - Historical Phenology Data
Surround Sound
Annual hawk migration in Duluth
Phenology - Definition
The Phenology Page
What Is Phenology - Plant and Animal Cycles of Nature

Phenology is defined as a branch of science dealing with the relations between climate and periodic biological phenomena. Stated another way, phenology is the study of the response of living organisms to seasonal and climatic changes to the environment in which they live. Seasonal changes include variations in the duration of sunlight, precipitation, temperature and other life-controlling factors.

Phenology - is the study of the timing of natural events. Common examples include the date that migrating birds return, the first flower dates for plants, and the date on which a lake freezes in the autumn or opens in the spring. Phenological records help alert us about the events of nature and provide interesting comparisons between years and among different geographic regions. If recorded carefully and consistently, these records also have scientific value for understanding the interactions between organisms and their environment and for assessing the impacts of climate change.

USA National Phenology Network
Nature's Calendar


bioacoustics



love ada






Love it.


Friday, July 10, 2009

MIR



oscillate



LED driver



haptic



gfs




Full explanation of the recent GFS problems that caused App Engine to fail.

Oh my god, I'm so glad I didn't get that job with Google a couple years ago. I can't imagine how stressful this would be.

My chosen career, doing Music Information Retrieval at UVIC is soooooooooo much cooler!

Today I'm working on the orcaannotator, working out bugs. I've already solved a few big ones, and am working on one of the zoom level bugs right now.



cadr




Retrocomputing - MIT CADR Lisp Machines

"I took the red pill... two, in fact :-)"



loud




It Might Get Loud - Guitar Documentary. Want see.



hear




Gilbert Chin

The widespread adoption of multiple technologies for distinct channels of data communication?text, voice, and video?has made it abundantly clear to even the casual user that more bandwidth allows for higher rates of information transfer. But what happens on the receiving end? Presumably, recipients of phone calls are processing a lot more information, such as emotional overtones, than just the words that are spoken. Does this emotional content register in their brains? Ethofer et al. apply the method of multivariate pattern analysis and show that pseudowords spoken with five distinct emotional melodies (anger, sadness, relief, joy, or neutrality) do evoke recognizable neural responses within the auditory cortex. Each of these emotions could be discriminated against the others, and decoding algorithms trained on any nine of the speakers' voices were accurate in classifying the emotional identity of the tenth speaker's speech. Furthermore, the five distributed maps of neuronal activity segregated more closely to levels of arousal than valence, suggesting a possible affective organization within the auditory cortex.

Curr. Biol. 19, 10.1016/j.cub.2009.04.054 (2009).





gaia






zomg! by gaia online


Thursday, July 09, 2009

charts



neat x




Releasing Neatx, an Open Source NX Server. Google Chrome OS, perhaps?



closure




Closure Trees - Store trees in SQL



memristor



Experiments with FFTs




I'm writing a new Flash interaction tool for The Orchive. The original one was fine, and played audio, but since the recordings of Orcas are all 45 minutes long, it was impossible to navigate through the recording to find the orca calls.

So, I wrote orcaannotator, a new Flash tool written with haXe that let's you zoom in right down to individual calls, which last for only a second or two.

In doing so, I needed to generate huge images of the waveforms and spectrograms, these would then be chopped up by a tool written in Ruby using ImageMagick and given to the Flash application.

To actually generate the images, I used Marsyas and wrote a program called sound2png that takes an audio file and outputs a PNG containing a waveform or a spectrogram.

I had lots of problems with the spectrogram code, I just couldn't get the spectrograms to display like they do in Audacity. I had tried all sorts of different kind of scaling algorithms, and just nothing was working. I was searching all around the web for different contrast curve algorithms, and nothing that I tried worked. My super smart Mom suggested that I look in the source code of Audacity. I'd looked in it a bit before, but had given up, but buoyed by her suggestion, I tried again. The code was actually much easier to understand than I'd remembered, and quickly was able to find the code that did this, by first looking in WaveClip.h in the WaveClip::GetSpectrogram() function, which led me to Spectrum::ComputeSpectrum(). It turns out that they weren't doing anything fancy, just taking the decibels (10*log10()) of the Power Spectrum. This was a bit strange, because that was just what I was doing in Marsyas. I looked a bit more closely at the Marsyas code, and realized that it was actually doing 20*log10() and cutting off anything that was below -100.

This was totally my problem, all the low end data was getting truncated, and no amount of post-scaling that I could do would fix it! I fixed Marsyas, and am now generating sweet looking spectrograms.

Right now, I'm just trying to figure out the best window size to use when doing my spectrograms. I chopped out 45 seconds of orca song, and tried a number of different window sizes on them. Here's the command I used:


sound2png small.wav -mf 10000 -v -ws 2048 -hs 1024 out.png


Which gives a maximum frequency of 10,000 Hz, a window size of 2048 and a hop size of 1024. The window size of 2048 gives back a Power Spectrum with 1024 bins, and the hop size of 1024 says that each of those windows will overlap by half their width.

I tried this with a number of different window sizes to get a bunch of images, which I then scaled to the same size with the following ImageMagick command:


convert -resize "989x160\!" out_2048_1024_num2.png out_2048_1024_num2.jpg









Window sizeImage
512
1024
2048
4096
8192


I think that 2048 gives the best image...



alpha hubris





Wolfram Alpha and hubristic user interfaces

Great article, with this fantastic quote:

"For serious UI geeks, one way to see an intelligent control interface is as a false affordance - like a knob that cannot be turned, or a chair that cannot be sat in. The worst kind of false affordance is an unreliable affordance - a knob that can be turned except when it can't, a chair that's a cozy place to sit except when it rams a hidden metal spike deep into your tender parts."

LOL



alpha hubris





Wolfram Alpha and hubristic user interfaces

Great article, with this fantastic quote:

"For serious UI geeks, one way to see an intelligent control interface is as a false affordance - like a knob that cannot be turned, or a chair that cannot be sat in. The worst kind of false affordance is an unreliable affordance - a knob that can be turned except when it can't, a chair that's a cozy place to sit except when it rams a hidden metal spike deep into your tender parts."

LOL



Wednesday, July 08, 2009

sekiden




sekiden - Nice music.



sound2png




I've just added a new program to Marsyas called sound2png. It lets you make a picture of a an audio file in .mp3, .wav, .au or .aiff format:

When generating a spectrogram, you can set both the window size and hop size that are used in calculating the FFT. The window size that you give is then used as the amount of data that the FFT is given, which means that the number of bins for the FFT will be half of the window size. Each bin of the FFT will be drawn in one pixel vertically, so if you use a window size of 512, the resulting PNG will be 256 pixels high.

The hop size for the spectrogram tells the program how much to overlap each FFT by. The width of the output PNG will thus depend on the length of the audio file and the hop size, with smaller hop sizes giving longer PNG images.

Below is shown an example of using sound2png to generate a spectrogram of an orca call. We use a window size of 1024 and a hop size of 1024. The maximum frequency is set to 8000Hz. A gain of 1.5 is used to make the spectrogram darker:


sound2png A30.wav -ws 1024 -hs 1024 -mf 8000 -g 1.5 out.png




You can also you sound2png to generate pictures of the waveform of an audio file. For this, you use the -w option. An example of this is shown below:


sound2png tiny.wav -ws 1 -w out.png




When generating pictures of waveforms, you can specify a window size. sound2png takes a chunk of data that is window size samples in length and calculates the maximum and minimum of this window. It then draws a bar from the minimum to the maximum value for each window. An example of this is shown below:


sound2png small.wav -ws 100 -w out.png





free ubuntu stickers




Sweet, you can get Free Ubuntu Stickers by sending a self addressed stamped envelope to your local address, which in Canada is:

Ubuntu Sticker Offer
2448 Cadboro Bay Rd.
Victoria BC
V8S 4C1
Canada




Tuesday, July 07, 2009

jamvm



Re: Problems with JamVM

1) Override the defaults at runtime:

jamvm -Xbootclasspath:<path to classes.zip>:<path to glibj.zip>
-Dgnu.classpath.boot.library.path=<path to Classpath library dir> ...

e.g.:

jamvm -Xbootclasspath:/usr/local/jamvm/share/jamvm.zip:/usr/local/classpath/share/classpath/glibj.zip
-Dgnu.classpath.boot.library.path=/usr/local/classpath/lib/classpath
...


and here

sox




To use sox to generate a .wav file with a series of tones of frequency 300, 400, 500 Hz each with a duration of 0.1 seconds:


sox -n out300.wav synth 0.1 sine 300
sox -n out400.wav synth 0.1 sine 400
sox -n out500.wav synth 0.1 sine 500
sox out300.wav out400.wav out500.wav out.wav





code blocks




Code Blocks: Ruby's Swiss Army Knife

Code blocks in Ruby are ultra-sweet.



dynamic




People who've made the switch to dynamic languages seem much, much happier.

True. So true.

But, I do a lot of development in C++ still, and it's nice to get closer to the metal every now and then. I often find myself missing hashes/dictionaries and nice string handling though.



Monday, July 06, 2009

swipe



fog




How to use Fog in OpenGL
gl_fog() problems : Graphics - This is the problem I was having. GL_FOG_START and GL_FOG_END don't work for GL_EXP and GL_EXP2.
So you want to add fog to your OpenGL program?
problem with glfog
Lesson 15: Fog
fog.c
15 Transparency, Translucency, and Blending
glFog Subroutine - I got the OpenGL man pages, and installed them locally.
Lesson 4 : Fog
glFogf, glFogi, glFogfv, glFogiv ? specify fog parameters
Fog_start
Defining Surface Material Properties

float mcolor[] = { 1.0f, 0.0f, 0.0f, 1.0f };
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, mcolor);
// now, draw polygon as its material properties will be affected by the glMaterialfv call



Quadrics are a way of drawing complex objects that would usually take a few FOR loops and some background in trigonometry.
gluDisk


app engine downtime



nip2




nip2 - Take 1 cup of Excel and 1 cup of Photoshop. Mix well, bake at 350 for 20 minutes. Mmm.

Now, how about this for music?



mmp




Mathematica - Matlab - Python - Commands with all three compared. Nice.



DO



Saturday, July 04, 2009

make



I was interested in seeing how much slower it is to run a program inside VirtualBox than it is under native Linux. I first compiled Marsyas using the default options in Ubuntu 9.04:


make -j3 182.58s user 17.35s system 188% cpu 1:46.15 total


And then compiled it in VirtualBox on a Windows 7 host and Ubuntu 9.04 guest:


make -j3 379.36s user 266.08s system 96% cpu 11:09.95 total




Stroke Sensor

Friday, July 03, 2009

chocolate




The Physics of Chocolate

I am seriously in love with chocolate.

Last night I had three squares of chocolate from three different Lindt chocolate bars:


Fleur de sel
Chili pepper
90% Cocoa


Oh. My. God. I was in a little bit of heaven.



arturia minimoogv

fog




I'm developing a very cool new app using Marsyas called MarPanning, if you build Marsyas with Qt, you'll get it.

What it does is graphically show in real time the stereo panning from left/right of different frequencies in an audio file. Her's a screenshot:



On the z-axis, going into the screen, is time, with the current time at the start of the screen, and things in the past going into the screen. On the y-axis, going up and down, is the different frequency bins, with low frequencies at the bottom and high frequencies at the top. On the x-axis, from left to right is the left/right panning index of each frequency bin.

What you are looking at here is the start of "In My Life" by the Beatles. The producer of the Beatles, George Martin, panned the Guitarsto the left, and the vocals and other instruments to the right. In the screenshot above, you see the first few seconds of the song, where just the guitars are playing.

Then, when the vocals and drums start playing, the audio spreads out to encompass both the left and right:



This is just the start of the app, but already it's looking pretty cool. Just wait, much more goodness is coming.




fog start and end




Ah, la.

anyone here ever have a problem with glfog under glfw not using updated values of GL_FOG_START or GL_FOG_END?

The answer:


#%$@ i'm a dumb ass... its because start and end only work with linear... ~head-desk~


Arg!


want have



ableton external



jabref




jabref - is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. JabRef runs on the Java VM (version 1.5 or newer), and should work equally well on Windows, Linux and Mac OS X.



iphone dev




Android versus iPhone Development: A Comparison
Trust, hostility, and the human side of Apple

So glad I'm not developing iPhone apps. When I start doing mobile apps it will be Android all the way.



pair



ide pain



brainfuck








flash memory leak




Why Do Adobe Flash Videos Slow Down?. Good to know it wasn't just me that was the problem.



free software