Ruby for Artists and Tinkerers. A non-presentation.

23
Ruby for artists and tinkerers. Jan Krutisch in a hurry for the eurucamp2011 Samstag, 28. Mai 2011

description

A small hacked together non-presentation on my applications of the ruby programming language to problems in arts and tinkering.

Transcript of Ruby for Artists and Tinkerers. A non-presentation.

Page 1: Ruby for Artists and Tinkerers. A non-presentation.

Ruby for artists and tinkerers.

Jan Krutisch in a hurry for the eurucamp2011

Samstag, 28. Mai 2011

Page 2: Ruby for Artists and Tinkerers. A non-presentation.

Ceci n'est pas un Presentation

Samstag, 28. Mai 2011

Page 3: Ruby for Artists and Tinkerers. A non-presentation.

Framework

Samstag, 28. Mai 2011

Page 4: Ruby for Artists and Tinkerers. A non-presentation.

Interfacing stuff

Samstag, 28. Mai 2011

Page 5: Ruby for Artists and Tinkerers. A non-presentation.

Serial Port

Samstag, 28. Mai 2011

Page 6: Ruby for Artists and Tinkerers. A non-presentation.

require 'rubygems'require 'serialport'

SerialPort.open("/dev/tty.usbserial-A900adgW", 57600) do |serial| loop do line = serial.readline if res = line.match(/^OK 98 (\d)/) if res[1].to_i == 1 # trigger! ! else # stop end end endend

Samstag, 28. Mai 2011

Page 7: Ruby for Artists and Tinkerers. A non-presentation.

MIDI

Samstag, 28. Mai 2011

Page 8: Ruby for Artists and Tinkerers. A non-presentation.

Hardware & Software

Samstag, 28. Mai 2011

Page 9: Ruby for Artists and Tinkerers. A non-presentation.

Samstag, 28. Mai 2011

Page 10: Ruby for Artists and Tinkerers. A non-presentation.

require 'rubygems'require 'serialport'require 'portmidi'Portmidi.startPortmidi.output_devices.each do |dev| puts "%d > %s" % [dev.device_id, dev.name]endoutput = Portmidi::Output.new(7)

SerialPort.open("/dev/tty.usbserial-A900adgW", 57600) do |serial| loop do line = serial.readline if res = line.match(/^OK 98 (\d)/) if res[1].to_i == 1 output.write_short(0x90, 0x24, 0x7F) else output.write_short(0x90, 0x24, 0x00) end end endend

Samstag, 28. Mai 2011

Page 11: Ruby for Artists and Tinkerers. A non-presentation.

http://www.youtube.com/watch?v=w1jE7_1xSSU

Samstag, 28. Mai 2011

Page 12: Ruby for Artists and Tinkerers. A non-presentation.

Controllers

Samstag, 28. Mai 2011

Page 13: Ruby for Artists and Tinkerers. A non-presentation.

Buttons! Blinkenlights!Interaction! Stimmung!

Samstag, 28. Mai 2011

Page 14: Ruby for Artists and Tinkerers. A non-presentation.

Monome/ Launchpad

Samstag, 28. Mai 2011

Page 15: Ruby for Artists and Tinkerers. A non-presentation.

http://rubygems.org/gems/portmidihttp://rubygems.org/gems/launchpad

Samstag, 28. Mai 2011

Page 16: Ruby for Artists and Tinkerers. A non-presentation.

OSC

Samstag, 28. Mai 2011

Page 17: Ruby for Artists and Tinkerers. A non-presentation.

gem install rosc

Samstag, 28. Mai 2011

Page 18: Ruby for Artists and Tinkerers. A non-presentation.

server = OSC::UDPServer.newserver.bind("0.0.0.0", 8000)

File.open("dings.csv", "w") do |file|

server.add_method "/accxyz", "fff" do |msg| file.puts msg.args.join(";") end puts "server starts now" server.serve puts "server interrupted"end

Samstag, 28. Mai 2011

Page 19: Ruby for Artists and Tinkerers. A non-presentation.

c = OSC::UDPSocket.new

full_set.each do |row| msg = OSC::Message.new("/accxyz/#{m + 2}", 'fff', *row) c.send(msg, 0, 'localhost', 9000) sleep(1.0 / f.to_f)end

Samstag, 28. Mai 2011

Page 20: Ruby for Artists and Tinkerers. A non-presentation.

reactivision

Samstag, 28. Mai 2011

Page 21: Ruby for Artists and Tinkerers. A non-presentation.

video processing

Samstag, 28. Mai 2011

Page 22: Ruby for Artists and Tinkerers. A non-presentation.

http://www.youtube.com/watch?v=ZynPbWB0gN4

Samstag, 28. Mai 2011

Page 23: Ruby for Artists and Tinkerers. A non-presentation.

http://twitter.com/halfbyte

http://github.com/halfbyte

http://mindmatters.de

Samstag, 28. Mai 2011