Ruby for Artists and Tinkerers. A non-presentation.

Post on 28-Nov-2014

2.030 views 0 download

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.

Ruby for artists and tinkerers.

Jan Krutisch in a hurry for the eurucamp2011

Samstag, 28. Mai 2011

Ceci n'est pas un Presentation

Samstag, 28. Mai 2011

Framework

Samstag, 28. Mai 2011

Interfacing stuff

Samstag, 28. Mai 2011

Serial Port

Samstag, 28. Mai 2011

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

MIDI

Samstag, 28. Mai 2011

Hardware & Software

Samstag, 28. Mai 2011

Samstag, 28. Mai 2011

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

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

Samstag, 28. Mai 2011

Controllers

Samstag, 28. Mai 2011

Buttons! Blinkenlights!Interaction! Stimmung!

Samstag, 28. Mai 2011

Monome/ Launchpad

Samstag, 28. Mai 2011

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

Samstag, 28. Mai 2011

OSC

Samstag, 28. Mai 2011

gem install rosc

Samstag, 28. Mai 2011

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

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

reactivision

Samstag, 28. Mai 2011

video processing

Samstag, 28. Mai 2011

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

Samstag, 28. Mai 2011

http://twitter.com/halfbyte

http://github.com/halfbyte

http://mindmatters.de

Samstag, 28. Mai 2011