This document discusses JFugue, an open source library for programmatically generating music. It provides examples of using JFugue to play simple notes, generate musical patterns and chord progressions, integrate with MIDI systems, and parse musical data into other formats. The document highlights features like JFugue's ease of use, basis in music theory, built-in functions, consistent architecture, and event-based design. It also presents ideas for using JFugue like algorithmic music generation, interactive experiences, and education.
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
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
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
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
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
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?
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.
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?)
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
[PART 2]
“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
Using the popular logging package Log4J
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?
Tricking a stream means fast forward, pause, rewind.SNMP traps are emitted to tell other monitoring systems about what'd going on.
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)
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
Difficulties:
Broke under certain number of words
Misunderstandings
Follow the arc of emotions, sampling total emotion count
Increase melodic movement at particularly emotional points
We would expect to hear a steady pattern of creates and destroys, and only an occasional failure
TIME: This Is What Classic Novels Sound Like When a Computer Turns Them Into Piano MusicPopular Science: Robot Reads Novels, Writes Songs About ThemWired: A Novel Approach To Composingio9: Researchers Train Computers to Manipulate Human Emotions with ArtNBC: Score! Software Writes Music Based on Book's ContentEngadget: New algorithm turns 'Lord of the Flies' into an emotional balladFast Company: Turn Your Favorite Books Into Original Music ScoresDiscovery: Beautiful Music Programmed from Famous NovelsCNET: TransProse turns literature into musicVice: TransProse Turns Your Favorite Novels Into Original Music ScoresBillboard: Computers, Classics and Cadenzas: Making Math Music From LiteratureLive Science: 'TransProse' Software Creates Musical Soundtracks from BooksDer Spiegel: Automatischer Soundtrack: Software schreibt Musik nach DrehbuchLe Monde: La mélodie des motsDiario Correo: Conoce el programa convierte los libros en músicaGizmodo Japan: 好きな小説からオリジナルの音楽を作れるプログラム「TransProse」La Patilla: Crean un programa que convierte los libros en músicaSuperinteressante: TransProse, o programa que transforma literatura em músicaHyperallergic: New Algorithm Turns The Emotion of Language into Music IBDA3World: برنامج يُحولّ الكُتب إلى موسيقى TransProse
[PART 2]
Games: Guitar Hero, Piano Hero
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
Games: Guitar Hero, Piano Hero
Graham
What he means here is Staccato
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?
In MIDI, “Flute” is Instrument 73
Allegro is 120 bpm
JFugue doesn’t just play notes, there is a solid foundation of music theory
Staccato-to-MIDI happens to be the default, but you can do stuff like this
Does anyone have any DNA on them?
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…