 Let's start with the question. How many of you are musicians? OK. 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 harp, or maybe how to spend a lot of time building a laser harp. We'll see. So what is a laser harp? Pioneered by, as far as I know, Jean-Michel Jarre 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 want it for. But let's talk about how did we get here first. Who am I? Yeah, I'm standing on the 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 Procretionist Group. Leeshout Maria Hout. And for everybody who's not from around, there are two small villages near Eindhoven. The southern one, Leeshout, is mostly known for a very big brewery called Bavaria. The northern one, Maria Hout is a really tiny village, mostly known for a singer called Guzmeoiz, who was born there. But they also have a very good music association. So Sin Cecilia has a harmony where they together make a lot of musical music. And they have a percussionist group where they use drums and other things. So let's introduce that. Ladies and gentlemen, it's time to meet and to champion me. 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 Houspecow, 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 alone. 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 harp, so why? Well, because percussionist group wants it. How 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 Jean Michel Jarre operates such a device. So let's talk about how does such a device work? 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 achieve, 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 used. 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 eye needs to record only green light, which is why there's no other green light on the stage. Very back in the back you will see blue light. Mr. Jarre 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 of 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, no? Okay. So if anyone 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 works. No? Try again. Yes, it works. How does the eye define the position? And basically, how does the eye define which laser beam was touched? That's on my next slide. Thank you for the transitioning to my next slide. Oh, no, I started to beg, one more slide. So we started to beg. 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 fancying doing that again, but fortunately, somebody did. And it works. So how to detect which beam is being hit? So the first thing, and this is the one that's actually used by Jarr 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 where the laser is, you know if you see a reflection that that's 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. 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, OK, let's go for something simpler. So, we bought several of these cheap lasers and we decided, OK, let's do just this. So we take eight and we turn them on one at a time. There's one tiny problem and that is that at that point we're talking a five milliwatt laser that is on one eighth of the time versus a hundred milliwatts or 200 milliwatts 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 will just see somebody doing this and by accident notes happen. Actually, you'll see me do that in the end. OK, 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 seven eighth 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 milliwatts laser is. So we bought a few of those and we started experimenting like, OK, 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 it 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 it work? Yeah. Oh, sorry, it wasn't paying attention. Yes, it seemed obvious to me that you could have used the laser range finders for detecting which beam was like covered laser range finder. 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. OK, 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. OK. 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. 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 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 screw 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 would put 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 a mechanism to push the buttons. So my first... 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. It turned out to be too hard, so we did the same thing with tie wraps. It worked. But kind of intricate to design if you... Oh. That we had a story first. But then, because I still have that other end, right? So what you see here at the bottom one is that 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 to 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. 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 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. Solve problem, except that the transistor I wanted to use, well, MOSFET I wanted to use for that, actually is out of stock at Fresnel. 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. Okay, I need eight, 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 all, I reflect a lot of light, so they should be able to see that reflection of the light. They should be. They are mostly sensitive to green light. There is 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, 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 to toy, I just keep them on. 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. 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. If 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 fills, 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 on offering each other because you will very quickly find that two programmers working on the same PC with the same, well, with separate keyboards are trying to be smarter than the other guy. So they will test all the weird cases that could happen, they will write code, it is really solid against any misuse and they will do it in twice the speed that a normal programmer can write code. Actually, they're 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? Pear programming, you did, did it work out for you that same way? You're trying to force my team, I did, 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 sure 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 the 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 where the arrow is pointing, you'll find that it comes, so this is just turning the laser on and off. So let's do it again. So that laser starts burning, 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. So 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 frequencies, so really a lot less time, say only one millisecond in between each turning on, turning off, instead of the about a hundred that it was in this video, all those effects go away mostly. It becomes a lot more equal in brightness. Phew, almost saved. Is this visible? The true lines I drew by in PowerPoint, so. Yeah, yeah, yeah, it's good to know. So how many nodes do you hear? Two. I think I heard only one node 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 the simple one. So let's talk about time of flight. But 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 rest is too slow. So my detection is off. My timing is off. And that is also enforced by the fact that when I turned it slow, made the 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 diodes 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 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 five milliwatt lasers. That will work. Getting it to be reliable is gonna 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 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.4, to 3.4 volts, the lasers become much brighter. So apparently a laser is not a digital thing. Good, works for me. But it also means that I can make power supplies per laser and then I can adjust the brightness. Or, if I don't do the time of flight, why not just take a webcam and just make a recording? And now I'd hope there's a 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 what I can hear, so that's good enough. But 25 frames per second definitely isn't good enough. On the other hand, you saw Lars the air drummer at the beginning, right? The show. Any of you noticed that they faked it all of it? They pre-recorded the entire, so he was just drumming in the air. The guys behind them were faking that they were doing the drum effects because it was all pre-recorded and they were just 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 how they did it, and okay, they tricked me, so if everything else fails, we'll just pre-record the laser arp if somebody will be hitting the lights. 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. I'll go. Ah, go on. I'm trying to imagine how you would play a chord, but I suppose you would just take the low two notes because it's very difficult to. Okay, so the idea was to use them in a drum band. So 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 Macs 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, as heard on 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 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 going with the photo diode, 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 note or to change, for example, to modulate the volume. So I was, I'm 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 then slide your hand through it. That will be another technical challenge. Thanks very much. Nice project. Kind of like a theremin. That wasn't my question. 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, thank you. 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? Question, why are you buying laser pointers as opposed to the laser diodes themselves? Have you tried? Yes, I bought several laser diodes from Alex Pérez, 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. Second question, 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 a 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 a power source, no, of current source instead of a voltage source would make the difference. All diodes are current driven, not voltage driven. They have a constant voltage. Yes, I did not go into that kind of experiment. That would be a nice trick, yes. I had a question. Okay, Jean-Michel Jarre's glasses, 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. Then you couldn't see the laser. Does he need to? Oh, I suppose, yeah. 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 frequencies makes glasses too hard. Actually, I have a general observation as well. Somebody was saying about, oh, sorry, come here. I'll get less feedback that way. One general observation I've got as well. Somebody was talking about buying lasers from different places. I bought some lasers off Alibaba and others off eBay. I was building a laser maze for one of my kids' parties, which was great. But when I first bought lasers, small ones, I wanted them to be bright so they could be seen. I accidentally bought cutting lasers. For a child's party, you had to be very careful of that. So I did spot that in time. But it's a very easy mistake to make. Yeah, how many kids did you cut? None in the end. Just sing from your hand once. Oh, you sing? Only you sing from your hand. OK. But anyway. OK. Anyone else, any other questions? No, cool. Well, it's pity we can't have a demonstration of running live. Maybe you could do later when it's dark or something if there's time somewhere. Or do you have a village? I'm not in the village. I'm leaving today again. Oh, I'm leaving today. Actually, I promised to be home before dark. Is that promise not to do a demo? And 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 Jean-Michel Jard. Yes, it is. But it doesn't work. And that's actually quite... OK, small difference. It is different, yes. Cool. OK, brilliant. Well, thank you very much indeed, Klaus.