SlideShare a Scribd company logo
Generative Visuals using Hydra Zach Krall @zachkrall
Introduction to making generative
visuals using Hydra, a tool for live-
coding networked visuals
github.com/zachkrall/hydra-workshop
4:30 PM
Generative Visuals using Hydra Zach Krall @zachkrall
Zach Krall @zachkrall
Artist / Developer / Design Researcher
MFA Design + Technology student at
Parsons School of Design
Member of LiveCode.NYC
Generative Visuals using Hydra Zach Krall @zachkrall
Caution:
Some results for generative visuals
can cause really fast flashing and
rapid color changes.
Generative Visuals using Hydra Zach Krall @zachkrall
Generative Visuals using Hydra Zach Krall @zachkrall
Olivia Jack
github.com/ojack
Hydra: Live Coding networked visuals
presentation at International Conference
for Live Coding (ICLC) at Medialab Prado
(Madrid, Spain) 18 January 2019.
Generative Visuals using Hydra Zach Krall @zachkrall
https://www.youtube.com/watch?
v=VMTZSw4xqi4
Sandin Image Processor <https://en.wikipedia.org/wiki/VJing#/
media/File:Sandin_Image_Processor.jpg>
Generative Visuals using Hydra Zach Krall @zachkrall
Hydra takes an input → modifies it → and returns an output
Generative Visuals using Hydra Zach Krall @zachkrall
arrays
[ 20, 5, 30, 150 ]
// myArray[2] returns 30
integer
5
float
21.0
// function( x ){
// return x;
// }
( x ) => x
functions
Generative Visuals using Hydra Zach Krall @zachkrall
Layers, modifiers, output1
Evaluating code & custom functions2
Blending & webcam3
Reacting to sound4
Adding other sources ( video, image )5
Sharing across rtc-patch-bay6
Generative Visuals using Hydra Zach Krall @zachkrall
o0 o2
o1 o3
s0 s2
s1 s3
a
output buffersmedia sources audio input
osc
noise
gradient shape
voronoi
solid
base layers
Layers, modifiers, output1
Generative Visuals using Hydra Zach Krall @zachkrall
o0 o2
o1 o3
s0 s2
s1 s3
a
output buffersmedia sources audio input
osc
noise
gradient shape
voronoi
solid
base layers
modifiers
contrast color
invert luma
treshold
rotate
scale
kaleid
pixelate
blending
Generative Visuals using Hydra Zach Krall @zachkrall
out o0
saturate
pixelate
scale a (mic)
osc
modulate
s0 (webcam)
Generative Visuals using Hydra Zach Krall @zachkrall
out
modulate
o0
saturate
pixelate
scale a (mic)
osc
s0 (webcam)
Generative Visuals using Hydra Zach Krall @zachkrall
s0.initCam();
a.show();
a.setBins(3);
osc( 60, 0.1, 0 )
.modulate(
src(s0) , 2
)
.saturate( 0.7 )
.pixelate( 10 , 15 )
.scale(
() => a.fft[0]
).out( o0 );
render(o0);out
modulate
o0
saturate
pixelate
scale a (mic)
s0 (webcam)
osc
Generative Visuals using Hydra Zach Krall @zachkrall
hydra-editor.glitch.me
Evaluating code & custom functions2
Generative Visuals using Hydra Zach Krall @zachkrall
osc( ).out( );
to evaluate entire code
Ctrl + Shift + Enter
to evaluate single block
Ctrl + Enter
Generative Visuals using Hydra Zach Krall @zachkrall
noise( scale, speed ) voronoi( scale, speed ) gradient( speed )
osc( freq, speed, offset ) shape( sides, blur, scale )solid( red, green, blue )
Generative Visuals using Hydra Zach Krall @zachkrall
osc(
freq: how many times it repeats
across horizontal axis ,
speed: how quickly it scrolls
left (positive) or right (negative) ,
offset: separation of color layers
)
offset
Generative Visuals using Hydra Zach Krall @zachkrall
any parameter that accepts
a value can also accept a
function that returns a value
Generative Visuals using Hydra Zach Krall @zachkrall
shape(3)
.scale(
() => Math.sin(time)
)
.out()
Generative Visuals using Hydra Zach Krall @zachkrall
Generative Visuals using Hydra Zach Krall @zachkrall
Math.sin( ) // fluid looping animation
Math.abs( ) // keeps values positive
Math.random( ) // honestly like ... a lot
Generative Visuals using Hydra Zach Krall @zachkrall
Helpful Functions / Variables
Time (elapsed in milliseconds)
time
Mouse
mouse.x or mouse.y
// mouse = { x: , y: }
Window
window.innerWidth
window.innerHeight
Set Beats-Per-Minute
bpm(120);
Save Image
screencap();
Generative Visuals using Hydra Zach Krall @zachkrall
Iterating over array is built in!
shape( [3, 4] )
.out()
Generative Visuals using Hydra Zach Krall @zachkrall
Blending & webcam3
blend add mult diff
combine color
modulate modulateHue modulateKaleid modulatePixelate
modulateScale
combine coordinates
modulateRotate
Generative Visuals using Hydra Zach Krall @zachkrall
Generative Visuals using Hydra Zach Krall @zachkrall
out
o0
o1
o2
o0
diff
o2
o1
Generative Visuals using Hydra Zach Krall @zachkrall
out
o0
o1
o2
o0
diff
o2
o1
s0.initCam();
src(s0).color(1,0,0).out(o0);
osc(60, 0, 0).out(o2);
src( o0 )
.diff(
o2, 1
)
.out( o1 );
render( o1 );
Generative Visuals using Hydra Zach Krall @zachkrall
out
o0
modulateRotate
o2
o1
Generative Visuals using Hydra Zach Krall @zachkrall
s0.initCam(); s0.initScreen(); s0.clear();
Blending & webcam3
Generative Visuals using Hydra Zach Krall @zachkrall
s0.initScreen(4);
Generative Visuals using Hydra Zach Krall @zachkrall
Reacting to sound4 a
a.show()
a.setBins(4)
a.setSmooth()
a.hide()
a.fft // new Array(4)
// [ X, X, X, X ]
Generative Visuals using Hydra Zach Krall @zachkrall
a.show();
a.setBins(4);
shape( 3 )
.rotate(
() => Math.PI * mouse.x / 180
)
.repeatX( 3 )
.repeatY( 3 )
.scale(
() => a.fft[0]*4
)
.out( o0 );
render(o0);
Generative Visuals using Hydra Zach Krall @zachkrall
Adding other sources5
a source buffer expects an HTML element as input
s0.initCam();
<video
autoplay="true"
id="webcam">
</video>
Generative Visuals using Hydra Zach Krall @zachkrall
s0.init(
{
src: myElement , // variable that holds element
dynamic: false // set true for video
}
);
var myElement = document.createElement('img'); // <img />
myElement.src = '/path/to/img.jpg'; // <img src=" " />
Generative Visuals using Hydra Zach Krall @zachkrall
Sharing across rtc-patch-bay6
pb.setName("zachpb")
Share your output
pb.list()
Find other outputs
s0.initSource("zachpb")
Use stream as source
→ →
Must be connected to the same hydra server
e.g. localhost:8000 → http://192.1.1.10:8000
Generative Visuals using Hydra Zach Krall @zachkrall
social media
@zachkrall
email
zach@zachkrall.com
livecode lab
musiccommunitylab.org
livecode nyc
livecode.nyc

More Related Content

Similar to Hydra Workshop NYU Live Code Lab Feb 2019

Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Matt Raible
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
John Lee
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
Karol Depka Pradzinski
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
Juho Vepsäläinen
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden Engine
FAST
 
Scilab Codes Project Research Guidance
Scilab Codes Project Research GuidanceScilab Codes Project Research Guidance
Scilab Codes Project Research Guidance
Matlab Simulation
 
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando TechDocker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
Henning Jacobs
 
Real Time analytics with Druid, Apache Spark and Kafka
Real Time analytics with Druid, Apache Spark and KafkaReal Time analytics with Druid, Apache Spark and Kafka
Real Time analytics with Druid, Apache Spark and Kafka
Daria Litvinov
 
Installing Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGLInstalling Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGL
Corey Clark, Ph.D.
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
jaxconf
 
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VRHow to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
GeilDanke
 
ScilabTEC 2015 - Embedded Solutions
ScilabTEC 2015 - Embedded SolutionsScilabTEC 2015 - Embedded Solutions
ScilabTEC 2015 - Embedded Solutions
Scilab
 
Apache Spark for Library Developers with Erik Erlandson and William Benton
Apache Spark for Library Developers with Erik Erlandson and William BentonApache Spark for Library Developers with Erik Erlandson and William Benton
Apache Spark for Library Developers with Erik Erlandson and William Benton
Databricks
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan API
Tristan Lorach
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
KAI CHU CHUNG
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
David Keener
 

Similar to Hydra Workshop NYU Live Code Lab Feb 2019 (17)

Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
 
Android RenderScript on LLVM
Android RenderScript on LLVMAndroid RenderScript on LLVM
Android RenderScript on LLVM
 
D3.js and SVG
D3.js and SVGD3.js and SVG
D3.js and SVG
 
Survive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and TricksSurvive JavaScript - Strategies and Tricks
Survive JavaScript - Strategies and Tricks
 
Constructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden EngineConstructing 3D scenes with Woden Engine
Constructing 3D scenes with Woden Engine
 
Scilab Codes Project Research Guidance
Scilab Codes Project Research GuidanceScilab Codes Project Research Guidance
Scilab Codes Project Research Guidance
 
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando TechDocker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
Docker Berlin Meetup June 2015: Docker powering Radical Agility @ Zalando Tech
 
Real Time analytics with Druid, Apache Spark and Kafka
Real Time analytics with Druid, Apache Spark and KafkaReal Time analytics with Druid, Apache Spark and Kafka
Real Time analytics with Druid, Apache Spark and Kafka
 
Installing Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGLInstalling Games Sucks, Learn WebGL
Installing Games Sucks, Learn WebGL
 
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen ChinHacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
Hacking JavaFX with Groovy, Clojure, Scala, and Visage: Stephen Chin
 
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VRHow to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
How to Make Your Users Sick in 60 Seconds – About UX Design, WebVR and React VR
 
ScilabTEC 2015 - Embedded Solutions
ScilabTEC 2015 - Embedded SolutionsScilabTEC 2015 - Embedded Solutions
ScilabTEC 2015 - Embedded Solutions
 
Apache Spark for Library Developers with Erik Erlandson and William Benton
Apache Spark for Library Developers with Erik Erlandson and William BentonApache Spark for Library Developers with Erik Erlandson and William Benton
Apache Spark for Library Developers with Erik Erlandson and William Benton
 
vkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan APIvkFX: Effect(ive) approach for Vulkan API
vkFX: Effect(ive) approach for Vulkan API
 
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdfDevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
DevFest 2022 - Skaffold 2 Deep Dive Taipei.pdf
 
Creating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector GraphicsCreating Custom Charts With Ruby Vector Graphics
Creating Custom Charts With Ruby Vector Graphics
 
Retinex comparisons
Retinex comparisonsRetinex comparisons
Retinex comparisons
 

More from Zach Krall

MFADT - Parsons - Web Midterm [Final Version]
MFADT - Parsons - Web Midterm [Final Version]MFADT - Parsons - Web Midterm [Final Version]
MFADT - Parsons - Web Midterm [Final Version]
Zach Krall
 
MFADT - Parsons - Web Midterm [Draft]
MFADT - Parsons - Web Midterm [Draft]MFADT - Parsons - Web Midterm [Draft]
MFADT - Parsons - Web Midterm [Draft]
Zach Krall
 
MFADT Bootcamp - Parsons - Design Midterm
MFADT Bootcamp - Parsons - Design MidtermMFADT Bootcamp - Parsons - Design Midterm
MFADT Bootcamp - Parsons - Design Midterm
Zach Krall
 
christopher williams presentation - 13 november 2013
christopher williams presentation - 13 november 2013christopher williams presentation - 13 november 2013
christopher williams presentation - 13 november 2013
Zach Krall
 
SVA sophomore year portfolio
SVA sophomore year portfolioSVA sophomore year portfolio
SVA sophomore year portfolio
Zach Krall
 
Landscape Photography Today
Landscape Photography TodayLandscape Photography Today
Landscape Photography Today
Zach Krall
 

More from Zach Krall (6)

MFADT - Parsons - Web Midterm [Final Version]
MFADT - Parsons - Web Midterm [Final Version]MFADT - Parsons - Web Midterm [Final Version]
MFADT - Parsons - Web Midterm [Final Version]
 
MFADT - Parsons - Web Midterm [Draft]
MFADT - Parsons - Web Midterm [Draft]MFADT - Parsons - Web Midterm [Draft]
MFADT - Parsons - Web Midterm [Draft]
 
MFADT Bootcamp - Parsons - Design Midterm
MFADT Bootcamp - Parsons - Design MidtermMFADT Bootcamp - Parsons - Design Midterm
MFADT Bootcamp - Parsons - Design Midterm
 
christopher williams presentation - 13 november 2013
christopher williams presentation - 13 november 2013christopher williams presentation - 13 november 2013
christopher williams presentation - 13 november 2013
 
SVA sophomore year portfolio
SVA sophomore year portfolioSVA sophomore year portfolio
SVA sophomore year portfolio
 
Landscape Photography Today
Landscape Photography TodayLandscape Photography Today
Landscape Photography Today
 

Recently uploaded

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
DhatriParmar
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
Balvir Singh
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
thanhdowork
 

Recently uploaded (20)

The Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptxThe Accursed House by Émile Gaboriau.pptx
The Accursed House by Émile Gaboriau.pptx
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
Operation Blue Star - Saka Neela Tara
Operation Blue Star   -  Saka Neela TaraOperation Blue Star   -  Saka Neela Tara
Operation Blue Star - Saka Neela Tara
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
A Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptxA Survey of Techniques for Maximizing LLM Performance.pptx
A Survey of Techniques for Maximizing LLM Performance.pptx
 

Hydra Workshop NYU Live Code Lab Feb 2019

  • 1. Generative Visuals using Hydra Zach Krall @zachkrall Introduction to making generative visuals using Hydra, a tool for live- coding networked visuals github.com/zachkrall/hydra-workshop 4:30 PM
  • 2. Generative Visuals using Hydra Zach Krall @zachkrall Zach Krall @zachkrall Artist / Developer / Design Researcher MFA Design + Technology student at Parsons School of Design Member of LiveCode.NYC
  • 3. Generative Visuals using Hydra Zach Krall @zachkrall Caution: Some results for generative visuals can cause really fast flashing and rapid color changes.
  • 4. Generative Visuals using Hydra Zach Krall @zachkrall
  • 5. Generative Visuals using Hydra Zach Krall @zachkrall Olivia Jack github.com/ojack Hydra: Live Coding networked visuals presentation at International Conference for Live Coding (ICLC) at Medialab Prado (Madrid, Spain) 18 January 2019.
  • 6. Generative Visuals using Hydra Zach Krall @zachkrall https://www.youtube.com/watch? v=VMTZSw4xqi4 Sandin Image Processor <https://en.wikipedia.org/wiki/VJing#/ media/File:Sandin_Image_Processor.jpg>
  • 7. Generative Visuals using Hydra Zach Krall @zachkrall Hydra takes an input → modifies it → and returns an output
  • 8. Generative Visuals using Hydra Zach Krall @zachkrall arrays [ 20, 5, 30, 150 ] // myArray[2] returns 30 integer 5 float 21.0 // function( x ){ // return x; // } ( x ) => x functions
  • 9. Generative Visuals using Hydra Zach Krall @zachkrall Layers, modifiers, output1 Evaluating code & custom functions2 Blending & webcam3 Reacting to sound4 Adding other sources ( video, image )5 Sharing across rtc-patch-bay6
  • 10. Generative Visuals using Hydra Zach Krall @zachkrall o0 o2 o1 o3 s0 s2 s1 s3 a output buffersmedia sources audio input osc noise gradient shape voronoi solid base layers Layers, modifiers, output1
  • 11. Generative Visuals using Hydra Zach Krall @zachkrall o0 o2 o1 o3 s0 s2 s1 s3 a output buffersmedia sources audio input osc noise gradient shape voronoi solid base layers modifiers contrast color invert luma treshold rotate scale kaleid pixelate blending
  • 12. Generative Visuals using Hydra Zach Krall @zachkrall out o0 saturate pixelate scale a (mic) osc modulate s0 (webcam)
  • 13. Generative Visuals using Hydra Zach Krall @zachkrall out modulate o0 saturate pixelate scale a (mic) osc s0 (webcam)
  • 14. Generative Visuals using Hydra Zach Krall @zachkrall s0.initCam(); a.show(); a.setBins(3); osc( 60, 0.1, 0 ) .modulate( src(s0) , 2 ) .saturate( 0.7 ) .pixelate( 10 , 15 ) .scale( () => a.fft[0] ).out( o0 ); render(o0);out modulate o0 saturate pixelate scale a (mic) s0 (webcam) osc
  • 15. Generative Visuals using Hydra Zach Krall @zachkrall hydra-editor.glitch.me Evaluating code & custom functions2
  • 16. Generative Visuals using Hydra Zach Krall @zachkrall osc( ).out( ); to evaluate entire code Ctrl + Shift + Enter to evaluate single block Ctrl + Enter
  • 17. Generative Visuals using Hydra Zach Krall @zachkrall noise( scale, speed ) voronoi( scale, speed ) gradient( speed ) osc( freq, speed, offset ) shape( sides, blur, scale )solid( red, green, blue )
  • 18. Generative Visuals using Hydra Zach Krall @zachkrall osc( freq: how many times it repeats across horizontal axis , speed: how quickly it scrolls left (positive) or right (negative) , offset: separation of color layers ) offset
  • 19. Generative Visuals using Hydra Zach Krall @zachkrall any parameter that accepts a value can also accept a function that returns a value
  • 20. Generative Visuals using Hydra Zach Krall @zachkrall shape(3) .scale( () => Math.sin(time) ) .out()
  • 21. Generative Visuals using Hydra Zach Krall @zachkrall
  • 22. Generative Visuals using Hydra Zach Krall @zachkrall Math.sin( ) // fluid looping animation Math.abs( ) // keeps values positive Math.random( ) // honestly like ... a lot
  • 23. Generative Visuals using Hydra Zach Krall @zachkrall Helpful Functions / Variables Time (elapsed in milliseconds) time Mouse mouse.x or mouse.y // mouse = { x: , y: } Window window.innerWidth window.innerHeight Set Beats-Per-Minute bpm(120); Save Image screencap();
  • 24. Generative Visuals using Hydra Zach Krall @zachkrall Iterating over array is built in! shape( [3, 4] ) .out()
  • 25. Generative Visuals using Hydra Zach Krall @zachkrall Blending & webcam3 blend add mult diff combine color modulate modulateHue modulateKaleid modulatePixelate modulateScale combine coordinates modulateRotate
  • 26. Generative Visuals using Hydra Zach Krall @zachkrall
  • 27. Generative Visuals using Hydra Zach Krall @zachkrall out o0 o1 o2 o0 diff o2 o1
  • 28. Generative Visuals using Hydra Zach Krall @zachkrall out o0 o1 o2 o0 diff o2 o1 s0.initCam(); src(s0).color(1,0,0).out(o0); osc(60, 0, 0).out(o2); src( o0 ) .diff( o2, 1 ) .out( o1 ); render( o1 );
  • 29. Generative Visuals using Hydra Zach Krall @zachkrall out o0 modulateRotate o2 o1
  • 30. Generative Visuals using Hydra Zach Krall @zachkrall s0.initCam(); s0.initScreen(); s0.clear(); Blending & webcam3
  • 31. Generative Visuals using Hydra Zach Krall @zachkrall s0.initScreen(4);
  • 32. Generative Visuals using Hydra Zach Krall @zachkrall Reacting to sound4 a a.show() a.setBins(4) a.setSmooth() a.hide() a.fft // new Array(4) // [ X, X, X, X ]
  • 33. Generative Visuals using Hydra Zach Krall @zachkrall a.show(); a.setBins(4); shape( 3 ) .rotate( () => Math.PI * mouse.x / 180 ) .repeatX( 3 ) .repeatY( 3 ) .scale( () => a.fft[0]*4 ) .out( o0 ); render(o0);
  • 34. Generative Visuals using Hydra Zach Krall @zachkrall Adding other sources5 a source buffer expects an HTML element as input s0.initCam(); <video autoplay="true" id="webcam"> </video>
  • 35. Generative Visuals using Hydra Zach Krall @zachkrall s0.init( { src: myElement , // variable that holds element dynamic: false // set true for video } ); var myElement = document.createElement('img'); // <img /> myElement.src = '/path/to/img.jpg'; // <img src=" " />
  • 36. Generative Visuals using Hydra Zach Krall @zachkrall Sharing across rtc-patch-bay6 pb.setName("zachpb") Share your output pb.list() Find other outputs s0.initSource("zachpb") Use stream as source → → Must be connected to the same hydra server e.g. localhost:8000 → http://192.1.1.10:8000
  • 37. Generative Visuals using Hydra Zach Krall @zachkrall social media @zachkrall email zach@zachkrall.com livecode lab musiccommunitylab.org livecode nyc livecode.nyc