SlideShare uma empresa Scribd logo
1 de 59
The Art, Joy, & Power of
Creating Musical Programs
David Koelle @dmkoelle
#JFugue
play(“C”);
Musically-Inclined Programmers!
Programming-Inclined Musicians!
Anyone who wants to infuse fun
into programming!
Who is JFugue for?
import org.jfugue.player.Player;
public class HelloWorld {
public static void main(String[] args) {
Player player = new Player();
player.play(“C”);
}
}
“Hello, World!” in JFugue
import org.jfugue.player.Player;
public class HelloWorld {
public static void main(String[] args) {
Player player = new Player();
player.play(“C”);
}
}
“Hello, World!” in JFugue
Sequencer sequencer = MidiSystem.getSequencer();
Sequence sequence = sequencer.getSequence();
Track track = sequence.createTrack();
ShortMessage onMessage = new ShortMessage();
onMessage.setMessage(ShortMessage.NOTE_ON, 0, 60, 128);
MidiEvent noteOnEvent = new MidiEvent(onMessage, 0);
track.add(noteOnEvent);
ShortMessage offMessage = new ShortMessage();
offMessage.setMessage(ShortMessage.NOTE_OFF, 0, 60, 128);
MidiEvent noteOffEvent = new MidiEvent(offMessage, 200);
track.add(noteOffEvent);
sequencer.start();
try {
Thread.sleep(track.ticks());
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
}
“Hello, World!” without JFugue
public class TwelveBarBlues {
public static void main(String[] args) {
Pattern pattern = new ChordProgression(“I IV V”)
.distribute(“7%6”)
.allChordsAs(“$0 $0 $0 $0 $1 $1 $0 $0 $2 $1 $0 $0”)
.eachChordAs(“$0i $1i $2i $3i $4i $3i $2i $1i”)
.getPattern()
.setInstrument(“Acoustic Bass”)
.setTempo(120);
new Player().play(pattern);
}
}
Advanced JFugue… still fits on one slide
Real-World Examples
Log Files Classic Novels
Log Files Classic Novels
Brian Tarbox
“I want to know
the status of
my video
servers without
staring at a
screen.”
time
video server log files
time
video server log files
o server log files
video stream is created
video stream has failed
video stream is tricked
video stream is destroyed
video content is added
SNMP trap emitted
Interesting Events in Video On Demand
(a video stream is content that is being played)
video stream is created
video stream has failed
video stream is tricked
video stream is destroyed
video content is added
SNMP trap emitted
Interesting Events in Video On Demand
video stream is created
video stream is destroyed
video stream has failed
[BASS_DRUM]s
[ACOUSTIC_SNARE]s
[CRASH_CYMBAL_1]s
Mapping Events to Music
Listening to Video on Demand Servers
Learn more at
Log4JFugue.org
Winner,
2010 Duke’s
Choice Award
Integrates with
Spring Framework
Scala version
now available
Log Files Classic Novels
Hannah Davis
“I want to
create a new
interactive
experience to
perceive classic
novels.”
TransProse creates music
from literature
Songs are based on the emotional
content of a novel
Introducing TransProse
unique word prevalence
average sentence length
book length
punctuation
presence of main characters
descriptive words
chapters/sections
changes between tones/moods
narrator perspective
pacing, plot action/movement
locations/environment
overall mood/tone/emotion
real world or mental landscape
smaller individual scenes
character ages, voices
time period
average syllable count
amount of dialog
Textual Things to Analyze
unique word prevalence
average sentence length
book length
punctuation
presence of main characters
descriptive words
chapters/sections
changes between tones/moods
narrator perspective
pacing, plot action/movement
locations/environment
overall mood/tone/emotion
real world or mental landscape
smaller individual scenes
character ages, voices
time period
average syllable count
amount of dialog
Textual Things to Analyze
Emolex – 14K tagged words
The Art of Making the Music
Stable Tones
Emotion Counts
Musical Considerations
Melodic Shape
minor/major key
tempo
note duration
harmony
pitch
changing between keys
different instrument voices
rhythm
time signature
melody
lyrics/vocals
# of notes in key used
(complexity)
Musical Elements to Use
minor/major key
tempo
note duration
harmony
pitch
changing between keys
different instrument voices
rhythm
time signature
melody
lyrics/vocals
# of notes in key used
(complexity)
Musical Elements to Use
amount of emotion
low emotion counts
high emotion counts
spikes in emotion
active:passive emotions
positive:negative emotion
amt of emotion per section
total emotions in chapter
prevalent emotions in novel
stability of note from root note
more consonant notes
more dissonant notes
interesting melodic movement
tempo
major/minor key and octave
note duration
main melody
additional melodies
Mappings From Analysis to Music
Learn more at
MusicFromText.com
TIME
Discovery
Wired
io9
NBC
Engadget
Fast Company
Popular Science
CNET
Der Spiegel
Le Monde
…
Lots of press
More complex music
Motifs for main
characters
Additional
instruments and
genres
Future Work
More Real-World Examples
Interactive Experiences & Games
Algorithmic/Generative Music
Music Based on Data
Education
Art & Design
Software Support for Cultural Music
General Categories
SoundOfShopping.com
Turning barcodes into music
“I'm analyzing microblogs like YikYak,
Tumblr and Twitter to get trending
topics. I'm trying to translate text to
quantitative data (semantics, topic,
gender, time of day, etc.) to then
interpolate and put through a genetic
algorithm to generate music.”
-Tyler
Music from Live-Streaming Data
Making Music from a Chess Match
Soundtrack for Astrophotography Show
Based on 6000 naked-eye stars:
declination (latitude)  pitch
right ascension (longitude)  time
magnitude  volume and duration
“Since JFugue can turn MIDI into text,
algorithmically created music can be
made using the same technology your
phone uses for predicting the next word”
www.frizzythegame.com
brendan@frizzythegame.com
JFugue and Markov chaining
A Tour of the Magic of JFugue
Easy to Use
Based on Music Theory
Fun Things are Baked In
Consistent “System”
Event-Based Architecture
Five Bits of JFugue Magic
Play music with two lines of code:
Player player = new Player();
player.play(“C”);
Ease of Use
Music is easy to specify
and intentionally human-readable
C Middle-C
C#6h C# note, 6th octave, half duration
EbMAJ^w E-flat major chord, first inversion,
whole duration
Ease of Use
Music is easy to specify
and intentionally human-readable
I[Flute] Change instrument to Flute
T[Allegro] Change tempo to Allegro (120bpm)
m560.8q Play a 560.8 Hz tone at ¼-duration
Rq Rest (takes duration just like a note)
Ease of Use
Pattern melodyVerseOne = new Pattern("T115 V0
I[Synth_Choir]")
.add("Bi B B Ai Gi Bihi Bi Bi Bi Aqi F#ih Rhi F#i Ai Bi")
.add("Aqit Ehtq Rhs Gi Aqi+C#6qi Bi+D6i Aih+C#6ih
Rhqi B5i")
.add("Bi B B Ai Gi Bihi Bi Bi Bi Aqi F#ih Rhi F#i Ai Bi")
.add("Aqit Ehtq Rhs Gi Aqi+C#6qi Bi+D6i Aih+C#6ih Rh
B D6");
Ease of Use
public class TwelveBarBlues {
public static void main(String[] args) {
Pattern pattern = new ChordProgression(“I IV V”)
.distribute(“7%6”)
.allChordsAs(“$0 $0 $0 $0 $1 $1 $0 $0 $2 $1 $0 $0”)
.eachChordAs(“$0i $1i $2i $3i $4i $3i $2i $1i”)
.getPattern()
.setInstrument(“Acoustic Bass”)
.setTempo(120);
new Player().play(pattern);
}
}
Ease of “Expression”
Define a Scale in terms of Intervals
Define a Chord in terms of Intervals
Create a “I IV V” Chord Progression
Set the Root of a Chord Progression
Get the Chords from a Chord Progression
Get the Notes from a Chord
…
Based on Music Theory
Rhythm rhythm = new Rhythm()
.addLayer("O..oO...O..oOO..")
.addLayer("..S...S...S...S.")
.addLayer("````````````````")
.addLayer("...............+");
new Player()
.play(rhythm.getPattern().repeat(2));
Fun Things are Baked In
Pattern prog = ChordProgression
.fromChords("C#4min E4maj B3maj A3maj")
.eachChordAs("$_i $_i Ri $_i")
.getPattern()
.setInstrument("GUITAR")
.setVoice(0);
Rhythm rhythm = new Rhythm()
.addLayer("..X...X...X...XO");
new Player()
.play(new Pattern(prog, rhythm).repeat(2));
Consistent “System”
MidiParser parser = new MidiParser();
LilyPondListener listener =
new LilyPondListener();
parser.addListener(listener);
parser.parse(midi sequence);
listener.displayEngravedSheetMusic();
Event-Based Architecture
StaccatoParser parser = new StaccatoParser();
LilyPondListener listener =
new LilyPondListener();
parser.addListener(listener);
parser.parse(“C D E F G A B”);
listener.displayEngravedSheetMusic();
Event-Based Architecture
StaccatoParser parser = new StaccatoParser();
MusicXmlListener listener =
new MusicXmlListener();
parser.addListener(listener);
parser.parse(“C D E F G A B”);
listener.save(new File(“my_song.xml”));
Event-Based Architecture
MidiParser parser = new MidiParser();
MyParserListener listener = new MyParserListener();
parser.addParserListener(listener);
parser.parse(MidiSystem.getSequence(new File(“some midi file")));
System.out.println("There are "+listener.counter+" 'C' notes in this music.");
class MyParserListener extends ParserListenerAdapter {
public int counter;
@Override
public void onNoteParsed(Note note) {
if (note.getPositionInOctave() == 0) {
counter++;
}
}
}
Event-Based Architecture
Sending to / Receiving from MIDI Devices
Creating New Patterns in Real-Time
Sending Musical Events “Before” They Occur
Extending the Staccato Parser
Using Replacement Maps to Play Solfege
Writing Functions for Musical Effects (e.g., Trill)
Scratching the Surface…
Making Music from DNA
Making Music from DNA
Many people have done this many ways…
http://www.mimg.ucla.edu/faculty/miller_jh/gene2music/
previouswork.html
Download JFugue
Make beautiful and creative things!
http://www.jfugue.org
Optionally:
Contribute to JFugue!
Live coding, Tools for Melodic Structure,
Making Awesome Music…
What Next?
Thank You!
David Koelle @dmkoelle
#JFugue

Mais conteúdo relacionado

Mais procurados

Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
Anderson Dantas
 
(Ab)Using the MetaCPAN API for Fun and Profit
(Ab)Using the MetaCPAN API for Fun and Profit(Ab)Using the MetaCPAN API for Fun and Profit
(Ab)Using the MetaCPAN API for Fun and Profit
Olaf Alders
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
Anton Arhipov
 

Mais procurados (20)

Intro to OTP in Elixir
Intro to OTP in ElixirIntro to OTP in Elixir
Intro to OTP in Elixir
 
Clustering com numpy e cython
Clustering com numpy e cythonClustering com numpy e cython
Clustering com numpy e cython
 
The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189The Ring programming language version 1.6 book - Part 48 of 189
The Ring programming language version 1.6 book - Part 48 of 189
 
Build a compiler in 2hrs - NCrafts Paris 2015
Build a compiler in 2hrs -  NCrafts Paris 2015Build a compiler in 2hrs -  NCrafts Paris 2015
Build a compiler in 2hrs - NCrafts Paris 2015
 
Go for the paranoid network programmer
Go for the paranoid network programmerGo for the paranoid network programmer
Go for the paranoid network programmer
 
Investigating Python Wats
Investigating Python WatsInvestigating Python Wats
Investigating Python Wats
 
穏やかにファイルを削除する
穏やかにファイルを削除する穏やかにファイルを削除する
穏やかにファイルを削除する
 
Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)
Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)
Stop Guessing and Start Measuring - Benchmarking in Practice (Lambdadays)
 
(Fun clojure)
(Fun clojure)(Fun clojure)
(Fun clojure)
 
PubNative Tracker
PubNative TrackerPubNative Tracker
PubNative Tracker
 
Java Unicode with Live GUI Examples
Java Unicode with Live GUI ExamplesJava Unicode with Live GUI Examples
Java Unicode with Live GUI Examples
 
Java Unicode with Cool GUI Examples
Java Unicode with Cool GUI ExamplesJava Unicode with Cool GUI Examples
Java Unicode with Cool GUI Examples
 
(Ab)Using the MetaCPAN API for Fun and Profit
(Ab)Using the MetaCPAN API for Fun and Profit(Ab)Using the MetaCPAN API for Fun and Profit
(Ab)Using the MetaCPAN API for Fun and Profit
 
Five
FiveFive
Five
 
The Magic Of Elixir
The Magic Of ElixirThe Magic Of Elixir
The Magic Of Elixir
 
League of Graphs
League of GraphsLeague of Graphs
League of Graphs
 
The Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's PerspectiveThe Browser Environment - A Systems Programmer's Perspective
The Browser Environment - A Systems Programmer's Perspective
 
Clojure入門
Clojure入門Clojure入門
Clojure入門
 
Introduction to Groovy
Introduction to GroovyIntroduction to Groovy
Introduction to Groovy
 
Ohm
OhmOhm
Ohm
 

Semelhante a The Art, Joy, and Power of Creating Musical Programs (JFugue at SXSW Interactive 2015)

JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
JamSketch: Improvisation Support System with GA-based Melody Creation from Us...JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
kthrlab
 
Nathan mather rage sound design in computer games analysis work sheet
Nathan mather rage sound design in computer games analysis work sheetNathan mather rage sound design in computer games analysis work sheet
Nathan mather rage sound design in computer games analysis work sheet
nazaryth98
 
Alpan Aytekin-Game Audio Essentials
Alpan Aytekin-Game Audio EssentialsAlpan Aytekin-Game Audio Essentials
Alpan Aytekin-Game Audio Essentials
gamedevelopersturkey
 
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
ARCHANASTOREKOTA
 

Semelhante a The Art, Joy, and Power of Creating Musical Programs (JFugue at SXSW Interactive 2015) (20)

Video Game Music Overview
Video Game Music OverviewVideo Game Music Overview
Video Game Music Overview
 
What Shazam doesn't want you to know
What Shazam doesn't want you to knowWhat Shazam doesn't want you to know
What Shazam doesn't want you to know
 
Game Audio Post-Production
Game Audio Post-ProductionGame Audio Post-Production
Game Audio Post-Production
 
Problems and Solutions in Game Audio
Problems and Solutions in Game AudioProblems and Solutions in Game Audio
Problems and Solutions in Game Audio
 
Music as data
Music as dataMusic as data
Music as data
 
Ig1 task 2 analysis work sheet walking dead
Ig1 task 2 analysis work sheet walking deadIg1 task 2 analysis work sheet walking dead
Ig1 task 2 analysis work sheet walking dead
 
인공지능의 음악 인지 모델 - 65차 한국음악지각인지학회 기조강연 (최근우 박사)
인공지능의 음악 인지 모델 - 65차 한국음악지각인지학회 기조강연 (최근우 박사)인공지능의 음악 인지 모델 - 65차 한국음악지각인지학회 기조강연 (최근우 박사)
인공지능의 음악 인지 모델 - 65차 한국음악지각인지학회 기조강연 (최근우 박사)
 
Nothing Odd about Audio
Nothing Odd about AudioNothing Odd about Audio
Nothing Odd about Audio
 
JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
JamSketch: Improvisation Support System with GA-based Melody Creation from Us...JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
JamSketch: Improvisation Support System with GA-based Melody Creation from Us...
 
Brienna hick the last of us cutscene audio
Brienna hick the last of us cutscene audioBrienna hick the last of us cutscene audio
Brienna hick the last of us cutscene audio
 
Nathan mather rage sound design in computer games analysis work sheet
Nathan mather rage sound design in computer games analysis work sheetNathan mather rage sound design in computer games analysis work sheet
Nathan mather rage sound design in computer games analysis work sheet
 
Ig1 task 2 analysis work sheet mass effect
Ig1 task 2 analysis work sheet mass effect Ig1 task 2 analysis work sheet mass effect
Ig1 task 2 analysis work sheet mass effect
 
Artificial intelligence and Music
Artificial intelligence and MusicArtificial intelligence and Music
Artificial intelligence and Music
 
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
Core Audio: Don't Be Afraid to Play it LOUD! [360iDev, San Jose 2010]
 
Alpan Aytekin-Game Audio Essentials
Alpan Aytekin-Game Audio EssentialsAlpan Aytekin-Game Audio Essentials
Alpan Aytekin-Game Audio Essentials
 
Experiential Audio
Experiential AudioExperiential Audio
Experiential Audio
 
Core audio
Core audioCore audio
Core audio
 
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
8.8 Program Playlist (Java)You will be building a linked list. Ma.pdf
 
제 5회 DGMIT R&D 컨퍼런스: Sound Module With OperSLEs
제 5회 DGMIT R&D 컨퍼런스: Sound Module With OperSLEs제 5회 DGMIT R&D 컨퍼런스: Sound Module With OperSLEs
제 5회 DGMIT R&D 컨퍼런스: Sound Module With OperSLEs
 
Deep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problemDeep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problem
 

Último

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
VictoriaMetrics
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 

The Art, Joy, and Power of Creating Musical Programs (JFugue at SXSW Interactive 2015)

  • 1. The Art, Joy, & Power of Creating Musical Programs David Koelle @dmkoelle #JFugue
  • 3. Musically-Inclined Programmers! Programming-Inclined Musicians! Anyone who wants to infuse fun into programming! Who is JFugue for?
  • 4. import org.jfugue.player.Player; public class HelloWorld { public static void main(String[] args) { Player player = new Player(); player.play(“C”); } } “Hello, World!” in JFugue
  • 5. import org.jfugue.player.Player; public class HelloWorld { public static void main(String[] args) { Player player = new Player(); player.play(“C”); } } “Hello, World!” in JFugue
  • 6. Sequencer sequencer = MidiSystem.getSequencer(); Sequence sequence = sequencer.getSequence(); Track track = sequence.createTrack(); ShortMessage onMessage = new ShortMessage(); onMessage.setMessage(ShortMessage.NOTE_ON, 0, 60, 128); MidiEvent noteOnEvent = new MidiEvent(onMessage, 0); track.add(noteOnEvent); ShortMessage offMessage = new ShortMessage(); offMessage.setMessage(ShortMessage.NOTE_OFF, 0, 60, 128); MidiEvent noteOffEvent = new MidiEvent(offMessage, 200); track.add(noteOffEvent); sequencer.start(); try { Thread.sleep(track.ticks()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } “Hello, World!” without JFugue
  • 7. public class TwelveBarBlues { public static void main(String[] args) { Pattern pattern = new ChordProgression(“I IV V”) .distribute(“7%6”) .allChordsAs(“$0 $0 $0 $0 $1 $1 $0 $0 $2 $1 $0 $0”) .eachChordAs(“$0i $1i $2i $3i $4i $3i $2i $1i”) .getPattern() .setInstrument(“Acoustic Bass”) .setTempo(120); new Player().play(pattern); } } Advanced JFugue… still fits on one slide
  • 11. Brian Tarbox “I want to know the status of my video servers without staring at a screen.”
  • 14. o server log files
  • 15. video stream is created video stream has failed video stream is tricked video stream is destroyed video content is added SNMP trap emitted Interesting Events in Video On Demand (a video stream is content that is being played)
  • 16. video stream is created video stream has failed video stream is tricked video stream is destroyed video content is added SNMP trap emitted Interesting Events in Video On Demand
  • 17. video stream is created video stream is destroyed video stream has failed [BASS_DRUM]s [ACOUSTIC_SNARE]s [CRASH_CYMBAL_1]s Mapping Events to Music
  • 18. Listening to Video on Demand Servers
  • 19. Learn more at Log4JFugue.org Winner, 2010 Duke’s Choice Award Integrates with Spring Framework Scala version now available
  • 21. Hannah Davis “I want to create a new interactive experience to perceive classic novels.”
  • 22. TransProse creates music from literature Songs are based on the emotional content of a novel Introducing TransProse
  • 23. unique word prevalence average sentence length book length punctuation presence of main characters descriptive words chapters/sections changes between tones/moods narrator perspective pacing, plot action/movement locations/environment overall mood/tone/emotion real world or mental landscape smaller individual scenes character ages, voices time period average syllable count amount of dialog Textual Things to Analyze
  • 24. unique word prevalence average sentence length book length punctuation presence of main characters descriptive words chapters/sections changes between tones/moods narrator perspective pacing, plot action/movement locations/environment overall mood/tone/emotion real world or mental landscape smaller individual scenes character ages, voices time period average syllable count amount of dialog Textual Things to Analyze
  • 25. Emolex – 14K tagged words
  • 26. The Art of Making the Music
  • 27. Stable Tones Emotion Counts Musical Considerations Melodic Shape
  • 28. minor/major key tempo note duration harmony pitch changing between keys different instrument voices rhythm time signature melody lyrics/vocals # of notes in key used (complexity) Musical Elements to Use
  • 29. minor/major key tempo note duration harmony pitch changing between keys different instrument voices rhythm time signature melody lyrics/vocals # of notes in key used (complexity) Musical Elements to Use
  • 30. amount of emotion low emotion counts high emotion counts spikes in emotion active:passive emotions positive:negative emotion amt of emotion per section total emotions in chapter prevalent emotions in novel stability of note from root note more consonant notes more dissonant notes interesting melodic movement tempo major/minor key and octave note duration main melody additional melodies Mappings From Analysis to Music
  • 31.
  • 32.
  • 33. Learn more at MusicFromText.com TIME Discovery Wired io9 NBC Engadget Fast Company Popular Science CNET Der Spiegel Le Monde … Lots of press More complex music Motifs for main characters Additional instruments and genres Future Work
  • 35. Interactive Experiences & Games Algorithmic/Generative Music Music Based on Data Education Art & Design Software Support for Cultural Music General Categories
  • 37. “I'm analyzing microblogs like YikYak, Tumblr and Twitter to get trending topics. I'm trying to translate text to quantitative data (semantics, topic, gender, time of day, etc.) to then interpolate and put through a genetic algorithm to generate music.” -Tyler Music from Live-Streaming Data
  • 38. Making Music from a Chess Match
  • 39. Soundtrack for Astrophotography Show Based on 6000 naked-eye stars: declination (latitude)  pitch right ascension (longitude)  time magnitude  volume and duration
  • 40. “Since JFugue can turn MIDI into text, algorithmically created music can be made using the same technology your phone uses for predicting the next word” www.frizzythegame.com brendan@frizzythegame.com JFugue and Markov chaining
  • 41. A Tour of the Magic of JFugue
  • 42. Easy to Use Based on Music Theory Fun Things are Baked In Consistent “System” Event-Based Architecture Five Bits of JFugue Magic
  • 43. Play music with two lines of code: Player player = new Player(); player.play(“C”); Ease of Use
  • 44. Music is easy to specify and intentionally human-readable C Middle-C C#6h C# note, 6th octave, half duration EbMAJ^w E-flat major chord, first inversion, whole duration Ease of Use
  • 45. Music is easy to specify and intentionally human-readable I[Flute] Change instrument to Flute T[Allegro] Change tempo to Allegro (120bpm) m560.8q Play a 560.8 Hz tone at ¼-duration Rq Rest (takes duration just like a note) Ease of Use
  • 46. Pattern melodyVerseOne = new Pattern("T115 V0 I[Synth_Choir]") .add("Bi B B Ai Gi Bihi Bi Bi Bi Aqi F#ih Rhi F#i Ai Bi") .add("Aqit Ehtq Rhs Gi Aqi+C#6qi Bi+D6i Aih+C#6ih Rhqi B5i") .add("Bi B B Ai Gi Bihi Bi Bi Bi Aqi F#ih Rhi F#i Ai Bi") .add("Aqit Ehtq Rhs Gi Aqi+C#6qi Bi+D6i Aih+C#6ih Rh B D6"); Ease of Use
  • 47. public class TwelveBarBlues { public static void main(String[] args) { Pattern pattern = new ChordProgression(“I IV V”) .distribute(“7%6”) .allChordsAs(“$0 $0 $0 $0 $1 $1 $0 $0 $2 $1 $0 $0”) .eachChordAs(“$0i $1i $2i $3i $4i $3i $2i $1i”) .getPattern() .setInstrument(“Acoustic Bass”) .setTempo(120); new Player().play(pattern); } } Ease of “Expression”
  • 48. Define a Scale in terms of Intervals Define a Chord in terms of Intervals Create a “I IV V” Chord Progression Set the Root of a Chord Progression Get the Chords from a Chord Progression Get the Notes from a Chord … Based on Music Theory
  • 49. Rhythm rhythm = new Rhythm() .addLayer("O..oO...O..oOO..") .addLayer("..S...S...S...S.") .addLayer("````````````````") .addLayer("...............+"); new Player() .play(rhythm.getPattern().repeat(2)); Fun Things are Baked In
  • 50. Pattern prog = ChordProgression .fromChords("C#4min E4maj B3maj A3maj") .eachChordAs("$_i $_i Ri $_i") .getPattern() .setInstrument("GUITAR") .setVoice(0); Rhythm rhythm = new Rhythm() .addLayer("..X...X...X...XO"); new Player() .play(new Pattern(prog, rhythm).repeat(2)); Consistent “System”
  • 51. MidiParser parser = new MidiParser(); LilyPondListener listener = new LilyPondListener(); parser.addListener(listener); parser.parse(midi sequence); listener.displayEngravedSheetMusic(); Event-Based Architecture
  • 52. StaccatoParser parser = new StaccatoParser(); LilyPondListener listener = new LilyPondListener(); parser.addListener(listener); parser.parse(“C D E F G A B”); listener.displayEngravedSheetMusic(); Event-Based Architecture
  • 53. StaccatoParser parser = new StaccatoParser(); MusicXmlListener listener = new MusicXmlListener(); parser.addListener(listener); parser.parse(“C D E F G A B”); listener.save(new File(“my_song.xml”)); Event-Based Architecture
  • 54. MidiParser parser = new MidiParser(); MyParserListener listener = new MyParserListener(); parser.addParserListener(listener); parser.parse(MidiSystem.getSequence(new File(“some midi file"))); System.out.println("There are "+listener.counter+" 'C' notes in this music."); class MyParserListener extends ParserListenerAdapter { public int counter; @Override public void onNoteParsed(Note note) { if (note.getPositionInOctave() == 0) { counter++; } } } Event-Based Architecture
  • 55. Sending to / Receiving from MIDI Devices Creating New Patterns in Real-Time Sending Musical Events “Before” They Occur Extending the Staccato Parser Using Replacement Maps to Play Solfege Writing Functions for Musical Effects (e.g., Trill) Scratching the Surface…
  • 57. Making Music from DNA Many people have done this many ways… http://www.mimg.ucla.edu/faculty/miller_jh/gene2music/ previouswork.html
  • 58. Download JFugue Make beautiful and creative things! http://www.jfugue.org Optionally: Contribute to JFugue! Live coding, Tools for Melodic Structure, Making Awesome Music… What Next?
  • 59. Thank You! David Koelle @dmkoelle #JFugue

Notas do Editor

  1. I am so glad you could be here today. Welcome to The Art, Joy, and Power of Creating Musical Programs. My name is David Koelle. I am the author of JFugue, which is a music programming library for Java and other JVM languages, like Scala. Today, we’re going to see how people around the world are using music programming to change how we perceive and experience everyday things, And I’ll show you how you can create your own magic through music.
  2. JFugue started as a personal journey that was both a reflection of the past and the promise of the future. Along the way, beautiful things grew. It’s a simple notion: I want people to be able to program music as easily as humanly possible. My initial inspiration came in the mid-80’s. I was twelve. I had a Commodore-128 computer. And with that computer, I created music with a command in the BASIC language called “play”. This enthralled me! It helped cement my interest in programming. And made programming fun and joyful. Back then, my only perception about programming was that it was fun and joyful. And then, times changed. Computers and languages got more advanced. And the thing that I once found as a simple pleasure was insanely difficult to do. In the world of modern technology, I couldn’t play music anymore. Now clearly, musical technology advanced. We have amazing digital audio workstations, distribution of MP3s became commonplace, and music recommender systems point us to new music that we might like. But these are either digital instruments for making an audio recording, or involve listening to audio recordings that other people have already created. The ability for an everyday person to easily and simply create a musical program – a program that can make music in response to changing conditions in the world, a program that can be more than a recording of one’s instrument but could be based on that artistic hand to craft generative music – that ability was gone. So this is my quest: to introduce the beauty of what you see on the screen to the world. I’m here today because I have several exciting things to share with you. First, play(“C”) exists! And not only does play(“C”) exist, but all of these other bits of magic have sprung up to create a joyful and musically sound playground in which to explore and easily create new musical ideas. This is the essence JFugue. On the surface, JFugue is a music programming library. it’s a jar file. Its default output is MIDI music. But it contains so much more, and I look forward to sharing these ideas with you in the next hour. Second, people all around the world are using JFugue to do phenomenally interesting things. I’ll show you a sample of those today. And third, this sets the stage for a future in which we can easily engage our auditory sense in ways that have been prohibitively difficult to explore in the past, and this is a new angle to inspire tomorrow’s musicians and developers to explore the fun of music and of programming. ***Make sure I answer here: What is music programming, and why is it artful, joyful, and powerful? Optional content / things to consider working in: There is something fundamentally different about being able to program music. First, it means you can produce music that is responsive to an environment, to context. That’s useful for art, for new ways of experiencing the world It’s useful for applications We have four types of applications that have sound in them: Error sounds Music playing applications like iTunes Music creation applications like Garageband or Ableton Live Games Is there utility for sound outside of entertainment? Is there room for entertainment to generate music? Generative applications: No Man’s Sky. Live coding. (Guzdial: Live coding inspires programming) (is live coding just another kind of musical instrument?)
  3. Can refer to Processing here ‘Anyone’: “I think of my 12-year-old self in that target audience” If Bach were around today, he would totally use JFugue
  4. [PART 2]
  5. “This is Brian Tarbox. Brian is a Software Engineer at a Video On Demand company. *CLICK* And Brian wants to know…” Enterprise scale applications are large and complex Knowing what an application is doing is hard One can spend many sleepless nights looking at enormous log files trying to figure out the cause of a customer problem
  6. Using the popular logging package Log4J
  7. There are two things you can do with a log file. You can watch it, but then you need to pay attention to it – this is application visualization Or you can listen to it, and attend to other work. Plus, you can get an innate sense for how badly things are going by the types of sounds you hear – this is application sonification Will it surprise you to know that Brian went with the listening idea?
  8. Tricking a stream means fast forward, pause, rewind. SNMP traps are emitted to tell other monitoring systems about what'd going on.
  9. We would expect to hear a steady pattern of creates and destroys, and only an occasional failure (As time allows, talk about some early decisions about chromatic vs. achromatic music, and talk about buffering rhythms)
  10. Log4JFugue earned a Duke's Choice award for Innovation. The Duke’s Choice Awards recognize and honor extreme innovation in the world of Java technology, and are granted to the most innovative uses of the Java platform. Because the primary judging criteria is innovation, the awards put even small developer shops on an equal footing with multinational giants. The winners are selected by Oracle’s Java technology leadership team
  11. Difficulties: Broke under certain number of words Misunderstandings
  12. Follow the arc of emotions, sampling total emotion count Increase melodic movement at particularly emotional points
  13. We would expect to hear a steady pattern of creates and destroys, and only an occasional failure
  14. TIME: This Is What Classic Novels Sound Like When a Computer Turns Them Into Piano Music Popular Science: Robot Reads Novels, Writes Songs About Them Wired: A Novel Approach To Composing io9: Researchers Train Computers to Manipulate Human Emotions with Art NBC: Score! Software Writes Music Based on Book's Content Engadget: New algorithm turns 'Lord of the Flies' into an emotional ballad Fast Company: Turn Your Favorite Books Into Original Music Scores Discovery: Beautiful Music Programmed from Famous Novels CNET: TransProse turns literature into music Vice: TransProse Turns Your Favorite Novels Into Original Music Scores Billboard: Computers, Classics and Cadenzas: Making Math Music From Literature Live Science: 'TransProse' Software Creates Musical Soundtracks from Books Der Spiegel: Automatischer Soundtrack: Software schreibt Musik nach Drehbuch Le Monde: La mélodie des mots Diario Correo: Conoce el programa convierte los libros en música Gizmodo Japan: 好きな小説からオリジナルの音楽を作れるプログラム「TransProse」 La Patilla: Crean un programa que convierte los libros en música Superinteressante: TransProse, o programa que transforma literatura em música Hyperallergic: New Algorithm Turns The Emotion of Language into Music  IBDA3World:  برنامج يُحولّ الكُتب إلى موسيقى TransProse
  15. [PART 2]
  16. Games: Guitar Hero, Piano Hero
  17. I'm structurally overanalyzing microblogs like YikYak, Tumblr and Twitter to get trending topics in the United States and to see how people feel about them. So I'm trying to translate text to quantitative data (semantics, topic, gender, time of day, etc) to then interpolate and put through a the L system (maybe a combination of that and a genetic algorithm later) to generate the music. Make a soundtrack for an audiovisual show for astrophotography (Graham Relf) - Sounds based on 6000 naked-eye stars using their declinations (celetsial latitudes) to determine pitch, RA (longititde) to determine when to sound, magnitude (brightness) volume and duration
  18. Games: Guitar Hero, Piano Hero
  19. Graham
  20. What he means here is Staccato
  21. This human-readable music specification is called Staccato. “Now I know there are other music representations out there!” MusicXML, ABC notation Why create yet another music specification?
  22. In MIDI, “Flute” is Instrument 73 Allegro is 120 bpm
  23. JFugue doesn’t just play notes, there is a solid foundation of music theory
  24. Staccato-to-MIDI happens to be the default, but you can do stuff like this
  25. Does anyone have any DNA on them?
  26. Many people have done this over a long period of time – over 30 years! There are a lot of ways to do this, it’s interesting work, and it’s fascinating to listen to. But it’s been done. Well, while I was making these slides, I was procrastinating on Facebook, and a friend of mine had posted a frightening animation from the European Space Agency on ocean acidification over the past 5 years. And I got an idea. Because while many people have turned DNA into music, I have not yet seen…