[PIANO MUSIC PLAYING]
YOTAM MANN: Hi, I'm Yotam.
This is an experiment
called A.I. Duet.
It uses machine
learning to let you
play a duet with the computer.
[PIANO MUSIC]
Making music using code
isn't a new thing at all.
But machine learning gives us
a different way to go about it.
If I was trying to make A.I.
Duet with more traditional
programming, I'd have to
write out lots of rules,
like if someone plays a C--
[PLAYS C]
--maybe respond by
going up to a G.
[PLAYS G]
Or if someone plays
three ascending notes--
[ASCENDING NOTES]
--then maybe go back down.
[DESCENDING NOTES]
I'd basically be
creating this map
to tell the computer how
to make these decisions.
But there are just too many
notes and timing combinations
to map it all by hand.
This experiment approaches
the problem differently,
using machine learning,
specifically, neural networks.
We played the computer tons
of examples of melodies.
Over time, it learns
these fuzzy relationships
between notes and timings
and builds its own map based
on the examples it's given.
So in this experiment,
you play a few notes.
[PIANO MUSIC]
They go to the neural net,
which basically decides, based
on those notes and all the
examples it's been given,
some possible responses.
[PIANO MUSIC]
I had some friends try it out.
It was fun to see how it
responds to different things
people play.
It picks up on stuff
like key and rhythm
that you're playing, even
though I never explicitly
programmed in the concept
of key and rhythm.
[PIANO MUSIC]
It was cool to see people use
it in ways I didn't expect.
Instead of taking turns, a few
people played at the same time
as the neural net's
response, kind
of getting in a
creative feedback
loop with the computer.
It's also fun to just
mash the keyboard.
The neural net tries to
return something coherent
from any input that you give it.
[PIANO MUSIC]
I made all of the
code open source.
And the neural
net that I'm using
is from Google's open
source Magenta project
so anyone can grab it
and train their own net.
I wanted to put
this experiment out
there just as an example
of the many kinds of things
you can make with machine
learning and music.
And I'm really excited to
see what other people do.
You can play with it
at g.co/aiexperiments.
