fluxus: scheme livecoding - pawfal · 2008-05-30 · livecoding & fluxus • fluxus is part of...

38
Fluxus: Scheme Livecoding Dave Griffiths 1

Upload: others

Post on 06-Aug-2020

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Fluxus: Scheme Livecoding

Dave Griffiths

1

Page 2: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Overview

• Fluxus introduction

• What it's built from

• Why Scheme

• Livecoding

• How it works - some examples

• Functional Reactive Programming

• Gamepad Livecoding

2

Page 3: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

What is fluxus?

• Framework for various things:

Playing/learning about graphics

Workshops

Performances

Art installations

• Game engine at heart...

• With a livecoding editor

• Uses PLT Scheme

• Source released under GPL

• 4 or 5 developers working on it

• Builds on Linux and sometimesOSX

3

Page 4: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Quick demo

4

Page 5: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

I use fluxus for...

5

Page 6: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Live coding graphics, using live audio input

6

Page 7: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Live coding graphics and audio at the same time

7

Page 8: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

As a framework for developing new livecoding languages

8

Page 9: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

slub

9

Page 10: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

What's inside?

10

Page 11: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Boring Feature List• Immediate mode drawing

• Scenegraph

• Primitives

Polys

Particles

NURBS patches

Blobbies (implicit surfaces)

Pixels (procedural texture access)

• Unified access to primitive data(vertex arrays, texture data)

• More advanced stuff

GLSL Hardware shading

ODE physics

Shadows

Skinning/Skeletons

• Audio synthesis

11

Page 12: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Architecture

12

Page 13: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

DrScheme integration

13

Page 14: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

DrScheme integration

14

Page 15: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

DrScheme integration

• Much better editor

• Debugger

• Profiler

• Syntax highlighting

• Less control over OpenGL

No GLSL shader support

No stencilmap shadows

Slower

• Not suitable for livecodingperformance

15

Page 16: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Why Scheme?

16

Page 17: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Fluxus philosophy

• 'Creative' code in Scheme

• OpenGL grunt work in C++

17

Page 18: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Scheme for creative code

• Fast feedback (use an interpreter)

• Expressive power

• Few keypresses needed to getinteresting results

Functional roots

Use of macros to shape thelanguage

Dynamic typing

• Lots of interesting research goingon with Scheme

18

Page 19: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Livecoding

19

Page 20: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Livecoding

• Performance programming

• Mainly a musical field

• Reaction against the normal laptopperformance

• Showing the audience what you'redoing

20

Page 21: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

TOPLAP

• Formed Feburary 2004 in asmokey Hamburg bar

• Now grown to 100's of livecoders

• Role is to promote live coding as aunique art form

21

Page 22: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

TOPLAP MANEFESTO

We demand:

• Give us access to the performer's mind, to the whole human instrument.

• Obscurantism is dangerous. Show us your screens.

• Programs are instruments that can change themselves.

• The program is to be transcended - Artificial language is the way.

• Code should be seen as well as heard, underlying algorithms viewed as well as their visual outcome.

• Live coding is not about tools. Algorithms are thoughts. Chainsaws are tools. That's why algorithms aresometimes harder to notice than chainsaws.

We recognise continuums of interaction and profundity, but prefer:

• Insight into algorithms

• The skillful extemporisation of algorithm as an expressive/impressive display of mental dexterity

• No backup (minidisc, DVD, safety net computer)

We acknowledge that:

• It is not necessary for a lay audience to understand the code to appreciate it, much as it is not necessaryto know how to play guitar in order to appreciate watching a guitar performance.

• Live coding may be accompanied by an impressive display of manual dexterity and the glorification of thetyping interface.

• Performance involves continuums of interaction, covering perhaps the scope of controls with respect tothe parameter space of the artwork, or gestural content, particularly directness of expressive detail. Whilstthe traditional haptic rate timing deviations of expressivity in instrumental music are not approximated incode, why repeat the past? No doubt the writing of code and expression of thought will develop its ownnuances and customs.

22

Page 23: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Livecoding & Fluxus

• Fluxus is part of the livecodingmovement

• People using it for performance('no copy paste' from Budapest)

• Fluxus/Supercollider Workshop atthe LOSS Livecoding festival inSheffield

• The movement has greatlyinfluenced fluxus development

23

Page 24: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Some other livecoding systems

24

Page 25: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Impromptu

25

Page 26: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

SuperCollider

26

Page 27: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

ChucK

27

Page 28: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Fluxus code

28

Page 29: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Scene description

• Describing 3D scene andbehaviours

• Simple example:

(define (draw-my-scene)(draw-cube))

(every-frame (draw-my-scene))

29

Page 30: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Scene description

• It's essentially a state machine:

(translate (vector 0 1 0))(scale (vector 0.1 0.1 2))(rotate (vector 45 0 0))(colour (vector 1 0 0))(texture (load-texture "brick.png"))(shader "blinn.vert.glsl" "blinn.frag.glsl")(draw-cube)...(draw-sphere)(draw-torus)

30

Page 31: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Example Demos

31

Page 32: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Mutable state

• Everything so far relies on mutablestate

• Some of this is for performance

• Conventional way of using scenegraphs

Init step: build scene graph

Every frame step: update scenegraph

• Complexity starts to bite with bigscenes

• Is there a better way?

32

Page 33: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Functional Reactive Programming

• Applying declarative programmingfor reactive systems

• First class behaviours and events

• Examples:

Fran - Functional reactiveanimation (Haskell)

Yampa - Haskell

Flapjax - Javascript

FrTime - PLT Scheme

• Avoids the complexity of statemachines for behaviour

• More scalable

• Starting to be looked at here andthere for games

33

Page 34: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Frisbee

• FRP in fluxus

• Based on FrTime - by GregoryCooper

• Trying to build a game engine ontop of FrTime

• Could be a more expressivelanguage for fluxus

• Easier to teach game programming

• Increase what is possible whilelivecoding

34

Page 35: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Frisbee disclaimers

• Frisbee is very much work inprogress

• FrTime is still undergoingoptimisation work

• A few glitches still

• We're working on it...

35

Page 36: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Frisbee Demo

36

Page 37: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Gamepad Livecoding

37

Page 38: Fluxus: Scheme Livecoding - pawfal · 2008-05-30 · Livecoding & Fluxus • Fluxus is part of the livecoding movement • People using it for performance ('no copy paste' from Budapest)

Gamepad Livecoding

• Make watching live coding a bitmore accessible

• Live coding doesn't have to beabout text editors

• Live coding doesn't have to behard

• Making fun, simplified languages

38