 Hello, everyone. This is the first time I've ever had to use sound in a demo, so this will be fun Hello, everyone just before I start I thought I'd Everyone should give a big round of applause just to Michael and the PHP Asia crew because I've done a fantastic job for the second year So we got and these events Yeah, we're back We're good. All right, and these events take a you know a long time to organize They're putting a lot of their own personal time just to make sure it's as awesome that it is So yeah, I am Steven Cooper also known as developer Steve on like all the social media as possible I'm even on weibo. I don't really speak Chinese that well, but you know, I'm on weibo. It's a it's a cool platform I'm the senior evangelist at zero previously from some payment companies You may have heard of and I think it's great to be back in Singapore and see a whole bunch of familiar faces so I think a few of you may I may know a few of you and Definitely have seen a lot of familiar faces and great to be back As I said, I've done a few events. I think I'm this actually needs to be updated But I'm now nearly 10 times around the world just in distance. It doesn't feel like that. But then yeah, it has been a long way around Basically through my activities I've been able to connect to a lot of developer communities and Singapore has an amazing developer community I've been lucky enough to come through here quite a few times having operated through Asia Pacific Particularly and it is one of my favorite places to come. It's it's a great place and the community here is truly amazing So I now do that for this company zero relatively new to the Asia Pacific region and and growing 700,000 subscribers globally In the developer ecosystem that I connect to there's 50,000 integrations globally 12,000 sorry 19,000 active developers throughout Asia Pacific It's it's busy days. My inbox is never empty We basically do accounting software So it's cloud-based accounting software and it makes things nice and simple for non-technical and then we have a really great Developer platform for technical people to be able to build whole new experiences and make Technic non technical people's lives a whole lot easier and nice and streamlined And one of the one of the things I look after now is partner integration So how developers connect to that and then build out extra functionality? The reason why I'm telling you this is a lot of the integrations that we review and a lot of the review process It uses PHP and it's it's something I quickly noticed even at last six months was a Majority of the integrations I was seeing come through and requesting partner status use PHP, which was great Because I love PHP. I've been using it for many many many many years. I am a real fan. Yes I am there's going to be lots of puns just a heads up But I've been using it for quite a while so previous to being an evangelist I worked on a number of digital agencies on some really really big projects Even some of my previous talks in the last few years one of the things I'd use PHP 4 was in IOT So using an Arduino you and to basically do some automated receipt printing I think this video might be a little bit long so you may not get through all the way Basically on the on the youn you have two sides to the Arduino youn There's the like a really light web server side, and then there's the Arduino side with a bridge in between So you can use the server side to basically pull some data down push it through the Arduino side interface with some pins and be Able to push push something out through through the interface pins What that looked like now I took this actually through mine countries in the last few years it's Since you know farewell retired But thankfully I was never stopped with this little tiny cardboard box of the whole bunch of wires through it Can make some for some interesting times through some airport securities. Let me tell you Yeah, that was that was powered by PHP because it did the job. It's a very very versatile platform as you all know Another project I use it for previously back in agency days was I used a Chromebook to create an Instagram printer So very similar function it would pull some data down and then interact with some with a printer in this case and print out A picture with with some branding on it PHP is great. It's so versatile So someone I've been fortunate enough to be at a few conferences that was Andrew Sorenson who Did did some amazing things using mathematics to generate music and I thought surely PHP so great surely it can do that Can PHP make sound which is basically where this talk came from I thought I've used it for so many unusual things as it is Surely it can it can you know it can make sound Yeah, it can Well, yeah, it turns out actually it can Now before we get started in this next bit I just want to say I am no musician although I did play drums many means ago In a previous life, but yeah, I am a musician so by any means this is not going to be chart busting Well, it might I don't know probably not but we'll see but yeah Did some looking around and sure enough PHP actually can make sounds it had integration with open a L which is like an open sound library And it even has a section on PHP net for all the wonderful functions You can do with this stuff and but you can do channel mixing you can do a whole bunch of different resampling You can do buffering and all sorts of fun things. There's even a wonderful library. You can set up and install Sadly, it hasn't been updated since 2003 so Yeah, I couldn't really do much with that Regardless of what I tried I tried, you know the automated good old Bruin stall and yeah I managed to get part of the library installed, but then it just it just wasn't happen. So I did some more digging and Sure enough the fantastic community that's built up around PHP I found some get repose with people over the years and it was interesting It was almost like an archaeological gig because I was going back through time seeing all these people that Suddenly needed a reason to create like some some sound or some basic way files So they produced like a wonderful little script that would be able to do that The first one I found was was fairly basic, but it just said like approved that it could be done Someone was interested in doing this so I kept digging and then I found PHP wave utils on on github And that basically has a whole bunch of really cool functions in it Looking through some of the the commit history Rasmus actually added something to it like last year. So yeah, it's had some interesting people Like add add some more community value back to this project How it works you basically just create a standard instance container and then add you can do some fun things Just adding different sound frequencies in over different periods of time. It doesn't sound anything great I'm not gonna ruin it. It basically builds a raw file and puts it into a container like a wave file container Which just comes out as? decompressed audio So let's give it a try. Hopefully I've got like four demos. I'm doing which is a record So we'll see how happy the demo gods are Let's give this a go All right, so this is basically what it's Sounds I think I may have jinxed it. No, there we go. We're good All right, so this is basically what it sounds like. This is just a really basic script. Let me make that a whole bunch bigger There we go. Just a basic script. It's just gonna create a tone I'm cheating a little bit. So basically outputs to a wave file Like I said, and then I'm just using shell exe by all means I don't recommend using shell exe for very much except for producing sound which I'll leave it up to you Whether you want to want to do but yeah, just for fun. We just got to automatically play the file just to speed things up a bit Learnment of truth Wasn't that exciting I'm glad that actually works So I thought you know we can we can build on that a little bit because that was that was pretty basic So what I did I went through and got all the the stale notes in C and Added them into an array just a basic array so I could do some basic songs. So I've got the the Darth Vader March that It's not the death March, but the Darth Vader song. Everyone's gonna know it. Everyone knows it is a Darth Vader song It's fine and it basically loops through all the letters references the the the Hertz that it needs to come out at And then just loops it out dumps it into a wave file and I'll just play it fingers crossed for round two It's basic, but it does it kind of And it's great if you want to do like hipster ring tones, which you know that that works those of us who remember the old old style phone It's basically hipster ring tones But I thought we could step this up a bit We could take it to a whole other level because yeah, that was that's pretty basic Pretty retro so we can add samples in which is pretty cool And like the library that libraries got all that available like that functionality built in that we can mix start mixing samples in It's does start to get a little bit complex. You have to look at like sampling rate channels frequency bit rate lengths I was up till midnight last night resampling a whole bunch of stuff that we're about to do And you can do some fun filtering. That was part of the stuff Rasmus played with was also Sound degradation so you can mix two wave files You can output two wave files at different frequency and then mix them together to create some really really funky sounds with Degradation between the two way files. We'll We'll try that again These little eight-bit things. I love these all right demo to All right, so I've already got some wave file load loaded in because I didn't trust the demo gods that much And then basically we're just going to start mixing some stuff in trust me. This gets way better All right, so We'll just do one loop now. I've got a basic loop in there so I can do some do some fun mixing stuff on the flow So now we can start looping that around a little more That sounded really good in the sounds That's how did you get a bit front here so we can start to add some more instruments in industrial techno And now we can also so one of the other things I was playing around with this morning I don't know if anyone knows about this one, but you can get on a Mac. You can do command line Text-to-speech so you can go Hello PHP Singapore so you can output that to a file which I thought oh, this is fun I can start doing some some some talking in there, too. So let's add that in 64 and start doing some more fun stuff so we can oh, yeah So much fun that bit so much better than the hipster ring turns So yeah, you can start doing some really fun things starting to mix mix some of this sound together Then I actually thought memory may have been an issue at some point But it hasn't seemed to be yet mind you I have got a fair bit of memory in this Mac and running in Yeah, so it may be at some point And I don't know whether you'd want to use it sort of long-term to do some DJing bit you can So then I guess the next the next thought that occurred to me what having you know dealt with a whole bunch of API's before is I wonder if we can start feeding some API noise into this. I might we have a PHP wrapper which the community supported It's you know freely available that we I can interact with so I thought I wonder what would happen if I Sort of fed some of the data into into our from our PHP API into some of the output to hear what it sounds like So last one Been really lucky with the demo god so far. I know I know this is when the room melts All right, so I've got our PHP library already installed. I'm using our private authentication So you consume a key and shared secret. I do anyone any good because you need a certificate as well But yeah, it's already already set up and I'm basically the output from creating an invoice I'm gonna channel it straight into the output the way of output to see what it sounds like so Everyone ready. You're holding on to your hats. This is the finale one. Yeah, you've actually got a hat. That is amazing Here we go Cash register noise Everyone come off now. No, I should have done a laugh track anyway Yeah, I didn't actually output because it would have just sounded like garbled white noise Which I could have done as well. You can actually do white noise with the with the the particular library, so Anyway, that was that was kind of me the I guess the final question where that is can PHP may or the answer to the question Can PHP make sound yes? It is but I'm gonna leave it completely up to you whether you want to do it or not I think some of the interesting projects though that I did look at and some of the sort of User cases a lot of people with raspberry pies looking to make sound for various sort of real world Experiences like doorbells or changing Sound interactions when somebody enters a vicinity of of a IOT unit Like you can use these devices to be able to interact that way Maybe that was the original intention for the open AL Integration, I'm not sure that was so many many many moons ago. If anyone does know would love to chat But that is me Thank you very much. I would let people ask questions, but I don't know if anyone would out anyone got any questions with making sound and Yes, I already have asked how to few people say why Make a brand no, no, that's a shitty thing to do Oh, I did have an opening joke Oh, I should have that would have been better than cash register anyway next time time travel That is me. We are hiring. I already put a notice up. Anyone wants to chat come and have a chat But that is me