SlideShare una empresa de Scribd logo
1 de 63
Descargar para leer sin conexión
Arte Computacional com Ruby
          ...e amigos.
Carlos Villela (@cv)

                      ThoughtWorks há 6 anos (Londres, Porto Alegre)
                      Ruby desde 2004
                      Java, Ruby, Smalltalk, Io, Ioke, etc...

                      Twitter, GitHub, Flickr: cv
                      Blog: http://lixo.org




© 2011 ThoughtWorks, Ltd. All rights reserved.
Thiago Bueno (@tbueno)

                      ThoughtWorks há 1+ ano (Porto Alegre)
                      Ruby desde 2005
                      Java, Ruby, Clojure, etc

                      Twitter, GitHub, Flickr: tbueno
                      Blog: http://tbueno.org




© 2011 ThoughtWorks, Ltd. All rights reserved.
iπ
                                                 e +1=0

© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                 iπ
                                                 e +1=0
                                                      Identidade de Euler




© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                 Pi   iπ
                                                      e +1=0
                                                           Identidade de Euler




© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                 Pi   iπ
                                                      e +1=0
                                                           Identidade de Euler
                       1



© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                 Pi       iπ
                                                          e +1=0
                                                               Identidade de Euler
                       1
                                                      0


© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                      Pi       iπ
                                                 Adição
                                                               e +1=0
                                                                    Identidade de Euler
                       1
                                                           0


© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                      Pi       iπ
    Multiplicação

                                                 Adição
                                                               e +1=0
                                                                    Identidade de Euler
                       1
                                                           0


© 2011 ThoughtWorks, Ltd. All rights reserved.
Número de Euler
                     Unidade Imaginária


                                                      Pi       iπ
    Multiplicação

                                                 Adição
                                                               e +1=0
                                                                    Identidade de Euler
                       1
                                                           0
                                        Exponenciação

© 2011 ThoughtWorks, Ltd. All rights reserved.
“most beautiful theorem in mathematics”


                                                 iπ
                                                 e +1=0
           “greatest equation ever”


© 2011 ThoughtWorks, Ltd. All rights reserved.
“Beauty depends on size as well as
                                                 symmetry.”
                                                          – Aristotle (384 B.C.-322 B.C.), Poetics




© 2011 ThoughtWorks, Ltd. All rights reserved.
“the mathematician is only complete in
                                                 so far as he feels within himself the
                                                 beauty of the true.”
                                                                                 – Goethe




© 2011 ThoughtWorks, Ltd. All rights reserved.
“... who is not at the same time a bit
                                                 of a poet will never be a full
                                                 mathematician..”
                                                         – O. Spengler, in J. Newman, The World
                                                         of Mathematics, Simon & Schuster, 1956




© 2011 ThoughtWorks, Ltd. All rights reserved.
Por que Ruby?


© 2011 ThoughtWorks, Ltd. All rights reserved.
Beleza


© 2011 ThoughtWorks, Ltd. All rights reserved.
Simplicidade


© 2011 ThoughtWorks, Ltd. All rights reserved.
Sintaxe


© 2011 ThoughtWorks, Ltd. All rights reserved.
Beleza
                                                 “Beauty depends on size as well as
                                                 symmetry.”   - Aristotle (384 B.C.-322 B.C.),
                                                 Poetics




© 2011 ThoughtWorks, Ltd. All rights reserved.
Beleza
         Simplicidade
                                                 “Beauty depends on size as well as
                                                 symmetry.”   - Aristotle (384 B.C.-322 B.C.),
                                                 Poetics




© 2011 ThoughtWorks, Ltd. All rights reserved.
Beleza
         Simplicidade
                                                 “Beauty depends on size as well as
                                                 symmetry.”   - Aristotle (384 B.C.-322 B.C.),
                                                 Poetics


        Sintaxe

© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte

                Proporção Áurea (Phi)
                • Aprox.1.6180339887
                A proporção de a+b para a é
                a mesma de a para b              a         b
                Alega-se ser a proporção
                mais esteticamente
                aplasível ao ser humano.



                                                     a+b

© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte




© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte




© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte




© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte




© 2011 ThoughtWorks, Ltd. All rights reserved.
Matemática e a Arte




                      Nota                       Frequência   Logaritmo

                  Música                          Física      Matemática




© 2011 ThoughtWorks, Ltd. All rights reserved.
A Matemática é Sua Amiga

                Álgebra
                   • Curvas, retas, transformações
                Geometria
                   • Quadriláteros, círculos...
                Geometria
                   • Senos, cosenos, tangentes...
                Propriedades dos números
                   • Naturais, inteiros, racionais, primos...



© 2011 ThoughtWorks, Ltd. All rights reserved.
Ver

© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing

                Processing
                • Linguagem/ambiente de programação para imagens,
                   animações e projetos multimídia
                • MIDI, OpenGL, Arduino...



                ruby-processing
                • É um wrapper Ruby do framework
                • Beleza do Ruby + as bibliotecas gráficas do Java



© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing




© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing                           posição e ângulo de
                                                 uma “raiz”




© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing




                                                 PI
                                                   ,C
                                                   os
                                                        eS
                                                         en
© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing



                                                 Chamadas
                                                 Recursivas




© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing




                                                 De
                                                 se n
                                                  ha
                                                      “fo
                                                        lha
                                                         s”
© 2011 ThoughtWorks, Ltd. All rights reserved.
ruby-processing




© 2011 ThoughtWorks, Ltd. All rights reserved.
Context-free Art

                Geração de imagens através de uma gramática livre de
                contexto e regras não determinísticas



                Escrito em C++ e Objective-C



                Parcialmente re-escrito com uma DSL em Ruby para o ruby-
                processing



© 2011 ThoughtWorks, Ltd. All rights reserved.
Context-free Art




© 2011 ThoughtWorks, Ltd. All rights reserved.
Context-free Art




© 2011 ThoughtWorks, Ltd. All rights reserved.
Visualização de Dados - Exemplo Real

                Base de Dados de 100 corais de Johann S. Bach
                Salvos em um arquivo Lisp
                                   (1 ((st 8) (pitch 67) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 12) (pitch 67)
                                   (dur 8) (keysig 1) (timesig 12) (fermata 0)) ((st 20) (pitch 74) (dur 4) (keysig 1)
                                   (timesig 12) (fermata 0))((st 24) (pitch 71) (dur 6) (keysig 1) (timesig 12) (fermata
                                   0)) ((st 30) (pitch 69) (dur 2) (keysig 1) (timesig 12) (fermata 0))((st 32) (pitch 67)
                                   (dur 4) (keysig 1) (timesig 12) (fermata 0)) ((st 36) (pitch 67) (dur 6) (keysig 1)
                                   (timesig 12) (fermata 0))((st 42) (pitch 69) (dur 2) (keysig 1) (timesig 12) (fermata
                                   0)) ((st 44) (pitch 71) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 48) (pitch 69)
                                   (dur 8) (keysig 1) (timesig 12) (fermata 1)) ((st 56) (pitch 71) (dur 4) (keysig 1)
                                   (timesig 12) (fermata 0))((st 60) (pitch 74) (dur 8) (keysig 1) (timesig 12) (fermata
                                   0)) ((st 68) (pitch 72) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 72) (pitch 71)
                                   (dur 4) (keysig 1) (timesig 12) (fermata 0)) ((st 76) (pitch 69) (dur 8) (keysig 1)
                                   (timesig 12) (fermata 0))((st 84) (pitch 67) (dur 8) (keysig 1) (timesig 12) (fermata
                                   1))




© 2011 ThoughtWorks, Ltd. All rights reserved.
Visualização de Dados - Exemplo Real

                Uso de Ruby devido à facilidade para parsing de strings
                Ruby + JRuby + Processing

                Reconhecimento de padrões
                Transformação de música em imagem




© 2011 ThoughtWorks, Ltd. All rights reserved.
Ouvir

© 2011 ThoughtWorks, Ltd. All rights reserved.
Básico do básico

                C = 261.626 Hz
                D = 293.665 Hz
                E = 329.628 Hz
                F = 349.228 Hz
                G = 391.995 Hz
                A = 440.000 Hz
                B = 493.883 Hz

                C D E F G A B = escala C Maior


© 2011 ThoughtWorks, Ltd. All rights reserved.
Básico do básico

                C# = 277.183 Hz
                D# = 311.127 Hz
                E# = 349.228 Hz
                F# = 369.994 Hz
                G# = 415.305 Hz
                A# = 466.164 Hz
                B# = 523.251 Hz




© 2011 ThoughtWorks, Ltd. All rights reserved.
Básico do básico

                C = 246.942 Hz
                D = 277.183 Hz
                E = 311.127 Hz
                F = 329.628 Hz
                G = 369.994 Hz
                A = 415.305 Hz
                B = 466.164 Hz



© 2011 ThoughtWorks, Ltd. All rights reserved.
Básico do básico

                C D E F G A B = C maior
                C G D A E = pentatônica em C
                F G A C D = pentatônica em F
                C E F F G B C = Blues!




© 2011 ThoughtWorks, Ltd. All rights reserved.
MIDI, OSC

                Protocolos de comunicação como quaisquer outros
                Ubíquos
                • Ok, OSC nem tanto...
                Simples
                Latência é o fator mais importante
                • Antigamente, hardware/cabos especiais
                • Hoje, Ethernet, USB e até Wi-Fi




© 2011 ThoughtWorks, Ltd. All rights reserved.
OSC

                UDP
                Simples
                Pequenos pacotes
                Baixa latência
                https://github.com/maca/ruby-osc
                https://github.com/aberant/osc-ruby




© 2011 ThoughtWorks, Ltd. All rights reserved.
OSC

                Suporte nativo no Monome
                Quartz Composer
                Ótimo para iniciantes!




© 2011 ThoughtWorks, Ltd. All rights reserved.
MIDI

                Padrão indústria
                Suporte pelo OS
                GarageBand, Logic, Reason, Ableton Live!, etc
                Muita coisa legada
                • Meio gambiarrento
                • Protocolo ainda bastante atrelado a hardware




© 2011 ThoughtWorks, Ltd. All rights reserved.
Midiator

                Biblioteca Ruby para iteração com MIDI
                https://github.com/bleything/midiator
                • gem install midiator
                Extremamente simples
                Multi-plataforma
                • Software synth incluído para a versão Mac




© 2011 ThoughtWorks, Ltd. All rights reserved.
Midiator
       require 'rubygems'
       require 'midiator'                                     2.times do
                                                               [G3, A3, G3, F3].each { |note|
       midi = MIDIator::Interface.new                         midi.play note, 0.250 }
       midi.use :dls_synth                                     midi.play E3, 0.5
                                                               midi.play C3, 1
       include MIDIator::Notes                                end
                                                 Mac Only!
       2.times do                                             2.times do
        [C3, D3, E3, C3].each{ |note| midi.play note, 0.5 }    midi.play C3, 0.5
       end                                                     midi.play G3, 0.5
                                                               midi.play C3, 1.0
       2.times do                                             end
        midi.play E3, 0.5
        midi.play F3, 0.5
        midi.play G3, 1
       end


© 2011 ThoughtWorks, Ltd. All rights reserved.
Archaeopteryx

                Gerador de MIDI real-time, usando live coding
                github.com/gilesbowkett/archaeopteryx
                Sequenciador de batidas que permite a criação de ritmos como
                Drum’n’Bass, Techno e Ambient
                Probabilidade para gerar comportamentos randômicos e
                “improvisações”




© 2011 ThoughtWorks, Ltd. All rights reserved.
A seguir, algumas palavras soltas...




                                         ...para você se divertir no Google

© 2011 ThoughtWorks, Ltd. All rights reserved.
sierpinski - chiptunes - mandelbrot - fibonacci
- fractals - hypercube - game of life - arduino
- monome - chuck - circuit bending - escher
- sistemas de particulas - supercollider - pure
data - quartz composer - reactable - c’74 max

© 2011 ThoughtWorks, Ltd. All rights reserved.
Livros

                The Computational Beauty of Nature
                Gödel, Escher, Bach: An Eternal Golden Braid
                Programming Interactivity: A Designer's Guide to Processing,
                Arduino, and Openframeworks
                Processing: A Programming Handbook for Visual Designers
                and Artists




© 2011 ThoughtWorks, Ltd. All rights reserved.
Websites - Matemática e Arte

                http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/
                Fibonacci/fibInArt.html
                • Proporção áurea e Números de Fibonacci nas artes,
                   arquitetura e música.
                http://www.2dcurves.com/
                • Coleção de curvas matemáticas
                http://www.cut-the-knot.org/manifesto/index.shtml
                • Manifesto matemática-arte




© 2011 ThoughtWorks, Ltd. All rights reserved.
Websites - Visuais

                http://www.complexification.net/
                • Exemplos de obras feitas com Processing (incluindo a
                   imagem da capa desta apresentação)
                http://openprocessing.org
                • Agregador de animações feitas com Processing(incluindo a
                   imagem mostrada no último slide desta apresentação)
                http://www.contextfreeart.org/
                • Site sobre context-free art




© 2011 ThoughtWorks, Ltd. All rights reserved.
Websites - Áudio

                http://upload.wikimedia.org/wikipedia/commons/9/97/
                Fibonacci.ogg
                • Composição musical feita com os números de Fibonacci
                http://botverse.com/music-and-mathematics-finding-the-
                natural-and-the-pentathonic-scales/5
                http://thinkzone.wlonk.com/Music/12Tone.htm
                • Explicação matemática para as escalas musicais




© 2011 ThoughtWorks, Ltd. All rights reserved.
Obrigado!
”Mathematics, as much as music or any other art, is one of the means by
   which we rise to a complete self-consciousness. The significance of
Mathematics resides precisely in the fact that it is an art; by informing us
of the nature of our own minds it informs us of much that depends on our
     minds.” - J.W.N.Sullivan (1886-1937), Aspects of Science, 1925.



                    Entre em contato
                        Carlos Villela
                         cv@lixo.org
                       Thiago Bueno
                     tbueno@gmail.com

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Arte Computacional com Ruby: Beleza, Simplicidade e Sintaxe

  • 1. Arte Computacional com Ruby ...e amigos.
  • 2. Carlos Villela (@cv) ThoughtWorks há 6 anos (Londres, Porto Alegre) Ruby desde 2004 Java, Ruby, Smalltalk, Io, Ioke, etc... Twitter, GitHub, Flickr: cv Blog: http://lixo.org © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 3. Thiago Bueno (@tbueno) ThoughtWorks há 1+ ano (Porto Alegre) Ruby desde 2005 Java, Ruby, Clojure, etc Twitter, GitHub, Flickr: tbueno Blog: http://tbueno.org © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 4. e +1=0 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 5. Número de Euler Unidade Imaginária iπ e +1=0 Identidade de Euler © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 6. Número de Euler Unidade Imaginária Pi iπ e +1=0 Identidade de Euler © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 7. Número de Euler Unidade Imaginária Pi iπ e +1=0 Identidade de Euler 1 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 8. Número de Euler Unidade Imaginária Pi iπ e +1=0 Identidade de Euler 1 0 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 9. Número de Euler Unidade Imaginária Pi iπ Adição e +1=0 Identidade de Euler 1 0 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 10. Número de Euler Unidade Imaginária Pi iπ Multiplicação Adição e +1=0 Identidade de Euler 1 0 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 11. Número de Euler Unidade Imaginária Pi iπ Multiplicação Adição e +1=0 Identidade de Euler 1 0 Exponenciação © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 12. “most beautiful theorem in mathematics” iπ e +1=0 “greatest equation ever” © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 13. “Beauty depends on size as well as symmetry.” – Aristotle (384 B.C.-322 B.C.), Poetics © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 14. “the mathematician is only complete in so far as he feels within himself the beauty of the true.” – Goethe © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 15. “... who is not at the same time a bit of a poet will never be a full mathematician..” – O. Spengler, in J. Newman, The World of Mathematics, Simon & Schuster, 1956 © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 16. Por que Ruby? © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 17. Beleza © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 18. Simplicidade © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 19. Sintaxe © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 20. Beleza “Beauty depends on size as well as symmetry.” - Aristotle (384 B.C.-322 B.C.), Poetics © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 21. Beleza Simplicidade “Beauty depends on size as well as symmetry.” - Aristotle (384 B.C.-322 B.C.), Poetics © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 22. Beleza Simplicidade “Beauty depends on size as well as symmetry.” - Aristotle (384 B.C.-322 B.C.), Poetics Sintaxe © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 23. Matemática e a Arte Proporção Áurea (Phi) • Aprox.1.6180339887 A proporção de a+b para a é a mesma de a para b a b Alega-se ser a proporção mais esteticamente aplasível ao ser humano. a+b © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 24. Matemática e a Arte © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 25. Matemática e a Arte © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 26. Matemática e a Arte © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 27. Matemática e a Arte © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 28. Matemática e a Arte Nota Frequência Logaritmo Música Física Matemática © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 29. A Matemática é Sua Amiga Álgebra • Curvas, retas, transformações Geometria • Quadriláteros, círculos... Geometria • Senos, cosenos, tangentes... Propriedades dos números • Naturais, inteiros, racionais, primos... © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 30. Ver © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 31. ruby-processing Processing • Linguagem/ambiente de programação para imagens, animações e projetos multimídia • MIDI, OpenGL, Arduino... ruby-processing • É um wrapper Ruby do framework • Beleza do Ruby + as bibliotecas gráficas do Java © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 32. ruby-processing © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 33. ruby-processing posição e ângulo de uma “raiz” © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 34. ruby-processing PI ,C os eS en © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 35. ruby-processing Chamadas Recursivas © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 36. ruby-processing De se n ha “fo lha s” © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 37. ruby-processing © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 38. Context-free Art Geração de imagens através de uma gramática livre de contexto e regras não determinísticas Escrito em C++ e Objective-C Parcialmente re-escrito com uma DSL em Ruby para o ruby- processing © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 39. Context-free Art © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 40. Context-free Art © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 41. Visualização de Dados - Exemplo Real Base de Dados de 100 corais de Johann S. Bach Salvos em um arquivo Lisp (1 ((st 8) (pitch 67) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 12) (pitch 67) (dur 8) (keysig 1) (timesig 12) (fermata 0)) ((st 20) (pitch 74) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 24) (pitch 71) (dur 6) (keysig 1) (timesig 12) (fermata 0)) ((st 30) (pitch 69) (dur 2) (keysig 1) (timesig 12) (fermata 0))((st 32) (pitch 67) (dur 4) (keysig 1) (timesig 12) (fermata 0)) ((st 36) (pitch 67) (dur 6) (keysig 1) (timesig 12) (fermata 0))((st 42) (pitch 69) (dur 2) (keysig 1) (timesig 12) (fermata 0)) ((st 44) (pitch 71) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 48) (pitch 69) (dur 8) (keysig 1) (timesig 12) (fermata 1)) ((st 56) (pitch 71) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 60) (pitch 74) (dur 8) (keysig 1) (timesig 12) (fermata 0)) ((st 68) (pitch 72) (dur 4) (keysig 1) (timesig 12) (fermata 0))((st 72) (pitch 71) (dur 4) (keysig 1) (timesig 12) (fermata 0)) ((st 76) (pitch 69) (dur 8) (keysig 1) (timesig 12) (fermata 0))((st 84) (pitch 67) (dur 8) (keysig 1) (timesig 12) (fermata 1)) © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 42. Visualização de Dados - Exemplo Real Uso de Ruby devido à facilidade para parsing de strings Ruby + JRuby + Processing Reconhecimento de padrões Transformação de música em imagem © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 43.
  • 44.
  • 45. Ouvir © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 46. Básico do básico C = 261.626 Hz D = 293.665 Hz E = 329.628 Hz F = 349.228 Hz G = 391.995 Hz A = 440.000 Hz B = 493.883 Hz C D E F G A B = escala C Maior © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 47. Básico do básico C# = 277.183 Hz D# = 311.127 Hz E# = 349.228 Hz F# = 369.994 Hz G# = 415.305 Hz A# = 466.164 Hz B# = 523.251 Hz © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 48. Básico do básico C = 246.942 Hz D = 277.183 Hz E = 311.127 Hz F = 329.628 Hz G = 369.994 Hz A = 415.305 Hz B = 466.164 Hz © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 49. Básico do básico C D E F G A B = C maior C G D A E = pentatônica em C F G A C D = pentatônica em F C E F F G B C = Blues! © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 50. MIDI, OSC Protocolos de comunicação como quaisquer outros Ubíquos • Ok, OSC nem tanto... Simples Latência é o fator mais importante • Antigamente, hardware/cabos especiais • Hoje, Ethernet, USB e até Wi-Fi © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 51. OSC UDP Simples Pequenos pacotes Baixa latência https://github.com/maca/ruby-osc https://github.com/aberant/osc-ruby © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 52. OSC Suporte nativo no Monome Quartz Composer Ótimo para iniciantes! © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 53. MIDI Padrão indústria Suporte pelo OS GarageBand, Logic, Reason, Ableton Live!, etc Muita coisa legada • Meio gambiarrento • Protocolo ainda bastante atrelado a hardware © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 54. Midiator Biblioteca Ruby para iteração com MIDI https://github.com/bleything/midiator • gem install midiator Extremamente simples Multi-plataforma • Software synth incluído para a versão Mac © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 55. Midiator require 'rubygems' require 'midiator' 2.times do [G3, A3, G3, F3].each { |note| midi = MIDIator::Interface.new midi.play note, 0.250 } midi.use :dls_synth midi.play E3, 0.5 midi.play C3, 1 include MIDIator::Notes end Mac Only! 2.times do 2.times do [C3, D3, E3, C3].each{ |note| midi.play note, 0.5 } midi.play C3, 0.5 end midi.play G3, 0.5 midi.play C3, 1.0 2.times do end midi.play E3, 0.5 midi.play F3, 0.5 midi.play G3, 1 end © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 56. Archaeopteryx Gerador de MIDI real-time, usando live coding github.com/gilesbowkett/archaeopteryx Sequenciador de batidas que permite a criação de ritmos como Drum’n’Bass, Techno e Ambient Probabilidade para gerar comportamentos randômicos e “improvisações” © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 57. A seguir, algumas palavras soltas... ...para você se divertir no Google © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 58. sierpinski - chiptunes - mandelbrot - fibonacci - fractals - hypercube - game of life - arduino - monome - chuck - circuit bending - escher - sistemas de particulas - supercollider - pure data - quartz composer - reactable - c’74 max © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 59. Livros The Computational Beauty of Nature Gödel, Escher, Bach: An Eternal Golden Braid Programming Interactivity: A Designer's Guide to Processing, Arduino, and Openframeworks Processing: A Programming Handbook for Visual Designers and Artists © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 60. Websites - Matemática e Arte http://www.maths.surrey.ac.uk/hosted-sites/R.Knott/ Fibonacci/fibInArt.html • Proporção áurea e Números de Fibonacci nas artes, arquitetura e música. http://www.2dcurves.com/ • Coleção de curvas matemáticas http://www.cut-the-knot.org/manifesto/index.shtml • Manifesto matemática-arte © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 61. Websites - Visuais http://www.complexification.net/ • Exemplos de obras feitas com Processing (incluindo a imagem da capa desta apresentação) http://openprocessing.org • Agregador de animações feitas com Processing(incluindo a imagem mostrada no último slide desta apresentação) http://www.contextfreeart.org/ • Site sobre context-free art © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 62. Websites - Áudio http://upload.wikimedia.org/wikipedia/commons/9/97/ Fibonacci.ogg • Composição musical feita com os números de Fibonacci http://botverse.com/music-and-mathematics-finding-the- natural-and-the-pentathonic-scales/5 http://thinkzone.wlonk.com/Music/12Tone.htm • Explicação matemática para as escalas musicais © 2011 ThoughtWorks, Ltd. All rights reserved.
  • 63. Obrigado! ”Mathematics, as much as music or any other art, is one of the means by which we rise to a complete self-consciousness. The significance of Mathematics resides precisely in the fact that it is an art; by informing us of the nature of our own minds it informs us of much that depends on our minds.” - J.W.N.Sullivan (1886-1937), Aspects of Science, 1925. Entre em contato Carlos Villela cv@lixo.org Thiago Bueno tbueno@gmail.com