hi everyone welcome to our episode this
week we will be playing music on our
microbial this week we need a few little
extra bits and we'll put links below
that you can go and buy them so you're
gonna need some of these wires these
wires have what are called crocodile
clips on the end so definitely give me
finger cuz let their crocodile but
they're really good for tripping on to
the pig pins on your micro bits if you
look here you can clip it on that pin
like that
which is where we're going to keep them
today on the zero and I've got another
cable and we're going to clip that where
it says ground so if you look really
closely there we've got one on zero and
one on ground so the other end of our
Clips here we need to buy another
component these are both really cheap
you can buy these links below I'm going
to buy this is a piezoelectric buzzer it
isn't really like a speaker it just
makes a single tone single note so I
can't play proper music but we can play
individual notes and make them in proper
music so you get one pin doesn't really
matter which cable connecting and you
connect it on one and you can exit on
the other like that and you noticed on
the Micra bit that they might really
bother you that I'm using black on the
one that's not ground and red that isn't
it doesn't really matter you can switch
around if you want we could go we must
have read on a positive because the in
zero is going to be our positive when we
must have black on on zero which is
ground if that makes you feel more
comfortable but doesn't really matter
because for this electronic component
the buzzer
it doesn't really care which way around
you label it so we've got all those on
and we've actually already programmed it
with the thing that we're going to show
you how to do today and so if you look
at this and you listen to the sounder
and you wanna press t8t okay this one of
you it plays what has to be the best
thing to matter okay I don't know what
it is that's the Star Wars theme tune
playing on a micro bit and you can see
it's scrolling across on the screen here
just writing out
in a galaxy far far away will show you
stay Haven program your own tune and
your own kind of music there and wire
all up and get it working but before we
do that Jasmine because she's really the
musician this family is going to teach
you a little bit about how music notes
work and how to read music
and then we can get into the programming
we're going to help you learn just
enough about playing and reading musical
notes to play some music on your micro
bit if you already play a musical
instrument you can skip forward till the
bit where we start programming the micro
bit there are seven basic notes we use
for music and they're called c d e f G a
and B a scale is when you play from one
note up to the same note at a higher
pitch this is an octave an octave is 8
notes oked being 8 like octopus and
octagoon c d e f g a b and c on a piano
the white keys are these 8 notes as you
can see here they repeat every eight
white keys when we are talking to other
people we can describe which c key we
want by giving each see a number like
above all the other notes do the same so
d1 d2 d3 d4 d5 that means c1 is a lower
note than c2 now we're going to teach
you how to read music reading music
looks scary but actually getting started
is pretty simple especially if we are
using the scale of C major those black
blobs are called crotchet notes and they
last one beat of music there'll be more
about this later when we start
programming the Mike rabbit starting at
the bottom each note in the C scale has
its place on the lines and as we go up
the scale the crock chips move up half a
line normally music notes when drawn
don't have the name of the music note in
them that's just to help explain reading
music is really just remembering where
each symbol means and the position on
the lines that represents
each note when we add the octave number
to these you can see how we can tell if
it's a c4 or c5
but how long does each note last good
question and the last bit we need to
learn to crack reading and writing some
music there are different symbols and
music when written down to tell us how
long to play each note for we're going
to learn the basics to help you to get
going with the micro bit crotchet lasts
one beat quaver lasts half a beat semi
quaver last quarter of a beat minim
lasts two beats beam notes are a bit
more confusing but basically in simple
examples notes join together along the
top and total last one crotchet so one
beat in this example each note therefore
lasts half a beat each that's it we're
ready to make some music so now you
hopefully understand enough about scales
at which notes a little bit about to
read music we're going to show you how
we program the star wars-themed cue so
what we actually did for this is we went
to the internet and we looked for star
wars but we particularly searched for C
major as a scale so that we get one
that's nice and simple to program using
what we understand about music we've
hopefully shown you about music so you
can see the first three notes in this we
happen to find a piece of music that's
got actual notes written in it just to
make it even easier if you look back at
the scale we showed you in C major edit
you'll be able to read your own piece of
music if you want to play something
different and figure out which notes are
which without having those notes written
there it helps us when we're teaching
you as well so we're going to start off
with a button to start off so in button
is pressed then we're going to play some
music so we're going to choose a tone
and the first note we have a look back
at it is a G so G or I'm going to play
it for it's one of those bar notes so it
means that that whole three of them
should last one beat one plotting then
that means really there should be a
third of a beat but there isn't a third
in here so we're going to use a quarter
and we keep a tip three times now we can
play that in the emulator repay that
and it won't quite right there's
something we need to do if you can't
hear it stop in between them right just
get all three play together so we need
to put a little pause in between you can
either put in pause here which give you
really really fine control or actually
in the music there is a rest so if we
put rest in and we'll put it in it like
an eighth of a beat maybe might just
tweak this a little bit to get it sound
right and also it helped if you know
what the music sales like and we've
heard Star Wars a lot at times so let's
try that
that's right so what's the next note
looking back at the music that we need
see that's a see below that G so it
should be the C four because that's
below G four yeah and how long do we
want that to play for so yet a minim
isn't it so we can just have it in twice
and don't cut it a break in between so
it's listen to that it's good to kind of
just run your program as you're going
along to make sure you're getting it
right okay and then the next day um G
back to that same G for
quite a clasp on it okay and then we go
into the next line then we yeah
it's what's the next line ad and E and E
in a keynote so f4 again isn't it
d 4 and D for and there another bar so
need quarter rest in between them we
probably put some rests maybe in between
as some of the non barred notes in a
minute we'll see just get the sound
right
so what we need next we need a sink what
you see is that c5 yeah so the one
that's lower there was c4 now we're on
to c5 which would be higher up for how
many beats stick 8 it
okay I'll tell you going to stop run out
of space with your scroll out of it and
then we're playing what that ship still
BG for you or how long things one be
okay do it again yeah
now what we're doing and in another barn
I would be doing F E and D and E and D
what
and there's a bar is it director for
that 1/4 a know what beat sorry those
rests in okay you try it yeah
compiled in the middle extract so where
do we get to we had the last of that so
what an opening see why for two minutes
scroll page up again yep and then three
four four one eight zeros on it and then
in a bar note is f 4 e 4 and F for war
rest
evil
and then
okay where have we got to F now we need
to do um D all or two against duty beads
which duplicate together
let's give it a go I clicks compiles
already we could carry on the music but
actually got to a point now where we
could just carry on leaping and couldn't
Lee because it would start again at same
point so I think that's what we'll do so
if we zoom out a little bit so we can
get a hold of our programming
that's how do we loop a loop and we do
like no default in a for to start with
and then we'll drag all of this in here
and then let it compile etc etc but what
might be quite nice it's a bit of play
to actually animate some words at the
same time so what we're going to do is
in control so we don't need to wait till
we finished writing other words to play
a chip Moodle and do at the same time in
control here just kind of special block
group to something called running
background and what it does is means
anything that's in there it won't stop
the rest the program running to run it
it will just run it and then run the
other pit as well so if we put in basic
block with string and star wars star
cause a long time ago in a galaxy far
far away so now we press a button a the
strings are shown a background the music
should play four times trigger again ya
think it's compiled
and I will make you watch all the way
through but you can see how we've got
our main Star Wars tune playing again
again again
and at the same time it's running across
the top so that should be enough for you
to go and find your own piece of music
or program our piece music and for write
your own stuff here and a bit of play
some music on the micro bit if you don't
have one of those piezoelectric buzzers
you can actually connect it up to your
headphones if you look online micro bit
connect headphones it will show you with
those crocodile clips how to connect it
to some headphones but obviously it's
nicer to have it coming out when it will
speak like that so that's everything in
our demo in this episode we will see you
next time thanks for watching