Ruby for Artists and Tinkerers. A non-presentation.

1,847
-1

Published on

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

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
1,847
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Ruby for Artists and Tinkerers. A non-presentation.

  1. 1. Ruby for artists and tinkerers. Jan Krutisch in a hurry for the eurucamp2011Samstag, 28. Mai 2011
  2. 2. Ceci nest pas un PresentationSamstag, 28. Mai 2011
  3. 3. FrameworkSamstag, 28. Mai 2011
  4. 4. Interfacing stuffSamstag, 28. Mai 2011
  5. 5. Serial PortSamstag, 28. Mai 2011
  6. 6. 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 end endSamstag, 28. Mai 2011
  7. 7. MIDISamstag, 28. Mai 2011
  8. 8. Hardware & SoftwareSamstag, 28. Mai 2011
  9. 9. Samstag, 28. Mai 2011
  10. 10. require rubygems require serialport require portmidi Portmidi.start Portmidi.output_devices.each do |dev| puts "%d > %s" % [dev.device_id, dev.name] end output = 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 end endSamstag, 28. Mai 2011
  11. 11. http://www.youtube.com/watch?v=w1jE7_1xSSUSamstag, 28. Mai 2011
  12. 12. ControllersSamstag, 28. Mai 2011
  13. 13. Buttons! Blinkenlights! Interaction! Stimmung!Samstag, 28. Mai 2011
  14. 14. Monome/ LaunchpadSamstag, 28. Mai 2011
  15. 15. http://rubygems.org/gems/portmidi http://rubygems.org/gems/launchpadSamstag, 28. Mai 2011
  16. 16. OSCSamstag, 28. Mai 2011
  17. 17. gem install roscSamstag, 28. Mai 2011
  18. 18. server = OSC::UDPServer.new server.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" endSamstag, 28. Mai 2011
  19. 19. 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) endSamstag, 28. Mai 2011
  20. 20. reactivisionSamstag, 28. Mai 2011
  21. 21. video processingSamstag, 28. Mai 2011
  22. 22. http://www.youtube.com/watch?v=ZynPbWB0gN4Samstag, 28. Mai 2011
  23. 23. http://twitter.com/halfbyte http://github.com/halfbyte http://mindmatters.deSamstag, 28. Mai 2011

×