 Hi Yes, I'm sorry. I'm not very well actually so I would have brought some demos It's just been a bit of a rough couple of days just got cold But I just not feeling the best and I traveled on Friday, so I'll apologize. I'm from the UK So it was a pretty miserable day on Friday I like to I think myself a fairly inclusive and open person and I'm yeah sad times at the moment But anyway, we'll move on for that and so I'm gonna talk about and I would have had some demos and played some music for you but yeah About a project that I've been working on for a while. I've at the University of West of England with some PhD students of mine Some of them musicians and composers some of them are computer scientists and we've kind of have this mix Collaboration group and in particular We've got this music project where you look is looking at kind materializations of Musical controllers in particular but also DSP code and everything and stuff Although that's more my area rather than some of my students. They're much more interested in composition and in interaction, so HCI stuff and We've kind of built up this infrastructure that is around Physical computing so a lot of stuff some of the stuff I'll show you in pictures is actually building up Physical instruments, but the idea is rather than the musician having to go and buy something off the shelf or more expensive We want to make them so they could potentially build it now, of course, that's not for everyone I'm not saying that but the idea of trying to break down that barrier of having non-engineers build build instruments and things and you know we see software like that some things like PD or max MSP Visual programming is supposed to intense like that, but it's still very much in the programming environments rather than in actual physical computing and of course the maker community has broken that down quite a lot for I mean still a lot of People who are you know tech savvy and things like that, but they're starting to break down those barriers and some things and so we're we're looking at that intersection really interested and In a minute, I'll just give you a flick to that. This is the website where you can find out lots of stuff There's the github links for all the code you'll see that it's not just rust code and that's what I'll talk a little bit about that in a minute but So I mean my motto is over the years. I've worked in industry for a long time It's just used the right thing to solve the problem of course what you think is the right thing is not always well Other people's things the right thing, but that's a separate story and you know I'm no more right than anyone else's so I'm not going to kind of advocate one thing or another I'll just show you the kind of things that I'm interested in and and have been using rust for But in particular, I'm really keen on rust as an intersection with other languages I don't want it to be the solution for everything and I don't want the other things I use to be a solution for everything because I don't think they are so I just Won't make sense is what I do so There's a long history of musical instruments obviously and I'm mostly thinking from a Western perspective I don't at all want to say there aren't many other kind of ways and Ways of looking from an entomological point of view about musical instruments I just don't have that much experience in it So I wouldn't want to talk about it and present it here But from a Western place, you know We've got the kind of classical periods particularly from kind of around Shakespearean time in my history You know where musical instruments started but particularly since we had the printing press You know and music became be able to distribute the kind of musical form of the instrument became quite fixed You know the piano didn't emerge first It was the printing press that emerged and the ability to distribute music made wanted to standardize Things and I'm sure we can all agree that standardization is good in some ways But it also does hold us back in other ways, you know and And so of course we've got to the modern times Electronics, you know the the 19th century had lots of bad 20th century story had lots of bad things Caused by many of the innovations, but also had many incredible things and it's I'm sure as we work in Technology, it's a kind of difficult balancing act, you know Sometimes I feel that we should just throw it all away not by the next phone or whatever and other times I'm thinking wow, this is amazing, you know, so anyway in the UK we had this thing called the BBC Radio workshop was where they did the Dalek soundtrack, you know for Doctor Who and all of that sort of stuff Which is famous and so they started to build these studios I even managed to get a picture of a woman rather than a guy, which was great actually that the Radiophonic workshop was a real place where that ragi women had quite a lot of very innovative Delia Derbyshire is the famous one But there's a lot of others as well and of course in the 80s We had people starting to break away from the more conventional instruments and finding and being able to make instruments out of other things You know, particularly that obviously one is the record deck and making that into an instrument in its own right and Today we have many people live coding is a popular thing And we've got this kind of world of where people are sitting in front of their laptops And you know, I've been to lots of musical events. It's not that exciting to see People sitting in front of their laptops, but the music they make and the stuff they're using is incredible Right, you know, I'm not a live coder myself But I love the kind of philosophy behind what they're trying really that's sorry Yes, you think it wouldn't go to sleep when I got in full screaming Chrome, but it still does anyway I can probably turn it off, but I'm not gonna worry about that now, but One of the things we're really interested in so I'm really interested in digital using digital Sympathies and digital generation of musical instruments And so how we can connect to these digital devices But in maybe a less conventional way not sitting in front of a laptop But also not sitting in front of a keyboard and so we're interested in building things So there's been a lot of work particular There's this out of Queen Mary and the UK this thing called the Bella board Which is very much inspired by the Arduino kind of maker environment, but it's got a very high-end You know DSP and you know particularly the audio the op-amps and all that I you know, they're not in cheap, you know It's for actually it's a very simple board But you still pay 150 pounds for it because the op-amps they're using our expensive not cheap You know and it's a full 24-bit back and so forth and stuff and things It's a really nice little board and it can support it it multiplexes the channels So you can have full 96 kilohertz kind of speed But if you want to have 16 channels you get down to like 22 kilo so depending on what you'll do But it's a really nice and it's you know It's a full Linux stack based on a big old bone and they modify the kernels So they get real time and so forth and of course It's a Linux stack so we can build and compile using our favorite languages Whatever that may be whether it's C++ or Rust or anything else for that matter They do a lot of stuff with PD which is a visual programming language and things because a lot of musicians aren't gonna be further than that So these are kind of conventional interfaces. I won't spend too long on these stuff. Hopefully your things This is the kind of field the maker field These are actually all Bella based instruments that people have built and most of these are not You know not all of them are engineers most of them aren't engineers most of the musicians who have just ended up programming from an For a necessity Looking at some of their code is you know interesting let's say but this guy up here He's built this a complete retro drum machine He completed it and as far as I know before he started this project took him about two years He'd never had any programming experience at all and he managed to do it You know he you know stack overflow helped him a lot and something it's great talking to him It's amazing project, you know to think that this guy is just a musician I spent all of his time mostly playing analog instruments like guitars and pianos and then he just decided he saw a talk on Bella I don't know even though he probably have kind of conservatory or someone someone talked about me I was inspired to build it and it's pretty amazing that we've made that accessible, you know now He first programmed it in PD Then he programmed it in C so you can imagine the experience he had it was not a good experience And he's great. You can find his blogs if you go off my website you can find his blogs about it And it's really great to read and yeah, I think he now complains that he didn't have enough time making music But you know anyway, all right. These are the core sort of things We are making I'm not really going to talk about this much down more going to talk about the kind of language Side of things and everything but these are the sort of things so this is a pressure sensor So the rather than being Compasitive, you know, we have a lot of iPads and stuff and things people doing capacity But it doesn't have any kind of haptic kind of feedback and so that's the kind of a real issue So we took this pressure sensor and we've worked out different ways of Generating Musical instruments or interfaces in particular, you know, I'm not with them very much I'll show you in a second a separation for it and up here for example, these are free These are some 3d printed designs that I've designed that they're connectable They can be a horizontal or vertical and they connect together with just Lego pieces But the key thing about it, of course if I'd brought a demo I could have shown you is that they're all based on magnets So originally I designed them to be using a hall sensor so you could just detect the magnetic field when they move So they but these are actually don't have a whole sensor They rely on the pressure and so but the only reason we're using the magnets is to give the haptic feedback So the button pops or the slider you get just a nice little feel of the actually being resistive You know rather than just sticking and this is a little 2d one Which just drags it centers back in the center if the magnet was in so obviously this picture is taking about the magnet in it But if the magnet was there it would be centered and then you push it so you get so it's very simple and just literally underneath They just felt and things So the bit that this talk is more about is how do we describe these interfaces in software such that they can be materialized in Hardware and in particular this is a made by a company called sensual in Silicon Valley And I think they make touch pads, you know for things like Mac books and stuff and things and They have a really nice Very, you know, it's a you art They have a little a dongle which you can either plug straight into a USB Get a USB connection to it or they have a little dongle which takes the USB and just turns it into a straight to a you Art so then you can connect directly to a Sternal piece of hardware like a embedded STM or anything that supports, you know serial I mean it's quite trivial so all of the software that we've written that connects to this device Not the stuff that necessary generates the interface is all written in rust and so that's what I mean I'm not going to go into a lot of depth about that today, but I mean the punchline which I have at the end is That for me the killer thing about using rust for this project other than I really like the abstractions Which is what I'll talk a little bit about in a minute is that I developed it all on here for about a year and a half Nothing else didn't test anything anywhere else It was all just driving on here because you know, I don't use anything else So I used some Linux VMs for my students, but to be honest, I quite like my Mac I don't use Xcode just you know just at the prompt with Clang and stuff and With rust and when I ported it to the Raspberry Pi to Windows That's the only two platforms so far. We haven't done it because sound is not so great on Linux Two days, I think maybe overall with you know, it just it just I really didn't have to do very much You know, there's a few things that didn't work, you know, particularly the audio drivers You have to build by hand and it's all you've asked you to point it to it and stuff and things But it was pretty amazing. I was really impressed and You know, the greatest thing for me about rust is is cargo and the package manager is just amazing That being said I went to build the demo yesterday and of course I've installed the latest version of rust for other reasons and nothing builds anymore because of all the packages are out a day And so that is still a pain but it's a lot lot better than using C++ without a package manager and building everything by hand and I mean, it's crap right. It's still crap and even I was just working with someone just the other day looking at building Helping them with a C++ app that they got me started to use the Microsoft C++ package manager, which I didn't know about and It would only install 32-bit binaries on the 64-bit Windows machine So I still haven't you know, it's still not great. Whereas the rust ones amazing So I said and I use Haskell a lot and so I use the phone called stack I know people use there's another one called Cabal and I'm not going to get into the political arguments of that But it's still pretty amazing right and in the way that it puts everything silos. It's just great I just want to whoever I've heard the person's here develops it, but thanks because it's really great So cool. Anyway, so we're going to go back in history just for a little bit Just to sort because this is more a talk about how I benefit and what I find I like about rust and why I use it so hopefully you can guess where I started programming I'm quite old now, but you know, I haven't had my BBC micro for a long time, but my brother and I have used to fight over it and He makes films now. So he doesn't do any of this stuff, you know and But I did a lot of this I loved it just typing in code for magazines, you know I'm sure we can all say, you know the history and obviously at some point Typing in basic was not enough. And so you could do inline assembler inside the basic interpreter pretty cool and 6502 it's great. You know, this is where I all started. That's why I went to university not towards the older but it was and Of course, actually the first programming language I use the universal was lisp, which I still love to this day because of its lovely Prem, you know braces, but anyway, it was our but of course we did this. I did a lot of this It was a you know, a computer science and master degree. We had salarious machines We did a lot of C, you know programming at sea and I'm not going to do not I still love see today You know, it's an amazing language. It has lots of flaws and we wouldn't design it the same today And it's Russ. I suppose but I still love it Okay, and then I went and left after I finished my piece. Obviously. I did some scripting. I'm still mostly do bash I'm not really a Python person, but anyway, I Did my PhD and I did Haskell completely and so this is I just want to come a little bit about this the reason I put this up and I still use Haskell to the day I still love it and You know, it's I suppose the alternative to Python or whatever I use it for those sorts of things but of course I worked in industry for 15 years and Yeah, I use this language and you know for a long time. I really thought it was amazing and I really liked it and You know, I'm not gonna deny that. You know, I was a bit naive. I don't know I just you know, there's some good things about it. I felt called I could do template metaprogramming and you know Outsmart people was stupid, but you know, I did But I also did some of this stuff. I mostly worked in a graphics group in in MD for 15 years And I was involved with this which has its own things. I'm not going to talk about these things And then of course I discovered NPM. I met that discovered NPM before I discovered and Kabul and stack I couldn't find a stack logo stuff at the Kabul one. This is the Haskell package manager and I hadn't done any rust at this point but I was back at university and I was working in this domain and I was pretty Frustrated to be honest. It's you know, it's a bit like fitting a peg into a round hole, right? Apparently this is I actually use this one because apparently this was from a brexit website This is how some people perceive the UK and the European Union Think lots of expletives about now and swear words and what you yeah, anyway But this is a bit like C++ and Haskell, right? They're two things are counter to each other They don't many of the abstractions. I think in Haskell are really important. They're really interesting I don't you know, there's lots of extensions and GDATs if you're TDA GADT's which generalize abstract which are all great But they're a bit of an intellectual exercise in in showing how smart you are rather than whether they're actually that useful I know there's debates about putting them into rust and stuff, but whatever At the same time Haskell does provide really nice abstractions is very quick to work with just like people tell me about Python I'm not going to make any stances against it. I like the static type system versus like it, but so In 2015 I came to my first ever postum. I just back the friend of mine who's still here today A colleague is brought me then with some students and this is why I heard someone talking about rust I just overheard it in the Mozilla Devarum knew nothing about it And so this has been my journey since then and actually I really really think that I've been able to kind of fit that square peg into a round hole in some sense rust does that really well And that's why I really wanted to say thing and It's not the borough checker, you know, I'm to be honest, I'm not that interested in the borough checker I can see that it's great for security or that but to be honest if it didn't have it I'd still use rust. I don't really care I've spent three years actually learning how it all works and fighting it and reading papers to understand it So that was a pain, but I don't really care that much about it to be honest But I admit that I don't write software for many other people than myself So it probably doesn't matter that much to me, you know where I can see that it's great applications It's really useful the thing I would say and I wanted to make clear about that is that it's the thing that means I can't teach rust to first years I Don't in my university. I think it's just too much. I can't teach rust to first years because of It's a lot to take in Particularly if you haven't had a lot of computer science and programming experience and most of your experiences in Python or something I personally feel that it's too much, you know people they find it hard my students find it hard They don't even read the error messages, you know, you're just trying to get to look in if they start to read those complicated You know be right reading the messages template metaprogramming. They're not for the faint-hearted and you know It's not for the faint-hearted. I mean, it's just a comment and so I don't think I use the borough checker to anywhere the kind of Power that you could use it and it's just because it's not interested the and the abstractions I'm interested in are things like traits And the you know the parametric polymorphism that you can do over those traits and things like that and build it up the The kind of additions of kind of you know, obviously the range loops, but moving those more into having nice Where you can return things and get the nice build-ups of functional kind of style expression and things So that for me has been the bit that was missing from C++. They course they're putting it in Well, you know, it's like this again, isn't it? They're putting it into C++ some somehow And I find myself mighting more C code than I do C++ now because of of that problem, right? It's just so complicated and it doesn't really seem to fit that well Anyway, so that's what I was gonna do. That's an aside. I want to talk about it. So I ended up using Rust so back to the main part of the talk and so here is a diagram that comes from this guy called Thor Magnuson Who's a famous musicologist stroke computer scientist stroke musician who's a professor at Sussex University In the UK and he describes an instrument To look somewhat like this so you got this kind of the sound engines here the sound production Things you've got obviously got your synthesis whatever over here whatever is creating the sound and and you've got this gestural control Here, which is the interface that I showed you the bit where you're performing interaction with the instrument itself And obviously there's feedback. There's audio feedback coming from here and there's hopefully haptic feedback coming from the interface itself and And Really I've kind of completely separate. I don't really think they are separate I'm not trying to argue that separate, but it's much easier just like discretizing examples And it's if we separate those two things out and a lot of my work has been looking at that Divide in that line and of course the mapping then becomes a serious problem And it's not one that's that easily solved at this point So you'll see I have a whole and I'll talk about just at the end a whole rust based system Which is purely on this side of the world, which is just doing synthesis DSP as he integrates this language called Faust Which is a purely functional language for DSP just it allows you to Write DSP graphs in a functional expression. It's just a very mathematical. It's really nice we've got this little what of it generates C++ I've modified it so it generates rust now and It's just you know generates effectively a trait with some simple methods for initializing it And then a function to ask for n number of samples. It's not particularly difficult All the smarts is done in the Faust compiler, which I don't have anything to do with they're all based in France and super smart mathematicians Working at a conservatory, which is kind of slightly odd Anyway, but and a lot of this here has been building physical interfaces But using rust to interact with the physical world okay, and I'm not going to talk about it today, but we've also got an embedded platform Which is all hardware which is based on STM or ARM based microcontrollers mostly M4s and stuff that we use to do to connect to the physical world for actuation and sensing and I Did develop some of that initially start doing name rust I started working on that writing You know from bare machine writing it up, but I gotta be honest after about a year I kind of gave up and I've just write it all in C now just because of the code is really simple it's not very complicated and We use ST Gyps, and they provide reasonably good libraries And so there was just a lot of work and I know some brilliant there's some brilliant work going on And I guess when that's got to maturity That'll be great just I can just start off and I won't have to do all that work of getting the register's to map and all that So I you know I'm gonna put my hands up here I wish I hadn't had to go back, but I chose just for practicality reasons to go back to using C For for speed of use and I think that's really my message about My use of rust is that where it's been amazing is that you know You've got a credible ecosystem even though it has not that old and it works mostly across most platforms I've tried and you know can be packaged up. It's really great and that is a bit more tricky on the embedded world today Okay, so I probably won't talk too much about this But if you imagine that we've got an interface like this So I've got this whole system where you describe them in terms of Extended SVGs and you can you can draw them or you can write them in a little domain specific language Which I'll show you in a second and you can mark them up to say whether these are generating What kind of gesture you can do whether they're generating something called MIDI or OSC, which is open sound control Just a way of communicating standard communications and you take these SVGs and then you run it through this system Up here So this is it's a domain specific language It's actually an embedded domain specific language although you wouldn't know because I've embedded it in Haskell So this is the point where you can see the different things with rust coming in and I think using it where it makes best One of the things I found limiting at the moment Well, one of the things that Haskell is incredibly expressive with that you can embed a Domain specific language in Haskell and you and kind of rework the syntax You know, it's not racket. So you can't completely rewrite the syntax But using this thing called template Haskell which brings in template metaprogramming, but we won't go there But it's quite nice of being able to define your own it know own Syntax not completely you have to borrow some Haskell syntax and rust I've still found that because of it still looks see-ish in some ways You just still end up with a syntax that looks quite programming language Even though you can definitely embed it So I think that's a trade-off and that's why that top one up there is Haskell rather than rust and you know It's not performance is not critical at that top one. It's not doing anything. This one down here is doing path tracing and Rasterization it's because I'll show you the pipeline in a minute So performance is is important here and it wouldn't be so simple in Haskell I mean, it's still offline So we're not doing real-time rendering or anything like that And so you could probably get away writing in Haskell, but just didn't feel natural to me much better fit with Rust and there's also this amazing library called lion only online yet lion I think it is which is a 2d path rendering library, which I've modified slightly But mostly I've used it out the box. It's just a wonderful library developed by this guy Nicholas and And again depending where we're going This is all offline and generating this this generates things for it's called the rolly light pad Which I'll show a picture of a minute, which is a little embedded Controller which has a touch sensitive interface with 15 by 15 LEDs and you can upload little C programs onto it They're not see but they see like it's like a little embedded language that you can upload onto it So here we're actually generating code, you know, just text files that are then uploaded on to the thing So we're not doing any real-time processing or handling so speed again is not the critical thing Symbolic processing of what's outputted here, which is I'll show you that Jason found a second over here though This is the thing that connects to touch sensor that I was talking about This is real-time. So this is basically a driver, you know, it's driving It's talking with a very low-level USB driver and this is doing all the mapping from the rasterize it well I'll show you what I mean by rasterizing the second but effectively its rasterization and Here so performance is critical because you know We're actually this is running live with a musician playing it all the processing of when you touch something Mapping it to the semantic meaning of you know, are you in the right place on the sense? What does it mean? What's the action you want to perform? It's all happening in real time and effectively Hopefully you all know that USB USB Jitter is pretty awful on particularly on Windows and you know plus or minus three milliseconds is good and Even on the Mac, it's around two milliseconds, but it doesn't jitter which is quite nice And and then you've got the latency of evolved as well of taking that and generally on the Mac Actually, it's around recent upgrades around seven milliseconds on average without jitter, which is pretty good They say that you want to be between You know, but when you perform an action to hearing a sound you kind of want to be within ten milliseconds But if you think that it's taken seven milliseconds to guarantee that we're going to get thing You haven't got that much space to do any computation on the other side, you know, they're still doing synthesis I mean, obviously you're creating more than the same. So this is what performance was really important here Initially, I started in C++ and it was just you know C++ and you know I'm fortunate enough to be in a research group And so I get to explore things and play around with stuff and so and I've been to foster them And so Rust is where we are here. They work. It's worked brilliantly. I got you know, as I say, it's that whole stack Has just been great Okay, so I won't go into a lot of languages here But just to give you an idea these are the kind of things that people write in the language If we actually have a visual editor as well, so you can just use it in the web browser and draw, but I'm quite interested in what you can't do in a visual editor to particularly photograph Programmatic, you know expression. So for example, I've got this little example where you have an interface of Sliders that is drawn in a sine wave and that would be pretty hard to do I mean you could do it in something like illustrator in our little thing But you wouldn't be exactly following the sine wave. You'd probably be off and you know It would be a pain. Maybe you could be using bees flying or something but and so we have a little language that you can write this is like a stop button and You know, it's got size as a square one for this case And you can have something like a pad and then you can start talking about the kind of address this so this is the An OSC address so this is effectively the message. I'm doing right for time on it. Yeah Okay, so and I'm not going to go into a lot of details about this But you can compose them together and build up more complex interfaces. I mean, it's not rocket science. You know, it's the standard stuff this does, you know Use some stuff in Haskell like dependent types and stuff to make this all kind of fall out and it uses this Special extended use dependent type we can overload the syntax which gives us these special operators which allow us to have Arguments that aren't ordered, you know, you can actually write these arguments in any way And so there's it. I mean, it's more of a if you're interested in type systems. It's quite fun But it doesn't really matter to the user. You can build up interfaces and there's a little Domain specific controllers. What's interesting here is that we have a representation. These all just map To standard SPG types, right? You know, that's a really nice thing about SPGs is that of course They're just XML and if you extend it Illustrator will still display it or your web browser was today and it will just ignore any metadata that it doesn't care about I mean, it's great, you know, and obviously nothing to do with me. People are doing this for years It's just really handy particularly because this is kind of a graphical thing that users can see their interfaces and things like that so it works quite well and Obviously we have things like this What I didn't realize when I started off doing it, I should mention that I mean, this is nothing to do with Rust or anything was that initially I just used these three standard SPG types which aren't using Paths right they're not doing beast blinds or anything like that or any kind of thing but it and it's really easy to map if you imagine well, particularly if you know anything about rasterization and Desolation once you take this shape you try and glass it. I'll show it looks like a minute You can then rasterize it into effectively an array and you just get a bitmap of where people touch Right because it gives you a kind of mapping from a position on the on the screen to a point in an array And once you've got a point in the ray course, you've got a pointer to a class and you know or whatever a Data type and then you can perform an action and you get effectively Order one look up, you know for your touch, which is really important, but it turns out That actually because we're doing tessellation, which I'll show you what that means people We don't know what that means a minute is that you can take arbitrary paths and so people could start to draw weird You know, there's still vector drawings, so they're not completely weird shapes for their interfaces That all works brilliantly the course the difficult part is then to recognize gestures because you know if you've got some weird curve like this How do they want to interact with it? Is it following the path or do they want to interact it with you know multiple fingers things like that? And so I still haven't solved that problem yet I'm working on that and I I've kind of got a bit of a mapping, but it's still something to work out So this is the SVG that's created, you know, we won't worry about that So this is where rust really plays its key role in this pipeline is that so I don't know how many people are familiar with the graphics pipeline. Yeah. Oh, so quite few is great So hopefully you'll realize that this is effectively a graphics pipeline, you know my background's in graphics And so I do this so effectively we take these shapes up here is And what you do if you're rendering a 3d game or a 2d game It's particularly if you're going to run it on the GPU is you take some primitives some shapes up there and they're Normally, they'll be effectively they'll be described in terms of Triangles so this phase would have already happened you'd have a mesh and you just you just render that to the GPU And if you haven't you'll do this phase. So this phase is basically shape tessellation, which basically takes an arbitrary shape I mean it can't be completely arbitrary But as long as it's described mathematically either as a B spline or as a standard geometric shape like that and you divide it into triangles Okay, so modern GPUs of course support this actually in hardware as well So you can do it normally you'd send it a triangle and then maybe you divide that into more triangles So you can increase the resolution without having to send too many triangles in the first place, but we're not interested in that What we really do is we have this shape assembly phase. We label it with a number Here because we want to have a unique ID when it comes into the system itself We tessellate it and this is where lion comes in. So I'll just give you the little thing here He's done all the work hard work for this. There's some really smart work This is all the stuff they're doing for the web GPU stuff and things like that and relate to you know in the fire I don't know if he works for Mozilla, but quite a few of the Mozilla team are working on this and related things so we tessellate we generate basically a set of triangles and Then you have this phase of rasterization So this is the bit in the GPU where they're actually generating the pixels, you know They've gone from these geometric shapes infectively a triangle and they generate a bunch of colors that sit on the thing The observation here is that we don't really care about the colors because all we want to do is generate a lookup table Front of thing. So we just write we just write out our number that we generated in that shape Assembly and I'm using shape assembly because they call it primitive assembly in the Graphics pipeline. So it's just a bit of a play on that. It's just really assigning a unique number Okay, and so you can see that we've just generated this lookup table and clearly this will be the size of our Device that we want to target whatever that might be. Okay, so I'll move on quickly This is what you might look like when it's tessellating obviously tessellating squares and rectangles or rectangles and triangles with the trivial it only becomes complicated when you're doing Non square shapes or rectangle shapes actually circles pretty straightforward It only really becomes complicated if you have a squiggly thing like that because you might have a you want to draw a line And it will go outside of the thing and so you have to start chopping that up and that that's where it becomes complicated That's where a few bugs have come up in line where they miss a point and you end up with a fat line rather than the thin line things like that, but anyway, that's most of that's been resolved now and This is literally what happens, you know with your thing and if we are rasterizing it This is what you look like, you know, you've gone When you think about the size of the sensual so this is you know looks like an 8-bit retro image You know, but it's it's like that, okay? All right So then finally we get to the end bit. We're just really That would have been a nice bit of Jason which would have shown you the Wow I have to fix that another time up here. You can see there's the buffer up here So this is the buffer which is that is the one-to-one mapping with the is the array basically the maps That's been rasterized for all possible shapes. And so all you'll see is a 250 by 180 array of Shape ID numbers so you know if it was a circle it would have five in it if it was going round and things like that so There is one drawback with this whole system and which I will mention and Is that hopefully you can see here? I'm not going to have aliased all these points Okay, because this is nice the alias here And so you kind of get this when you look at it from far away it will look like it's nice and round I have to make a decide whether this is the in point and this is the out and so it's potential if you're doing very Fine grained interfaces. You might get behaviors that you're not expecting So and I don't really have a good solution for that moment Anyway, I'll move on quickly because I haven't got that long. This is what these two interfaces look like This is the really light path this little company from London who make these Overpriced box so finally I'm just going to finish how long I've got left about five minutes. Yeah, cool So this is a little application. I've developed it's completely written in rust about 25,000 lines of rust it's a hundred percent rust and It doesn't build anymore because I upgraded the compiler but anyway, but it's actually but it's really nice So it uses that line so it's all 2d based rendering path rendering to generate all the graphics Step sequencers it uses the simple threading library, you know the and cues and everything and but and it runs Really really well the performance has been amazing on my Mac and something really great Because you know it was a question when we started this project wherever rust was quite ready for doing real-time audio and I know a few people from Ableton have been exploring it They're a big audio company, but it's just been great and it's been a real pleasure to write it and and Everything and what's been really nice, and I'll just finish up on this Let's just group as I said in in France from Paris in France who have developed this functional programming for DSP programming language for sound synthesis and audio processing and It's a really nice. It's very mathematical So if you're interested if you're good at DSP and understand it It's brilliant place to start because you're almost writing the DSP equations and stuff and things you know and has delay lines and all that sort of stuff and as I said that they You write something that looks a bit like this and so very simple code if the stupid thing wasn't wrong you can see that this is a simple little oscillator you can set the frequency and The only thing that I don't like about it is that they've kind of assumed that you have this little kind of web Base interface or little GUIs that they generate for interacting with it And so that's okay, and there's ways of linking that with C++ software or whatever Which if I went to the next slide and it was working well, you'd be able to see but C++ code But I don't know why it's done that sorry about that But you can see that if I can show yeah up here So this one here they generates these codes and that comes from the fact of course I just want to go back one slide that they have this H slider up here Which describes a kind of an interaction with the outside world, you know it's a side effect effectively, but it's all functional and So they need a way of connecting that and to do that they introduce these variables when they generate the C++ code or when I generate the rust code it generates something as well and Then they have a way that you have the head like this UI that you pass in which is the thing that's controlling it Which actually has been a real pain for us because when you build up an audio application That's not really how you want to pass around your dead You really want to separate it as you know the UI wants to run in a completely separate thread There isn't real-time dependent whereas the audio thread is got to be you know real-time doesn't want to be and so he can miss control signals Because it might not look at the queue because of time things and everything whereas this is kind of all quite it fixed in So what I ended up having to do was Sorry about that it's really annoying, but basically if I slide over to here You'll see that there's these functions here. So when I generate the The rust code you basically describe a JSON file which describes the The site the variables that you want to change and then it generates the rust code looking at that and will generate just a bunch of Setters and getters. I mean fairly straightforward. There's nothing smart about it. It's really very simple code It just has a simple Strap plus a simple implementation the implementation is initialize the audio process that you know the seek the synthesizer or Whatever variables need to be initialized and then it has a compute function that you call For how many frames you want so maybe you've got a 64 frames that you need and you just call it And it's a simple loop the really nice thing about the fast compiler It's because it's the way it compiles is that there's only a single outer loop There's no nested even though you might write it with recursion inside it It can propagate it all the way to the top so you end up with a single loop and so it's incredibly performant and of course, you know LLVM can rip through it and optimize it really well There's no aliasing. There's nothing so it just the code it generates is it's great and so it's really nice interaction and It's benefited that rust was written in LLVM because I now just generate from LLVM from because the files goes to LLVM as well so that's been really great and You know another great thing about rust is that it chose to use LLVM which I love you know GCC is the haunt of my life and Anyway, so that's it really just wanted to say and I just yeah, I suppose the punchline. I already gave it to you was that It was really brilliant. I just the package. That's the thing for me about it. Everything else. I love him rust I've used it all the time, but cargo is just it's just been like the best thing You know an MPM, you know, well JavaScript. Hey, I still quite like JavaScript. I can't deny it. Anyway, that's it Okay, yes So the question is in rust there are Some other work going on we're particularly in video and audio and image based Control systems is there an overlap with this work? I guess there probably is I must admit I'm not that familiar with them and so but I don't see any reason why there wouldn't be I don't I There's some novel work in this but the rust part of it probably isn't that novel other than I think it's a great application For rust, you know, we wanted performance, but I really care about having some of those high-level Extractions and that for me is the main that's why I would encourage people to use rust again. I know a lot of People and I hear people at my university Particularly people in the security groups talking about rust because Microsoft now talking about it, you know, and I absolutely that's great I completely see that it's just I fall asleep when they start talking about it So it's just not me, but that's just a personal thing and not a criticism of rust at all when the borracher I mean, it's amazing. It's just not my interest. So but yeah, okay Yeah, if my cold that's you feel a bit better now, I think that's got a sweat on so it's good, but yes. Yeah, definitely