[Music]
good afternoon let's start with oh let's
start with the question how many of you
are musicians
okay
how many of you are programmers
i see
people that join between those so good
yes i'm going to talk about how to build
a laser or maybe
how to spend a lot of time building a
laser harp
we'll see
so what is a laser
pioneered by
as far as i know xiaomi shazar in 1982
it's a device that when you hit
a laser something sounds
that's all
it's mainly used for live performances
because you can make a really big show
about it
and that's exactly what we wanted for
but let's talk about how did we get here
first
who am i uh yeah i'm standing on stage
you're not
i used to do a lot of talking on topics
like linux
and open source and embedded
i stopped doing that about 10 years ago
but every now and then it itches so i
have a personal project that i want to
talk about so here i am
more important who are we making this
thing for so there's something called
the sin cecilia progressionist group
leaves out maria out and for everybody
who's not from around there are two
small villages near eindhoven
the southern one lies out is mostly
known for a very big brewery called
bavaria
the northern one maria haute is a really
tiny village mostly known for a singer
called khrushmeowis who was born
there but they also have a very good uh
music
association so assistant cecilia has a
harmony where they
together make a lot of uh well musical
music and they have a practitioners
group where they
use drums and other
things so let's introduce that
[Music]
and now ladies and gentlemen it's time
to meet
the record-breaking history making
16 times
[Music]
[Applause]
[Music]
we
will
[Music]
don't
[Music]
do
[Music]
so
[Music]
so
so this was an excerpt from a two and a
half hour show that they did a few weeks
ago
and as you can tell
these guys don't just live for the music
they also live for the show
so it would be nice to have an
instrument that really is just about a
show and a laser harp is such an
instrument
so who's pascal the guy that is missing
here because he is actually with the
youth group of the
music association they're on a trip like
this right now
so we decided that i would come along
but
he's the son of my girlfriend
he is the light
and audio brain behind the percussionist
group so all the lights that you saw for
example in this first part of the video
all the lights coming up it's his
equipment and he did the programming to
make it work
but a laser arm so why well because
perkins group wants it how uh you can
buy one you can rent one or you can make
one and again i made the wrong decision
to say let's make one
so let's talk about how i made one by
trying to save the association a lot of
money because buying is really really
expensive
let's take a brief look at how xiaomi
choja operates such a device
[Applause]
[Music]
so let's talk about how does such a
device work we start with the
circle at the top
yeah that's a laser beam
they use green for a reason because it's
the most visible
i have two laser
buttons one is red one is green
probably won't work because it's too
light here anyway but good luck finding
the red one
it's
red is
what is used for laser points all over
the world but it's hardly visible green
is way way way more visible with the
same amount of power put into it
so if you want to make a laser arp jeep
use green
the next thing i want to talk about is
the circle at the bottom
there's only one laser in his design
that is use well i'll show later but
it's using a rotating mirror to come up
with seven big of nine big lasers
this one
hard to see
there's the eye that actually records
the reflection from somebody hitting the
laser
more importantly
that i needs to record only green light
which is why there is no other green
light on the stage very back in the back
you will see blue light
mr jar himself is shown in red light
because
red and green are rather far apart in
the light spectrum so
your regular photodiode will only pick
up green or will only pick up red but
not both
and he is wearing shoes
gloves
just to make sure that he reflects as
much light as possible
so we have an easy job as programmers
actually distinguishing between no light
and reflected light
and at the top his head he is wearing
glasses sunglasses for a reason those
lasers tend to hurt
wrong one
this one so how does it work well
we have a guy he's standing over there
and as soon as he hits the laser button
it will reflect the reflection will go
into the eye and then we need some
electronics to hook up the laser to the
eye
as soon as we
discover okay there is a reflection and
i know which of the beams it was i can
play a note on the synthesizer
is that uh
no okay
so if anyone also asks questions in
between please go ahead i'm used to
getting questions throughout my talk
so don't worry i won't bite
yes
you may want to walk into the microphone
indeed oh there's a walking okay that
also
[Music]
works no
try again yes it works
um how does the eye define the position
and basically how does the eye define
which laser beam was touched
that's all my next slide thank you for
the transitioning to my next slide
oh
no we i story i start at the back one
more slide
so we start at the back doing a
synthesizer means well essentially we
plan to use an arduino to do it so we
need to get a midi signal out of the
arduino into the synthesizer
that turns out to be a solved problem
that was good news for me i already was
envisioning myself really having to
start writing serial
port drivers all over again something i
stopped doing in the 2000s early 2000s
so
i really wasn't fencing doing that again
but fortunately somebody did and it
works
[Music]
so how to detect which
beam is being hit so the first thing and
this is the one that's actually used by
jar and also by quite a few other videos
that i found on youtube is you have a
laser you have a rotating mirror
and you only shoot at specific times
when you know that the
mirror is at a certain position
so you know which where the laser is you
know
if you see a reflection that that that
position so that is the note to talk
we thought about this hard because
pascal owning an audio visual company he
has such a laser he has those mirrors so
he can easily just make that beam not a
problem standard functionality of all
those devices anyway
the lasers themselves are very expensive
we're talking about a few
thousand dollars for a full device or a
few hundred dollars if you talk about
just the laser and then you have to
still do everything yourself
um
also then we're talking about lasers of
100 milliwatts so just watching such a
laser without it being filtered or
being reduced
will just blow your eye away not a
problem it's gone
so we decided let's not build that
ourselves and we could not tap well
enough into those devices to get the
position information out of it
so okay let's go for something simpler
so we bought
several of these cheap
lasers
and we decided okay let's do just this
so we take eight and we turn them on one
at a time
there's one any time the problem
and that is that
at that point we're talking a five
milliwatt laser
that is on one eight of the time versus
a hundred milliwatt or two hundred
milliwatt laser
at the same time so our laser would not
compare
in the light intensity
to
that professional laser and that means
that if you are in the audience and i
have a laser that blows up in smoke my
laser will not be visible enough so you
don't even have the idea that you you
will just see somebody doing this and by
accident notes happen
actually you'll see me do that in the
end
okay
there's a trick around this
that we came up after
a few days of thinking and that is let's
turn it around let's detect when the
laser is off
which means that about 7 8 of
the time the laser is bright and shiny
and only one eighth of the time the
laser is off so i now just want seven
times the amount of intensity of my
laser
and now i'm at the same level as that
hundred milliwatt laser is
so we bought a few of those
and we started experimenting like okay i
push the button
and i have my arduino on the other end
and i check is the light coming up in
one go and at the end is going down in
one go because if it would for example
come up go down go up go down come up
then i need to accommodate for that
period because that makes it very
unreliable to detect a note
same is true at the end if it takes
eons to go down
then i need to take that into account
when making my cycle for turning on and
off the lasers so
we figured out that there's no startup
or end effects
that's great
so we bought seven more and thought we
could start
sorry does this work yeah oh
sorry i wasn't paying attention yes um
it seemed obvious to me that you could
have used the laser rangefinders
for detecting
which beam was like covered
lazier
rangefinder you know they are used on
the building sites to measure the range
from the device to the wall whatever
yes i could
that's a rather complicated device
though
because it means that you have
a laser going out
and then it reflects against the wall
and it comes back
and then you have to measure the time of
flight
we're talking
microseconds that is very complicated
electronics to get right if you are a
hobbyist
okay
um i built a laser harp myself with that
like with time of flight sensors you can
get them for i think under 10 bucks so
it's a really good recommendation so
then you are really measuring where is
the hand yeah yeah okay we can talk
about it later yes please
you would solve a second problem that i
still need to talk about i brought it
with me
cool
um this is what i'd hoped for that
people would start giving me ideas
so these laser harps are cheap really
cheap
obviously made in china and
um
we learned that they were made in china
very the hard way because for example
if you screw them together
that won't always work
they're really machined so poorly that
the screwed thread on it is not
necessarily working correctly
the batteries don't always fit
the laser is not exactly in the middle
of the tube
i wish i had bought three more
that would have made it much better but
we had enough that were reasonably
usable so we continued
so i only want to use the top half i
don't want to use the batteries and that
means that i need the mechanism to push
the buttons
so my first device so fortunately i have
a 3d printer so i made
some kind of
mechanism that would grab it and i could
use a screw to fasten and unfasten
turned out to be too hard so we did the
same thing with tie wraps
worked
but
kind of intricate to design if you
oh
that
other story first
but then i st because i still have that
other end right so what you see here
at the bottom one is that i we just
soldered the wires and then you need to
keep in mind that there's a spring
to push against the batteries that you
need to solder again spring is not
standard metal so soldering doesn't
really stick
and on the inside of the tube is
a brass
ring that contains the thread and that's
also not really nice soldering against
so that it didn't really stick well
and because we wanted this to be at
least a little bit sturdy
i 3d printed a
small piece
and i would hook it up together like
this
so the screw is on the top that will
push against the
spring
and i have the wire on the other end
that will just
spread itself out and fill up the room
that the thread gives
so this was
immediately spot on this
we did this only once and they have been
on since
connection is really reliable even if we
drop it etc so this was a good decision
then we need to put a together
that was quite quite an intricate design
to make because the angles
need to well yeah
took me quite a lot of youtube reading
and viewing to see how to wire all
the stuff up together in fusion 360 but
i got it done and this is actually the
first time i printed it it was right the
first time
until i realized that one of my lasers
is off center
so i technically need to make a new one
where i put one of the lasers slightly
tilted
then we have that small problem of
switching the lasers
solved problem
except that the
transistor i wanted to use well mosfet i
wanted to use for that actually is out
of stock at for now
any variant any amount they're out of
stock wait what
locally
my local electronic shop still had them
so i could buy 10 of them but
that was kind of a setback because i was
expecting to buy them in bulk
but i have 10. ok i need 8 that's good
then the most painful part started
so i love to talk about those
time-of-flight sensors
we
thought that we could just use standard
photodiodes
and they should be
after i reflect a lot of light so they
should be able to see that reflection of
the light
um
they should be they only mostly
sensitive to green light
there's a big contrast between no light
and yes light so it should not be a
problem
and just to make sure that we got it
right we i made some kind of cone around
it so they would not see any false light
coming in from the stage lights or from
the audience that happens to make
pictures or whatever
of course then i learned that printing
them in white plastic is not a good idea
because that is just as translucent as
doing nothing so i printed them again in
black plastic which does work
and i decided to use four of them just
to make sure that i can tune them as
close as possible to two of my lasers so
just make maximize all of it it should
work
no it doesn't
but okay i hook up everything together
oh
if you wonder what those caps are for
just to make sure that i don't actually
hurt myself
so they're
on the lasers
i hope you can see it in the back as
well they're on the lasers and
if i want to toy i take them off if i
don't want the toy
i just keep them all i know when the
lasers are on because they will light up
nicely
and i think i saved my eyes that way
because i'm pretty sure that at least
twice i was with my head on a location
where i shouldn't have been
programmed the arduino
yes i did
well
i first started coding it on the pc
because we were way ahead with software
compared to hardware
not the average project i've done
so
as i do in my job
and i still have to convince every time
i go out
for my work and convince in a new
project i have to convince the manager
no i want my team to first write the
test
then write the code
write a new test write new code write
test write code write test write code
test driven design
executed
and i actually say i want two
programmers on each job
give them two keyboards hooked up to the
same pc
so then you actually get the mechanics
where you have one programmer writing a
small test
probably the first test is going to be
is the class that we're going to build
does it exist so just instantiate class
test fails doesn't compile the other guy
comes in types
i have a class
test works he writes the next test
he writes the next code and so they keep
working together they keep one offering
each other because you very quickly find
that
two programmers working on the same
pc with the same velvet separate
keyboards
are trying to
be smarter than the other guy so
they will test all the weird cases that
could happen i will write code that is
really solid against any misuse
and they will do it in twice the speed
that a normal programmer can write code
actually they are 2.2 times faster than
an average single programmer so
programming with two guys
at the same time is faster than doing it
by yourself
believe me no manager understands that
the first time i explain it
any of you have ever done it that way
pair programming
you did
did it work out for you the same way
you're trying to force my team i did it
works
it works
it works for you
yes you always have to convince people
to stick to the rules yes
yeah so unfortunately they had me as a
software architect slapping everybody in
place so yes they kept following the
rules i made short of that and once you
do it for a week or two it becomes a
second habit and really your team gets
faster
okay so
you should do what you preach so i wrote
my code using tdd
on my pc then i compiled it for the
arduino and realized that arduino did
not have any stl
okay
back to old c style arrays
later i realized that there's also a
plug-in for arduino where you can get
all the stl stuff
but okay yeah software done
actually software was done in
december already and we only did the
hardware in march
so does it work
well almost
so watch the laser with the where the
arrow is pointing you'll find that it
comes so this is just turning a laser on
and off
so let's do it again
so that laser
starts burn
starts and then becomes brighter
we also have another one that is
actually not shown in the video that
after a few seconds will turn less
bright
wow those chinese can make effects into
the lasers
okay
okay okay
let's so this is oh
this is the actual program that i wanted
to use right so i would
have all the lasers on and would disable
the laser that i want to check
and you again if i replay you will see
that
they are
still brightness variations
the good news
and that really saved my day is that if
i go to much faster frequency so really
a lot less
time say only
one millisecond in between each turning
on turning off instead of
the about 100 that it was in this video
all those effects go away mostly
it becomes a lot more equal in
brightness
few almost saved
is this visible
the true lines i drew by
in powerpoint so
[Music]
i
um
[Music]
yeah yeah it's good
so
how many notes do you hear
two
i think i heard only one note
played with three different instruments
two of them more or less reliable one of
them plays at random
i have a problem with my detection
mechanism and not a simple one
so
let's talk about time of flight
but um no so conceptually
what i think happens and that's the
stupid mistake we did at the beginning
we did check whether if you power a
laser that it would immediately
just go on and keep burning what we
didn't check is how much time it takes
between actually enabling it and the
first light coming on
i think
that i have only two lasers that are
reasonably fast and the right the rest
is too slow
so
my detection is off
my timing is off
and that is also enforceable by the fact
that when i turned it slow
made this system work slower it would
work
more reliable
the second part that i have three
instruments instead of different nodes
is just my stupidity i misread the midi
protocol
but i was not in the mood to fix it
anymore
and at this time i would have hoped to
power up the board and show it to you
not gonna work here it's way way way too
bright i tried in the speaker tent
briefly
my photo deods just say sorry it's light
i can't get them to be dark
so no actual demo which
i'm sorry it takes five seconds of the
schedule
we're almost there
you saw already from the original vid
video of the drum band that they tend to
perform their shows
in a real stage
where it's dark so we can get it dark
with the smoke with the 5 millivolt
lasers that will work
getting it to be reliable is going to be
the problem
and i believe that to be a solvable
problem and definitely if time of flight
is an achievable thing
but
i still need to check the power to to
light capability of all the lasers
and if i want to check a little bit
about the brightness i want to adjust it
a little bit i need to see if the power
sources make a difference because i
really noticed that if i
power up my power supply more so go from
2.8 up to 3 or 3.4
to 3.4 volts the lasers become much
brighter
so apparently a laser is not a digital
thing
good works for me
um
but that also means that i can make
power supplies per laser and then i can
adjust the brightness um
or
if i don't do the time of flight why not
just take a webcam
and just make a recording
and now i hope there's a music musician
in the room
no
if i take a regular webcam how many
25 frames for
so if i get to 25 frames any
percussionist will hear the delay
between me hitting the beam and the
sound coming off that's way too much so
if i go to 60
we're on the verge of being reliable
at this system i was at 120.
that is beyond we'll take in here so
that's good enough but 25 frames per
second definitely isn't good enough
on the other hand
you saw lastly lars the air drummer at
the beginning right the show
any of you noticed that they faked it
all all of it
they pre-recorded the entire
so he was just rubbing in the air the
guys behind him were faking that they
were
doing the drum effects because it was
all pre-recorded and they were just re
playing a tape
actually they faked me i didn't know
either
i was aware that they were going to do
it i did not know that how they did it
and okay they tricked me so if
everything else fails we'll just
pre-record the laser because somebody
will be hitting but light not a problem
we'll make the show
having said that
we're getting there
slowly
we will get that show next year that's
not a discussion we will have that show
i have my
eight laser beams going up everything
else can be faked
thank you for listening
and i will take more questions if there
are any more questions
[Applause]
i'll go
oh god
i'm trying to imagine how you would play
a chord but i suppose you just take the
low two notes because it's very
difficult to
[Laughter]
okay so the idea was
to
use them in a drum band
so um
most of the even the melodic instruments
in a drum band are still well there are
80 of those bars that you can hit but
most of them can hit two mags at the
same time
getting three batons on each hand is not
feasible
so the
conductor who was going to write a new
piece for this was already anticipating
to use only
single notes at the same time
on the other hand
the system is capable of doing multiple
notes at the same time
the electronics can handle it the midi
can handle it
and then indeed it would be a nice show
element to
try to do this thanks for the idea
and i have a second question
may
you can't make a glissando but i suppose
because of a percussionist application
you're not interested i'm very
interested okay so that's what i hoped
and i watched uh jar
performing quite a few things and what
you see him do in videos is do this
which makes absolutely no distinction in
the sound
but when i was first toying with
photodiode i did see a difference in
intensity between here and here
so i thought yes i can use that to
either change the
frequency of the node or to change
for example the to modulate the volume
so i was
am still dreaming of all kinds of tricks
to improve my instrument beyond just
playing note on or off
but i first want to make it work please
of course i was wondering if you can
make just one screen and slide your hand
through it
that would be another technical
challenge thanks very much nice project
kind of like a theremin that wasn't my
question um with regards to the problem
of the time it takes for each laser to
power up have you considered not fully
powering them down but just dimming them
then they would only need to power up
once
yes
that's actually called the knee voltage
if i recall correctly
is on my to-do list
okay
yes that could solve the problem
altogether except that providing two
different voltages means double the
amount of transistors a solvable problem
okay thanks
if somebody has transistors lying around
that is
please
okay yes hello uh question why
are you buying laser pointers as opposed
to the laser diodes themselves have you
tried
yes i've bought several laser knights
from alex perez china
because
i tried and i couldn't get my hands on
them
and at that point we decided okay
let's give up and just buy laser
pointers instead
because the ones that we could find were
not in our price range
so that's
yeah
the second version do you know if
there's any driver for a laser diode in
the pointers because i suspect they just
rely on internal resistance of the
batteries used so you may want the
constant current driver then you can
adjust the brightness per laser as well
i did not go as far with my experiments
as see if it indeed is one or the other
i did not check whether as power source
no of
current source instead of a voltage
source would make the difference all
diodes are current driven not voltage
have a constant voltage yes
i did not go into
didn't that kind of experiment
that would be a nice trick yes
i i had a question okay john michael
jars glasses if he if he has a very high
powered laser if he did get that in his
eyes would the glasses help at all or
you can make filters that
effectively block out a very tiny bit of
spectrum but then he couldn't see the
laser
does he need to
actually i have seen somebody who has a
laser harp with both
green and red
lasers so
apparently they don't need glasses at
all because
two different frequency makes glasses
too hard
okay
actually i have a general observation as
well um somebody was saying about oh
sorry come
here
i'll get less feedback that way um yeah
one general observation i've got as well
someone's talking about buying lasers
from different places i bought some
lasers off alibaba and i was off ebay
and
i was building a laser maze for my one
of my kids parties which was great but
um when i first bought lasers uh small
ones i wanted them to be bright so they
could be seen i accidentally bought
cutting lasers and um for a child's uh
child's party you have to be very
careful of that so i did spot that in
time but uh it's very easy mistake to
make
yeah
how many kids did you cut uh
none in the end just uh just uh cinched
my hand once oh you see only you seen
you change your hand okay
let's uh anyway okay
anyone else any other questions um
oh cool
well it's pity we can't have a
demonstration of it running live
maybe could you later when it's dark um
or something if there's time somewhere
but um or do you have a village or i i'm
not in the village i'm leaving today
again
actually i promise to be home before
dark
is that promise not to do a demo
and and the the total cost of your kit
what do you if somebody
once you've also once you've finished it
will you publish the will you make it
open source the plans and stuff
the plan is to open source everything
and the kit as it is now is about 160
euro
so that's a good reduction compared to
jeans
yes it is
but it doesn't work and that's actually
quite a small difference it is different
yes
cool okay brilliant well thank you very
much indeed klaus
you