This image PR episode 1,779 before entitled 12-tone music, and my random 12-tone role on the May. It is posted by John Colp, and in about 14 minutes long. The summary is an intro to 12-tone music, and my random 12-tone role on the May mask ripped. This episode of HBR is brought to you by an honest host.com. Get 15% discount on all shared hosting, with the offer code HBR15. That's HBR15. Bit your web hosting that's honest and fair at an honest host.com. Hey everybody, this is John Colp and Lafayette Louisiana, and I'm excited today because I've got a special microphone on loan to me from the guy who does our music media area at the University of Louisiana at Lafayette where I teach. This is a really fancy, expensive looking, sure microphone that is what would you call this thing? It's in a shock mount, my clip, and I think it's going to make my voice sound pretty good. The microphone I used before is a sure SM58, which is more of a live-soundary enforcement microphone, and this one is much more of a studio microphone, and Chris recommended that this is the one I should use if I want to do just spoken word. And so I thought I would take advantage of this opportunity to knock out one of the topics that has been on my to-do list for a really long time, and that is the 12-tone technique and my use of a script to generate a random 12-tone row. This whole scripting of the random 12-tone row is something that came about when I got my Raspberry Pi for the first time about two years ago. And the idea was that I had the Raspberry Pi set up next to my bed, and it was networked, and so I could theoretically have it play music off the internet, and I used to do that. I would have it stream radio stations, and stuff like that, like into my pillow speaker, and I thought, well, I could use it as an alarm clock as well, and I could have it just play some random audio file from my computer. But then I had the, what to me was a brilliant idea, and this is from a music nerd point of view of having it generate a new alarm every day, and have it be my random 12-tone row of the day. Now, to, for this to make sense, I would probably have to back up a little bit and explain what a 12-tone row is. The 12-tone row is the building block of 12-tone music. Now, I have to back up even further now, because I have to explain what 12-tone music is. At the early part of the 20th century, I'm talking now about the years 1908-1912-1913. A number of composers were experimenting with a tonality, which is the music that does not have a tonal center. So you can no longer say, for example, this piece is in the key of D major or F minor, or whatever it might be. This is music that does not have a key. There were corollary movements in the other arts, I think, like in visual arts, they moved toward abstraction, toward non-representation, and so, a tonality in music is very similar to abstract art. Now, the leader in this movement was a guy named Arnold Schermberg, who was a composer in Vienna, and he had a couple of students, Albambarg, and Anton Weber. And these guys were very much interested in a tonal music, and they did not necessarily see this as a break with tradition, but rather as a logical next step in the evolution of music that had been lately brought to what was nearly a tonality by the German composer Ricard Wagner. Now, Wagner's music sounds very beautiful and mostly tonal, but if you actually look at it, there are many places in his music where you cannot say for sure what key it's in, even though you hear very beautiful harmonies and melodies and so forth. And so, Schermberg and his followers felt like the logical next step was to intentionally abandon tonality and to avoid anything in their music that would suggest tonality. And so, they consciously avoided octaves and triads and things like this that suggested traditional tonality. And they were, you know, they had some music that was modestly successful, I suppose, in their little circles, the general public typically did not like this music very much. It was not very well received because people heard it as something that was very dissonant. They couldn't understand it. They didn't know where the composers were going with this stuff and just thought it was ugly. And the composers themselves, why they, while they did not necessarily think the music was ugly, they did recognize a certain problem in as much as they no longer had the basic foundation of musical form that had been in place for a couple of hundred years and that is key relations tonality in forms such as sonata form, binary form, things like this. The long-term structure of the piece is based on movement from one key to another and then back to the home key. And when the music is atonal and has no key, you don't have this anymore. And so, one of the solutions they had was to write just really short pieces where movement from one key to another would kind of be irrelevant. Another thing they did was write vocal music where the poetry that they were setting would give the music its structure. But around, I don't know, 1920 or so, Arnold Schermberg started to experiment with a new system that would impose a certain rigor upon a tonal music and that was the 12-tone system. In the 12-tone system, all 12 pitches of the chromatic scale are considered equal. And before I go any further, I'm going to play you a chromatic scale. A chromatic scale is the scale between a note and an octave higher, well, all half-step. It's the scale that has all half-steps and here's what a chromatic scale sounds like. Pretty, huh? All half-steps. Now, his idea was to have a single melody that is the structural basis of the piece. This might sound very familiar. If you heard my episode about the fugue where there was a subject that was the main idea for the whole piece. In certain ways, it is similar. He also subjects the theme, which is in this case called a row, a tone row, or sometimes the 12-tone row. He subjects it to the same kind of manipulation that, say, J.S. Bach would have done to a fugue subject. The row is transposed. It's inverted. In other words, it's turned upside down. So all of the intervals that went up in the original would go down in the inversion. It's done in retrograde and so forth. And so what you come up with is a kind of music that is extremely well structured. It's kind of fun to analyze these things because you can see where the row is and you get to put together this fancy thing called a matrix, which shows you all the possible permutations of the row, and you can use the matrix to help you analyze the music. And so it looks great on paper. It's really kind of fun. For me, the problem has always been that while I can recognize this rigid structure and appreciated intellectually, I simply cannot hear it. And so 12-tone music to me still is not all that satisfying. However, as a project for a Raspberry Pi where I'm trying to do something kind of nerdy and script something, the random 12-tone row of the day seemed like a genius idea to me. And so I wrote a bash script, of course, that's kind of what I do. And the bash script takes all 12 pitches of the chromatic scale and shuffles them and then generates a score. And I use Lily pond as the main engine for all of this. So my script, I think I'm just in the show notes, I'm going to link to my 12-tone row of the day web page. And every night at either midnight or when I am or something like that, the script runs on my server and posts a static HTML page with the 12-tone row of the day as a little bit of score and also has a play button under it so you can listen to it. And in general terms, the way this script works is that I spell out all 12 pitches in Lily pond notation. So c, c sharp d, d sharp e, f sharp and so forth. And then I run them through the shuff command, s, h, u, f which will take them from their ascending order that I just spoke out to you and shuffle them all around randomly. And then what I do is add a series of rhythms to them. And I have a two-do in my script and that is to randomize the rhythms. Now I never did this but there was a guy, I want to say he was in great Britain somewhere who contacted me after reading my blog post about this and thought, man, what a cool thing to do. I'm going to try to randomize those rhythms. And he did it and he came up with a solution and I'll be honest, I don't remember where it is or that. I don't have it in front of me here. So I apply rhythms using the Lily pond number like the first rhythm is a quarter note. Then there is a double dotted quarter note, followed by a sixteenth note, followed by a quarter, a dotted quarter, an eighth, a dotted eighth, and then a dotted half. And all of these will add up to the right amount of rhythms. So anyway, I apply some rhythms. The pitches have been shuffled randomly. And then I have a block of code that will stick all the pitches in the right place in a Lily pond file. And then I run Lily pond on this file to create the score and to create the MIDI file. After that, there is a function that will optimize the PNG file by running OPTPNG. And also, it uses the net PBM tools, which I planned to record an episode about the net PBM tools again later. But it converts the PNG file to P&M so that it can be worked with and then runs it to PNG again, creating a transparent background by finding every pixel on the whole thing that is white and turning a transparent. And then I run the optimized PNG command on it to reduce the file size. After that, there is a function that creates a block of static HTML and sticks the image and the image in there. And then it also puts an HTML5 audio player. And at some point, there must be, oh yeah, here it is. I use timidity to play the MIDI file and pipe it through lame the MP3 engine. And then I use MP3 to org on that MP3 file to make an org version. So I end up with a MIDI version MP3 and org. And all of those are stuck in the right place and a web page is generated that has the image, the audio file. And also has a link to my script that does the whole thing. Now, let's listen to one example. I just generated this one a few minutes ago. Here's an example of a 12-tone row of the day. Beautiful isn't it? Wouldn't you like to be woken up by that every day? Now, I never did actually use this as an alarm like the original intent was, but I still periodically will go back to my 12-tone row of the day page and just play the example. A new one is generated every day. However, I probably don't look it more than once one of them per month. Anyway, hope you guys have enjoyed hearing about that technique from the early 20th century, the 12-tone technique. And I'll have links in the show notes to more information about that if you're at all curious. But thanks for listening. This has been John Colp on a new microphone in Lafayette, Louisiana, and I am signing off now. Bye. How easy it would be is. Heck, I probably radio was found by the digital.com and the informomicon computer club, and it's part of the binary revolution at binref.com. If you have comments on today's show, please email the host directly. Leave a comment on the website or record a follow up episode yourself. Unless otherwise status, today's show is released on the creative comments, attribution, share a like, to the dot own license.