 Yep Was that a yes or a wait it was a wait it was yes excellent. All right. I present yes We present Ben Savage about learning to site read. Hi okay, so this is Similar journey to the the talk beforehand. This is Largely how I learned how to use a whole bunch of Lilypond stuff and some interesting PHP stuff and mostly how I do read better than I could be for So who am I? I'm Ben. I am a sysadmin at Deakin University Although I'm not actually really presenting them at the moment or representing them And I have a sort of interesting history with music so when I was a a little tyke I had I think one piano lesson when I was about five and decided that just completely wasn't for me Then During you know school we had all our music lessons So that's where I learned sort of basics of music. We didn't really do any Reading of music. They just taught us what notes were that sort of stuff when I was a teenager I played the euphonium for a term Also decided that wasn't really for me And then I sort of had this Renaissance a couple of years ago And apparently my clicker isn't working Ah Yes, so I I Got a keyboard for one of my birthdays and just sort of learned how to play piano from that with my very basic Musical knowledge. I managed to sort of brute force my way through a whole bunch of pieces and Got very good at remembering things which is important because that's gonna come up and since then I've sort of Fallen in love with musical instruments There's a portion of my collection The important thing to know is there are two cellos there a Whole bunch of ukuleles congos a thunder drum a clarinet that I'm learning We have a clarinetist Also also a kalimba think I'm missing and one of my other loves the ocarina or five thereof And the keen-eyed people there will notice that they're all sitting on top of a grand piano, which is in my bedroom Just just under a quarter of the floor space and for scale. There's a corg tiny piano on top of it Because it's adorable So what have I actually done well, I'm not very good at sight reading music This has been a problem for a lot of reasons we'll get on to that So I decided what I needed was a way to generate some random music so that I could learn how to sight read Most people would just use practice books or something like that, but there are a couple of problems with that So for one thing like I said, I've got a pretty good memory for music these days And once I've played something through once or twice All of a sudden I don't need to read the music anymore, which is a problem when you're trying to learn how to read music So, you know, we you get all these very repetitive exercises where you'll go up and down the Scales all that sort of thing, but once you've played through it twice That's all you ever really need and then I stopped paying attention to the music because I don't need it anymore Other problems is all of these exercises tend to have Reasonably obvious patterns, so you'll just be going one three four three one two three four Etc. With your fingers and once you've noticed that pattern being go you don't need to look at the music anymore Playing by ear. This is a fun problem None of my music teachers are allowed to play me anything anymore because if they play me the music I don't need the music anymore So my cello your teacher outright refuses to play me anything and I'm having to coach my piano teacher not to play me anything Because as soon as they do we're done So just in case you haven't been classically trained with an instrument. This is the sort of cello practice you'll get You can probably notice that there are quite a few patterns in there It's fairly simple. It's It's fun and when I started seeing these things I started thinking hey, I reckon I could automate this This is an even more insane degree of that where you have the same pattern the same Four patterns just over and over starting at I think it's a c5 and an e5 and going down to a c2 on your cello So you just start at the very top and do the same thing over and over all the way down Admittedly this one is actually more for you know getting your agility up than actually learning the music Another problem is these practice books are Reasonably expensive that that's not a huge problem for me, but it is for a lot of people Practice book can run you anything from you know, like 20 to 50 dollars depending on what level you're at and You know how many exercises there are and how prestigious the author is There's this great site IM SLP Which I can't remember the the International Music Library, I think it is Which has just pretty much every public domain classical music piece That there is The ones that still exist at least and have copies around so if you can think of a classical piece of music Odds are the full score is available in IM SLP. So that's pretty handy for those two exercise books, which These are both from IM SLP The other thing is I Find when I want to have to practice it'll it'll just like come to me Oh, I feel like playing and that's problematic if you're somewhere Like if you can't be bothered getting your books out or if you've just packed them all up or whatever And Also, I'm sort of what with IM SLP I'm inclined to want to use things like tablets and and computers instead of having to carry these books around So I wanted whatever I was going to write to work on anything. I had just on me at the time So my phone for instance Let's see if we can find where we were I love that grand piano And of course, I wanted to actually learn music theory while I was learning to sight read which it turns out Tends to happen when you're trying to automate an entire musical process And also how to automate the whole thing like I said, I saw these huge patterns there and I thought I can do that Or rather I can make something do that I tend to abide by the principle of if I should only have to do something once You should never have to reuse code You should never have to you should never have to write something down more than once if you have a whole bunch of data You shouldn't have to manually click and drag it or copy it at paste it. You should you should code that So let's let's see if my live demo works Which would help if the point it did self-sign certificates They run the modern world And it's gone to the wrong place Nice. So here is our standard interface here. You can pick Any key even the ones that don't actually exist which is quite interesting You can also pick almost any scale. So how many of these did people actually know? So I certainly knew the major minor harmonic minor chromatic pentatonic Scales, I didn't know about the whole tone the octatonic or the Ravel scale There's also another one the mystic scale that I need to actually put in So I just since everyone's probably familiar with let's look at the same age scale You can also put in pretty much any time signature. I Want to make it do more than that, but I mean That's a future project. I think and then there are these sort of practice modes that I Started out just wanting to learn well get get better at recognizing which notes for where so I just had this Sort of random pick a random note put it up and then I could you know print it off or just you know say C E F blah blah blah This is a sort of later edition So I started off having a treble and a bass clef because that's what you use piano on a piano And that's what I was primarily trying to learn how to play But then I realized hey I play a cello now and a whole bunch of cello music is in the tenor clef and if you reveal the player You might be using the alto clef They're also a whole bunch of other clefs, but I haven't put them in yet because I'm lazy And one of the other sort of cool little features That Lily pond has is the ability to actually put the note names in the note heads, which is pretty cute So we'll take that as well so that I don't look like a fool in a second And so it goes away and since my resolution isn't proper. It's going to put it in the wrong place And so here we have Some just random notes This is what I started with so that I could just try to pick the notes faster and faster But then I realized that this sounds absolutely horrid when you try to Play it on a piano or something like that as we will soon discover Except apparently we weren't let's Let's swap this around shall we? Let's use the local version that actually works. Why isn't that my hdps? I think I left those pretty much as I did didn't know This is going to show us how to do scales So there you go. It's generated a two-octave C major scale right there. That sounds fine I wanted to show off how horrible random scales sound so that that's kind of dull Not yet But I'm gonna put in a mod So So I found that that was obviously really dull repetitive and didn't actually help me learn all that much so Just more as a testing thing than anything else. I gave it the ability to generate full scales Which is kind of interesting when you look at some of the other slightly crazier scales So this is fairly recognizable for a whole bunch of um this is not enough Sort of a late romantic era French composer there coming up with his own crazy scales um So, you know, that's that's a good testing thing and to get yourself familiar with Each of the various scales obviously you might be playing a d scale a d sharp etc um so Then I started thinking about What it really is to site read not really as deep a philosophical question as it sounds there and it's it's more about being able to Play the music than just to be able to recognize it So I came up with a couple of little other exercises that help with that. Let's just make this something nice like a third So in this mode it just sort of works around the scale Let's make it generate a bit more as well I've called it wandering because it just sort of wanders around the scale So your interval is always going to be a second. So you're always playing the next note in the scale. So For piano more than anything else, this sort of helps to get you used to it to the fingering So normally when you're playing a scale, you'll just go all the way up and then go all the way back This is more about getting used to, you know, maybe stopping halfway through the scale and then going back down all all that sort of crazy magic Each of these have their own little crazy options So for this one the treble clef the bass clef is a third off from the Treble clef so that when you're playing it, you're not necessarily playing the same thing in both hands But it won't necessarily sound horrible because you can pick what interval you're gonna play in and a third is is relatively pleasing Then so so that gets you used to sort of playing sort of progressions of notes There's this other mode, which is which gives you clusters of notes and And so the important thing here these are coming out random both sides This is more about Learning where to put your fingers so just because in the wandering mode you always know sort of which finger you're gonna use next but this cluster mode It might do a big jump so you need to sort of read ahead to figure out where the best place to put your hand is and Yeah, that that seemed like a good idea admittedly I spend more time developing this than I do using it so It could do with some testing if anyone wants to learn how to sight read music This next one is one that I'm kind of excited about just because it's it's jazzy And it'll give you lots of chords and These are these are completely random chords again. This is sort of geared towards the piano Where you just need to know where to put all your fingers at once rather than being able to sort of improvise with the clusters and You know, you're probably gonna have to lift your hand off and move it whereas with the clusters, you know You have some wiggle room there These are all pretty jazzy chords there But the cool thing about this is you can change a lot of these parameters so You can't really play this on a cello and I quite like the cello um, so what you can do is you can tell it what the Maximum and minimum size of an interval is so with an interval you can't really play a second on a On a cello just because that pretty much has to be on the same string or you have to be able to stretch really far And I have small hands so that doesn't work So a minimum interval here is gonna be a third which you can comfortably play on a cello Similarly you can sort of play four notes on a cello But yeah, you end up just moving your bow across all the strings. So instead we'll play double stops, which are just chords with two notes And let's play it in the Tenor clef which is Lots of fun on a cello So here we have a whole bunch of crazy double stops for you to play For instance what I've been learning at the moment to get my hand in with double stops is Yankee doodle But we hit all of those earlier problems of I've memorized it I know how it sounds it's not helpful for me anymore because I don't have to look at the music But this every time I refresh I'm gonna get a completely new set of music So I can never stop paying attention to the music and I know that there aren't gonna be any recognizable patterns as such So I won't just be able to stop paying attention and play by how I think it's gonna go which I do constantly to the Anoints of all my teachers That is feasibly live apparently the OGG stuff doesn't work, but the rest of does feel free to jump on there So the underlying technology is lily pond and lily pond does all of your magical engraving So that's what's coming up with all of these images And that's all entirely tech space, which to me says easy to automate And a bonus is it can create the MIDI and the OGG files so you can Listen to it after on later on and verify that you're actually playing it correctly So we'll look at what lily pond actually looks like So for instance, this is this over this is the accompanying track to something I'm learning on the cello and As you can see it's just straight text with you know some sort of interesting syntaxes So using a square brackets for chords setting your octave with a series of apostrophes and commas and your note length with With a number effectively, which is just so easy to automate the whole thing And you engrave it and it looks really cool And then it will also create MIDI files for you Just automatically So normally you do all of this through text But I'm using Frisk was it fresco boldy for everything so you could do it all in vi if you wanted in the terminal or Whatever you want and just in general. I found it more intuitive than The various forms that you'd used to click where you want to put your note because surprise surprise I can't just do that quickly because I'm terrible at reading music, but I can type it really quickly so Codes all PHP it works pretty much entirely through just generating scales it generates them itself I haven't actually hard coded the Scales as such. I've just given it the intervals for the scale So I haven't put in a D major is you know a D and E and F sharp, etc. I just go okay It's a second a second a second, etc and Then it creates the scores based on A loose approximation of what an interval is in this case. It's not a true interval It's just the interval between you know to index positions in an array So your second is just saying okay It's the next position in the array a third is the next one after that when in reality They're the intervals are actually going to be like a second and then a third Or or a minor third Um One of the interesting things while I was doing this is that it turns out you can't just sort an Array of musical notes because your octave starts on a C Not an a so when you sort your array it's gonna go. Okay. A's the first note And then all of your music looks terrible because you'll go okay C D E F G a B C D and I'll just jump all over the scale So that was really fun, and I got around that really boringly um but What we can look at Oh my is a Little bit of the code there. So this is all incredibly messy and Uncommented you'll notice because that's how real code is right So all the scales are just given by the intervals Then it goes through and pretty much decides whether a note should be a sharp or a flat Based on those intervals and based on whether it already knows that there are flats because a scale can't have a sharp and a Flat in it or at least your your key signature can't have a sharp and a flat in it So it works all that stuff out and just decides on its own which note is going to go where whether it's going to call something a flat or a sharp or a natural which is Pretty easy really when you look at it all and I just like this because It tells you all of these things that don't exist. So a sheet C sharp minor isn't an actual key signature Because it's trying to put an F sharp in with a bunch of flats, which just doesn't work So yeah, I invented a bunch of key signatures there you can still put them in and it'll still work on that scale So what I say C sharp minor C flat minor Yeah So if I find this I can still put in If for some crazy reason you want to that's what a C flat minor looks like So I'm noticing they're three double flats Fun stuff. I probably won't be playing that one anytime soon. Well, where can you give it a go? That's the magic of lilypond Let's listen to it as an actual scale. Ah, here we go C flat gets sorted obviously before a C For some reason. Where's the drop gonna be? There we go So my sorting isn't perfect there Um, oops, that's the wrong thing Um Yeah, so so as a part of this particularly in the sort of clusters area and such I've got this No, actually, I'll get to that in a second Once this starts working So so it has a couple of issues at the moment in that you can't actually deviate from your scale So if you want to play a C major scale, you can't put a sharp or a flat in there just because I'm not very good at programming Uh, and it doesn't actually scale all that well because it turns out lilypond is relatively CPU intensive So if you all jump on right now and try to generate something you probably crash my server Feel free to But you know, it only takes a couple of seconds So I figure you're probably not going to overload it in the next couple of weeks So I've got some sort of future things that I want to put in because it's not good enough yet Um, I want it to be able to recognize or I want you to be able to put in what instrument you're playing and for it to figure out what the uh, what the Abilities of that instrument are so like I was saying before with a cello You can't play a second and you can't play beyond or you can't play below a c2 for instance So it's no good if that comes up in a piece of music. You're trying to read um So I want to put in a whole bunch of stuff like that I'm just getting there and I'd also like you to be able to like I said with the automated automation I'd like you to be able to put in some patterns and for it to just riff on that Uh, and it's got a very sort of basic Thing there where you just create an array of intervals and it'll it'll just go on that But I want you to be able to give it something a bit more interesting And also for you to be able to use flats and sharps because that might come in handy As some sort of uh instrumentation Uh, if you have any questions, I'd love to hear them and feel free to jump on there and start generating music. Well So any questions? Mike Uh, well just uh, I don't know if this is a very good question really, but um This is very good for sort of random uh generation but like when you're really learning to site read is not a large part of it kind of Actually understanding the patterns in the type of music that you're reading and that Being able to kind of um Read ahead and and sort of see a block of music and Based on the scale and the style and that you're doing Sort of be able to read that without having to read each individual note. That is very true So like I said, this started with just a I need a bunch of random notes so that I can recognize my I started You know transcribing pieces and just writing the note names, but I found that was really annoying Uh, because you know, I could easily recognize when there's you know Going to be a d coming after a c and I didn't want that I wanted to be able to look at a note and say Oh, that's a c Rather than look at a note and say that's a c Oh, the next one's a d because it's just a little bit lower than it But with that in mind That's why I created some of those other little practice regiments like the cluster one Right is for that very purpose of being able to read ahead and see what the next few notes are But I imagine you could take that further. Yes, that is uh a a more distant Goal is to get it to create actual pieces in in types of music. So for instance piano dubstep is something I'd like to hear And I'd like it to be able to generate And uh similarly, you know, it's something that's really formulaic like a tucca You could probably Start generating them fairly simply. You know, once you've studied your counterpoint. Well, you just do that in your basin And one other comment, um This is going back more than 10 years now, but um, there used to be the software There were several packages. I know one of them was called band and a box And other ones and they would generate Music for you. I'd to be honest. I forget details now, but I just wondered whether you were aware of those Yeah, so one of my vague inspirations for this is this uh Incredible ai called uh emmy Has a surname, but I can't remember what it is And so emmy is this ai that a guy created to look at a whole bunch of composers music and then compose music in their style. So, um You can find a vivaldi piece that's written by this ai That sounds like a vivaldi piece and you would instantly recognize it and go that is just vivaldi So, um, I won't be creating any crazy ai like that But I certainly would like to get it just a bit closer to looking like actual music All right, so we've hit the end of that time slot. So thank you very much ben. That was um very insightful Thank you very much for that. Thank you I'm here all week. I have a daughter who's learning piano and I think she would uh benefit from some of this stuff because uh Definitely Get her onto it But that is another thing I'd like to get in is for it to be able to sort of start suggesting fingering for stuff but uh We'll see how that goes. Cool. Thanks. So while uh deb's getting set up with her laptop. I'll just um, give a gentle or just a reminder that we've got um, a lightning talk demo And then if anyone's got um pieces they've written they want to perform they want to play What had worked that they've done or give a lightning talk about something See me sometime I'll slot So we'll get started as soon as deb's got the stuff sorted out