Learn creative coding writing simple programs

115. Numbers and computers

Computers are full of numbers. All the data and programs they contain are actually numbers. It does not matter if they are images, sounds, videos or something else. Those numbers are later interpreted in different ways. For example a sound file is played through the speakers, and an image is displayed on the screen. But since those files are just numbers, you could play an image through the speakers, and you can display a song as colorful pixels on the screen.

The world outside computers is also full of numbers. There are millions of things you can measure, and measurements can be written down as numbers. For example, the amount of letters in your name, the temperature, the time you woke up today, the speed at which you were walking at 11:23...

Until now we have made much use of random() and noise(). Those functions "create" numbers. But we can also observe existing numbers in your hard drive (inside computer files), or we can create data out of the real world, for example by writing down the time you wake up every day for one month.

When we display numbers coming from the real world as positions, sizes, colors, etc. we are doing Data Visualization (known as dataviz). Humans are not so great at finding meaning in numbers, but we are very good at noticing subtle changes with our eyes. When we convert numbers into shapes and animations we are able to discover new things about those numbers. Data can be also be converted to sound, which is called sonification.

Tags: numbers, dataviz, data visualization, sonification

Code editor

You can make changes to the code below. Then

Questions and comments

Try to stay close to the topic of this episode. Use the Processing forums for help with unrelated Processing projects (or hire me for help ;-)

To indicate that a word in your comment is code, use the `backtick`. Example
  Do `float` and `int` smell similar?
To highlight code blocks, use ```processing and ``` like this:
  void setup() {
    size(600, 600);