Visual Programming Workend

This semester i’m offering a Visual Programming Workend. In two days I will show you the basics of programming in a language, that is not based on symbols like letters and numbers but on graphical elements like boxes and wires.

last semester we worked with the graphical programming environment called Pure Data. This semester you’ll have the option to choose one of two languages for the workshop: Pure Data or VVVV. Below you’ll find a poll … the majority wins.

 

 

Both programming environments are based on similar principls and both are good in interfacing with external hardware like webcams, arduinos or the usual HIDs. But there are still some pros and cons for both environments.

Pure Data
+ works on Mac and Windows (and Linux)
+ good for synthesizing sound
– bad for synthesizing visuals and image analysis
– kind of outdated/not very active community

VVVV
+ good for synthesizing visuals and image analysis (motion tracking, color detection, blob detection)
+ up to date/active community
+ modern user friendly interface
– works only on Windows
– not very good at synthesizing sound

 

Pure Data Workend

Great Workshop last weekend! Below you’ll find the patches we built …

If you want to review the very basics, please watch the first three of these video tutorials or read about them at flossmanuals.net.

1. GEM basics

download link

Use [gemwin] and [gemhead] to display graphics

use [gemwin] and [gemhead] to display graphics

2. Dealing with jittery (microphone) data + using the mouse input

download link

change the height of an rectangle by microphone input and the tranasparency by mouse movment

change the height of an rectangle by microphone input and the tranasparency by mouse movment

3. Change the backgound color of the GEM window

download link – save this patch in the same folder as the parent patch and call this abstraction by creating an object called random-gemwin-bg.

random gemwin background abstraction

random gemwin background abstraction

4. The very useful map abstraction

download link – save this patch in the same folder as the parent patch and call this abstraction by creating an object called map-values.

remember the very useful map abstraction

remember the very useful map abstraction

4. Using the webcam

download link – see the [pix_video] helpfile for more information

display webcam feed in a gem window + rizise the image keeping the aspect ratio

display webcam feed in a gem window + rizise the image keeping the aspect ratio

5. Read an anlalog sensor connected to an Arduino (Firmata)

download link – the PD patch
download link – the Arduino Environment

To use this patch, you will need to have an Arduino board with the Standart Firmata firmware installed:

  1. Download and install and open the Arduino environmet
  2. Connect the Arduino board
  3. Select your type of Arduino: tools > board
  4. Select your serial port: tools > serial port > dev/tty/usb… or COM
  5. Open the Standart Firmata sketch: file > examples > Firmata > StandartFirmata
  6. Upload StandartFirmata to your Arduino
arduino + standart firmata + pd: reeds analog sensor

arduino + standart firmata + pd: reeds analog sensor

6. Control servo

download link – the PD patch
download link – the Arduino Environment

To use this patch, you will need to have an Arduino board with the Standart Firmata firmware installed:

  1. Download and install and open the Arduino Environmet
  2. Connect the Arduino board
  3. Select your type of Arduino: tools > board
  4. Select your serial port: tools > serial port > dev/tty/usb… or COM
  5. Open the Standart Firmata sketch: file > examples > Firmata > StandartFirmata
  6. Upload StandartFirmata to your Arduino
arduino + standart firmata + pd: servo

arduino + standart firmata + pd: servo

7. Read messages send by an OSC app

download link – PD patch
Play Store/App Store – touchOSC is used in the example below

To use the example below, set the outgoing port of the touchOSC app to 8000. The [route] objects are set for messages sent by touchOSC.

read osc messages with pure data

read osc messages with pure data

8. Send your phones accelerometer values to Pure Data with OSC

download link – PD patch
Play Store/App Store – touchOSC is used in the example below

To use the example below, set the outgoing port of the touchOSC app to 8000. The [route] objects are set for messages sent by touchOSC. The accelerometer values may be different for your phone. You may have to change the range of the sliders or do some additional math.

receive accelerometer data using OSC

receive accelerometer data using OSC

Pure Data – Erste Schritte

Arduino Test-Patch

Der Arduino Test Patch, im Hilfe Browser unter pduino zu finden.

Pure Data (Open Source) ist eine visuelle Programmierumgebung, die für die Synthese von Musik entwickelt wurde. Seit dem wurde PD mit vielen Plugins erweitert und bietet mittlerweile auch Grafik- und Videofunktionen. Außerdem ist Pure Data gut geeignet, um Schnittstellen mit externer Hardware wie Arduinos, HIDs und MIDI/OSC fähigen Geräten herzustellen. Pure Data ist damit sehr gut geeignet, um „hardware-lastige“ Interaktionen zu gestalten. Pure Data ist nicht geeignet um grafische Benutzerschnittstellen zu entwerfen. Dafür eingnet sich z.B. HTML5 Animationssoftware wie Hype 2 (30 USD) oder die Adobe Edge Tools (Gratis aber mit Registrierungszwang bei Adobe).

Die kommerzielle Programmierumgebung MAX/MSP basiert auf Pure Data. Vieles was wir in PD lernen werden lässt sich auf MAX/MSP übertragen.

Installation
Pure Data Extended Downloadseite
Pure Data Extended enthält neben dem Hauptprogramm viele nützliche Externals (so heißen Programmbibliotheken bei Pure Data) wie Gem und Pduino.

Handbuch
Auf flossmanuals.net findet man ein ausführliches Pure Data Handbuch.

Video Tutorials
Auf Youtube findet man diese hervorragenden Video Tutorials (insgesamt 35 Video). Viele der komplexeren Tutorials beschäftigen sich zwar mit der Musiksynthese, sind aber trotzdem sehenswert, da sie viele Basics erklären, die auch für Pure Data allgemein gültig sind.

Der Pure Data Hilfe Browser
Der vielleicht beste Einstieg ist der Hilfe Browser, der in Pure Data selbst enthalten ist. Zu finden ist der Hilfe Browser unter Hilfe > Pd Hilfe Browser … oder mit [cmd (Apfel)] + [B]

PD Hilfe Browser

Unter Manuals/0.Intro/… findet man interaktive Lektionen die Pure Data von Anfang an erklären.