What is that time again? The time we switch our compiler from the ghost.NET compiler to the tiny.go compiler. Same language that there are friends. Let's be sure about tiny.go or our friends. Because they are the reason they supply us with this pretty go for hardware and these go for badges. That's all running tiny.go. So when I switch into the tiny.go session of the go dev room, I always forgot what I'm doing here. And I want to very special thanks to our speaker here. Because Danielle is just like, was it yesterday? What? Was it yesterday that I asked you to give this talk? Yeah, probably. It was yesterday that I called him, bad king. I have no talk at this slot. I need to have a talk. And I couldn't move schedules around because the people will be very angry at me for doing that. So what I did is I called Danielle instead. Give me what you got. You said give me a day. And apparently we are finally going to have some live music using my favorite stuff in the world, and I'm going to give you a little bit of a round of applause for Danielle. And I'm Daniel Esteban, also known as Konejo. And I'm here to talk today about having fun with MIDI and Go. So the year is 2014. We have got the room at first then. Since then we have been, we have more than 130 talks, more than 100 speakers, two virtual Kone, thanks to COVID. A dozen of lightning talk, multiple room changes because we grow bigger and bigger. Konejo is an attendee, so happy 10-year anniversary. But also five years ago at Fosden we make the first release of TinyGo. Since then we have 36 releases, more than 150 contributors. We have given multiple talks here at Fosden and another conference. We have two Not-A-Spy weather balloon launches one last year at Fosden also. And this year we have our own subtract of TinyGo because I'm the first, but then you will hear my college a.k.a. and then roam with more TinyGo surprises. So let's celebrate. Let's make a party. Woohoo! I'm going to make music with MIDI. MIDI is done for musical instrument digital interface. And it's basically each interaction with a key, a knob, a button or a slider is converted to a MIDI event. And then you need a MIDI synthesizer to understand the event and make the audio. So today we are going to make part of the MIDI controller, which is kind of the instrument. And then we will send all the MIDI data to the laptop and then just play in a wedge page called Virtual Piano that will play the music for us. So basically MIDI works like you press a button and then you send like, okay, play this note at that volume and that channel and that information. And the synthesizer, which is the Virtual Piano webpage, will process that information and really make this sound. So to make music, first we need a group or a band. I present you these two days. These are the GoFerbaches. I have one on my neck, March have another and you can see them here. They actually run a RP2040. It's this little, little tiny chip here and we are going to put Go code in the chip. It also has RGB LEDs. It has six buttons and LCD. It has a serial feature. And what is TinyGo? Well, TinyGo is not a superset of Go. It's nothing different because it's a different compiler that just puts your regular Go code into the microcontroller. Like RP2040 or Arduino or a 10C or something like that. Something very, very small. And how are we going to play music with just one simple function? It's from the MIDI package. It's MIDI.noteOn. We specify the cable. We specify the MIDI channel. We specify the note. In this case it's the B3. We want to play and the volume. So demo time. This worked like 10 minutes ago. Hope they still work. And let's just try the simple thing is press a button, make a noise. So how will this look like? Just first we configure the button to understand when it's pressed or not. And then if the button is pressed, we play a song, play a note and if we release the button, we stop. We are going to flash the code. I am here just to make the audio hearable from the laptop because we have no fancy AV setup. I am not here to play any actual music instruments behind the scenes. This is all real. We have flashed the code. We can see it's the same here. We go to our MIDI synthesizer. We select our instrument. The channel is one. And if I press the A button, it's a song. Okay. But that would be too easy. So let's make things a little bit more complicated. Let's play air drums. What I have here is an array of five distance sensors connected to another buffer batch. It's almost the same. We just configure here the distance sensor. Wait. And then if the distance is less than 90 millimeters, we play a note. In this case, we are using the channel 10, which is a special channel for MIDI, which is a drum set. So it's not an instrument per se, but different instrument. Hopefully, it's too low. Thank you. And this was only 24 hours notice. Can we make things more complicated again? In this case, the buffer batch has an accelerometer, three axis. We are going to use the data from the accelerometer and also the buttons here in this little tiny guitar. And in this case, when I move the guitar and the batch, I will change the pitch of the sound. What happened? Select channel one and I select this one. So now, I can play the music. It's okay. Okay. And finally, sorry if I'm going too fast. This was supposed to be a lightning talk. I don't know how to program, but I want to have fun too. So what could I do? Well, I introduce you to Blockly. This is a visual programming language. You just drag and drop the block. You don't need to write any code. So there is also a playground. And you have different sections with different blocks that do different things. And then we can translate those blocks to go code. So Blockly is a JavaScript library. It's 100% client-side. It's compatible with all the major browsers. And you can customize and extend it as much as you want. Blockly does not officially support TinyGo. And that's part of my hobby here that tries to make it output go code. So how it looks like, it will look like something like that. It's like the first sample, an infinite loop, like repeat while true. And then you do the button up, for example, play the note D3. So, that's it. Just to save some time, I have the demo here, but you can see, like, you just... You can drag and drop the element. You can modify them if you want to. And finally, here is the go code that should appear. Is this one? Okay. We are going to... We are going to copy. We are going to pass in a U. We are here again. Select... And now if I press the up button, it should... Sound. And we just do that with the... Sorry. We did that with the blocks only. And that's it. Thank you. Sorry. Thank you again. Thank you very much for this very, very last minute, but still awesome talk. I finally have a musical act in my room. What's next to your Taylor Swift? Does anyone know her? They're not going. They're not going. Come on, one last pass. Any questions? Yeah, for your tiny go compiler, which microprocessor popular ones do you currently support? Which one? We do support a lot, actually. I'm not sure the least. I mean, you can go to tinygo.org and you could see... No, it's not driver. I'm not sure right now, but from... Yeah, from NRF, son of the Nordic compiler chips, at Mega also. Sandy 21 and Sandy 51, RP 2040, the one used in the 10C board also, and also like ESP family kind of. Cool. Thank you. You