A better way to do it?

For quite a few years now, I’ve been using Lilypond as my software of choice for any music-notation-related tasks.

As well as being incredibly powerful (and fairly straightforward to get a basic handle on, at least for someone who had  quite a bit of previous experience typesetting mathematics in LaTeX, using a text editor; LaTeX and Lilypond have a lot in common, at least conceptually speaking), it has the attractive feature of being completely free.

The basic idea of Lilypond (which aims to be “a program that creates beautiful sheet music following the best traditions of classical music engraving”) is that you prepare a text file containing a description of the music that you want to typeset, written in a text-based notation complete with various markup commands, and then feed it through a processor that churns out a beatifully formatted page (or many pages, although I’ve usually only used it for fairly short pieces) of music.  The Lilypond website has plenty more detail if you want to know more about how it works.  One of the benefits is that you can easily do things such as transposing an entire piece of music into a different key, often with a single instruction (in fact one of my main uses for Lilypond is where I have a piece of music in one key that I need to transpose into another, either to make it a better pitch for singing or playing or to provide a copy for transposing instruments to use).  As well as producing PDF sheet music, you can get it to output midi files and I think there are converters available to turn Lilypond source into various other formats, although I’ve so far only ever had need for the basic PDF output.

This is somewhat different from most sheet-music editing software I’ve seen, which tends to take a WYSIWYG approach to the task, complete with a snazzy graphical interface. That’s all very well and good but one thing I particularly like about Lilypond (similarly to LaTeX for more general, mathematical or other tech-related typesetting tasks in contrast to a word processor; indeed, there is at least one music extension for LaTeX (or more accurately for TeX, for which LaTex itself is an extension), though I’ve not explored it) is the power  and (paradoxically, once you’ve ascended a shortish, if rather steep, learning curve) the simplicity, you get with the text-based approach, leaving actual realisation details to the processor unless you specifically need to over-ride them (OK, so the learning curve is actually potentially pretty long but it’s not so steep after the initial shock and you don’t need to master that much of the system to be able to do quite a bit of useful stuff).  Therefore, despite once or twice having a quick look at Denemo, a graphical front-end for Lilypond, I’ve always stuck with using my text editor of choice (usually either Vim or Emacs) and running my source files manually through the Lilypond processor.

However, the other day I came across another tool which seems to take a midway approach between the text-editor/CLI approach and the GUI one.  This is Frescobaldi, a “lightweight, yet powerful LilyPond music and text editor with a built-in PDF viewer”.  What you get is essentially a text editor that, while lacking many of the heavyweight features of Vim or Emacs, seems to have plenty of capability for editing Lilypond source code (including much nicer syntax highlighting than I’ve found for Lilypond in either of those editors – this is a very useful feature that has on many occasions helped me to find minor punctuation errors that have caused processing of the entire file to grind to a halt) and the ability to quickly generate a PDF file at the touch of a button; the PDF version is visible in a window to the side of the source file (and the processor log is visible just below it, which is also handy for debugging purposes), so you can see mistakes, edit them and have another run with the processor.  At least for smallish files, this is pretty close to real-time editing of the actual output files and retains the benefits of direct access to the source.  There are some other handy features too, such as autocompletion of function/variable names and a Lilypond help browser on hand (both of which are very useful as there’s quite a lot of stuff to keep track of and it can be difficult to remember the exact name or syntax of a given command).

In theory, Frescobaldi is probably a sufficiently powerful editor to be useful for other tasks than Lilypond editing.  However, it is very much optimised for that task and I’m unlikely to start using it for more general purposes (and I’m certainly not keen to give up the power of Vim for most of my text editing tasks).  The big question is whether the benefits brought by Frescobaldi for the purpose of Lilypond editing outweigh the loss of the Vim power-features that aren’t there.  So far the answer seems to be a resounding “yes”, so I think that Frescobaldi is likely to remain my tool of choice for Lilypond work for some time to come.

Incidentally the programme is named after Girolamo Frescobaldi, an early baroque composer known chiefly for his keyboard work, who was apparently quite a significant influence on later composers (including Bach himself).



Working within one’s limitations

I find spreadsheets to be quite powerful and certainly very useful tools, and I use them quite a bit both at work and at home.

Most of the time I work with either Excel or the LibreOffice equivalent (Calc) but sometimes it’s quite handy to use the online (or, these days I suppose you might say “cloud-based”) Google Drive (formerly Google Docs) spreadsheet.

This has some benefits, mainly the fact that it is accessible from any computer with a working internet connection and gives you access to documents without needing to copy them manually from one place to another and have the appropriate software (other than a web browser!)  installed on all machines, but also has some fairly major limitations compared to more traditional and full-featured spreadsheets.  Possibly not the biggest, but one that I run into very often, is the lack of a “fill series” function (or at least one that I can find).

The ability to automatically fill data across a range of columns or rows is a very handy time- and labour-saving device.  Most often, copying the contents of a cell into adjacent cells below or to the right of a given cell is what’s needed and most spreadsheets not only provide commands for doing these but usually also give keyboard shortcuts (Ctrl-D and Ctrl-R respectively), both of which I use on a regular basis when I’m working with spreadsheets.  (Actually, as I recall, the default key binding for LibreOffice these days asigns Ctrl-R to “align right” but I have mine customised to use it for “fill right” instead, as I tend to make more regular use of that command).

There are various other fill commands, including “fill up” and “fill left”, most of which I rarely ever use, but one that is often quite handy, albeit not as often as “fill down” or “fill right”, is “fill series”. This can be used to automatically generate various sequences of numbers.  The ones I use most often are “linear” (used for an arithmetic progression – I usually just use it with an increment of 1 to generate a set of consecutive numbers, e.g. 1, 2, 3, 4, 5… ) and “date” (which, as the name suggests can auto-generate a sequence of dates).

Unfortunately, Google Drive’s spreadsheet seems to lack a “fill series” command.  It does, however have “fill down” and “fill right” (albeit only accessible via keyboard shortcuts – they don’t show up in the Edit menu, where most spreadsheets (or at least LibreOffice Calc and, as I recall, older versions of Excel) seem to keep a submenu of fill commands), as well as cut and paste commands (including several “paste special” options), so it’s not too difficult to come up with a workaround that, while marginally less streamlined than a proper “fill series” command is still far preferable to manually typing a whole series of figures.

The trick is to enter your initial value in one cell, then set up a formula in the next cell (down or across) to generate the next value in the series, use the available fill commands to copy the formula into the rest of the cells you want filled with the series (it will automatically adjust the cell references, so the value for the third cell will be generated from the value in the second cell – the one just calculated from the initial value – and so forth) and finally select the whole range of cells, cut and paste as values (one of the “paste special” options) to ensure that you don’t later get any weird effects from copying or re-ordering cells.

As an example, if you wanted a simple list of numbers 1 to 10 in the first column of a fresh new spreadsheet, you’d start by putting the value “1” (without quotes) in the first cell (A1), then move down to A2 and enter the formula “=A1 + 1”, which would calculate and insert the value “2” into that cell (while retaining the formula iteself in the background.  Next you’d select the range of cells stretching down from A2 to A10 and hit Ctrl-D to fill down.  It would copy the same formula into each cell, adjusting the references as it went (so A3 would contain the formula “=A2 + 1”, etc.) and you’d end up with the numbers 1 to 10 as desired.  If at this point, however, you decided that you wanted the numbers to run down from 10 to 1 and therefore told the spreadsheet to sort the values in reverse order you’d end up with some strange results because it would move the formulas around and get its knickers in a twist (not wishing to get too technical!).  To get round the problem, you should, before attempting to sort the data, select the complete range of cells, cut them (with Ctrl-X) and then choose “paste special” (either from the Edit menu or the right-click context menu) and select “Paste values only” from the submenu.  After this, if you examine the contents of the cells you’ll find (as you might expect) that the formulas have been replaced by plain old numbers and you can now safely sort or move them to your heart’s content.

Of course, if you only want numbers 1 to 10 it’s not that hard to put them in by hand, but if you want to go up to 100 or 1000 (or several million) it would get increasingly tedious, so it’s handy to be able to automate the process.

I suppose to be fair to Google, it’s (presumably) not setting out to be a fully-featured heavyweight spreadsheet and at least it gives you enough tools to be able to recreate the “fill series” functionality with the exercise of a little ingenuity.  However, it does have a “fill range” command (accessed via “Ctrl-Enter”) which I’ve not seen in other spreadsheets; this acts essentially like a combination of “fill down” and “fill right” by copying whatever’s in the top left cell of a selected rectangular range into all the other cells in the range (updating formula references as appropriate).  While this is quite nice, it’s much more obvious and quick to replicate this functionality using Ctrl-D and Ctrl-R, so I can’t help feeling that it would be more useful if the Google spreadsheet could implement “fill series” functionality and assign that to the “Ctrl-Enter” hotkey instead (on a positive note, that idea has enabled me to find a good keyboard mapping for  “fill series” in LibreOffice, which conveniently didn’t seem to be using “Ctrl-Enter” for anything).

A blog is born

You may have noticed that I occasionally like to write blog posts in Welsh.

Since I’m aware (if slightly surprised) that several people follow my blog and that not all of them speak the language of heaven, I have generally tried to refrain from writing too often in Welsh and, when I do, to provide an English translation or at least a summary of what I’ve written.

However, I have for a while been considering the alternative solution of setting up a separate Welsh-language blog, to enable me to keep writing stuff in English for the benefit of my family, friends and other random blog followers and also to write a bit more in Welsh without having to worry about translating stuff.  To that end, having discovered that I can register multiple free blogs at WordPress, I have now set up Gofod-M – the Welsh M-Space blog.  Of course, any Welsh-speaking members of my family, friends or other random blog followers are welcome to follow that blog as well as this one.

I may well continue to write occasional snippets in Welsh on this blog (with translations) and I’ll probably occasionally cross-post between the two blogs, although I envisage them having quite separate (though probably equally random) content.

If this experiment goes well, I may think about (or actually do, since I’m clearly already thinking about it!) setting up one or more further blogs in other languages so I can practice writing in those too.

NB: Unlike this blog, I’m not planning to automatically publicise posts on my Welsh blog on Twitter and Facebook, so if you use one of those to get updates on my blog and want to follow my Welsh blog too you’ll probably want to explore alternative means of doing so.  I recommend the RSS feed.


On a roll

This is my fifteenth consecutive day with at least one blog post (actually my sixteenth post in this time span, since there was one day I posted twice).  This represents a new record for this particular blog and, as far as I can remember, for all my blogs, since I’ve generally been a fairly sporadic blogger.

I’ve just about managed to keep up with at least one post per month since I started this blog last January (or the January before last, depending on how you count), which is an improvement on my old blogs, but I think my previous longest run has been only about 10 consecutive posts.

I wonder how long it will last?  Probably not very long, although there will probably be at least one or two more posts before this run reaches its end and I’ve got a few ideas for things I want to write about soon.

Bandits on my six

It’s probably fair to say that I am not the world’s greatest fan of Microsoft products in general.  However, I will happily concede that they make excellent (software) flight simulators.

I remember playing Flight Simulator 4 on my computer back when I was at school (c. 1990) and being very impressed with it despite the primitive graphics (just a step up from wireframe) and the fact I had to try flying it with my keyboard and mouse, since I didn’t have access to a joystick let alone any more sophisticated flight simulator hardware rig.  Since then, I have continued, from time to time, to check out various flight sims, including several of Microsoft’s offerings (FS2004: A Century of Flight being the latest of theirs that I’ve tried – I realise with some shock that it is now 10 years old!).  Actually it’s probably a couple of years since I last flew my computer so I should probably get virtually airborne again soon.

For the most part, my interest has lain with civilian flight sims.  However I have had occasional forays into the world of combat flight sims, most especially with Microsoft’s Combat Flight Simulator (the original one from 1998) – mostly as a Spitfire or Hurricane pilot in various Battle of Britain related scenarios.

Although I haven’t taken CFS for a spin for quite a while now (at least 2 years and quite possibly 4 or 5), there is one phrase that I picked up from playing it which has stuck in my vocabulary and which I regularly use (talking to myself, which is probably a bad sign!) while cycling: “Bandit on my six”.

As far as I know, without having done extensive (or indeed any) research, this is authentic WW2 RAF slang.  A bandit refers to an enemy aircraft and six is a reference to the clockface method of giving directions (which, I think, is used and quite possibly originates in military contexts, although it’s also quite handy for other situations such as navigating at roundabouts).  In this system, the direction in which the speaker is facing (or which for other reasons is understood to mean “straight ahead”) is 12 o’clock.  Other directions are given with reference to this point and the position of the hour hand on a clockface (generally restricting it to whole hours, as far as I’m aware); so, 3 o’clock is due right, 6 o’clock directly behind, 9 o’clock due left and the other hours represent points between these cardinal directions.

In other words, “bandit on my six” means “enemy aircraft directly behind me”.  It crops up in CFS as radio traffic from (computer-controlled) fellow pilots in your squadron to helpfully alert you to the presence of enemy planes in case you didn’t spot them on your mini-map (or are playing with it turned off for extra realism).  As far as I can remember (though I could be completely wrong), enemy planes in other directions would be referred to in CFS (and in real life?) as “bandit at 3 o’clock” or whatever, but for ones directly behind it always seemed to be “on my six” rather than “at six o’clock”.

Of course, when I’m out on my bike I’m not generally being pursued by actual enemy aircraft.  Still, while other road users are not (I hope) deliberately out to get me, cars and other vehicles do represent something of a potential threat to a cyclist so it’s always as well to be aware of where they are.  To that end, and as far as I can remember unintentionally, I have developed the habit of saying to myself “bandit on my six” (or, if I’m coming up to a junction, possibly “bandit at 10 o’clock” or whatever direction is appropriate) as a way of ensuring I take note of where the traffic is.

What’s in a name?

A few months ago, I referred to Shakespeare’s famous quote “What’s in a name?…”, in a post on the subject of roses in literature.

More recently I had cause to dwell once again on this particular question as I listened to my favourite album of English madrigals.  The name of the album is Madra, which is neither particularly weird nor very informative (although I suppose it does sound a bit like the start of the word “madrigal”, so perhaps it does hint at what the album contains).

What is rather more surprising than the album name is the name of the group performing the madrigals: Miranda Sex Garden.  This London-based group was extant throughout the 1990s and for most of this time blended “their madrigal-styled vocals with sounds reminiscent of gothic rock, darkwave, ethereal wave and industrial music” (to quote from the Wikipedia page I’ve just linked to).  Even having listened to some of their later work, I’m not entirely sure what some of those terms mean (and I must confess that I’m not absolutely wild about the blend either, although I certainly don’t hate the sound).  For their first album (Madra), however, they were  a pretty straight-up trio of madrigal singers.

Although I had previously heard of Miranda Sex Garden (after all, it is a fairly striking name), I didn’t really pay any attention to their stuff until I was getting into the music of the Mediæval Bæbes (another group with a perhaps slightly surprising  name, although as female performers of early music the name is actually quite apt) and discovered that their leader, Katherine Blake, was also the leader of MSG and that the latter’s  debut album was actually a collection of a cappella madrigals.

I must confess that, in addition to wanting to bring to your attention a fine album that may be in danger of being overlooked due to the improbable name of the group performing it, I have another reason for writing this.  Not long ago, my brother wrote on his blog about posts that appeared to be particular spam magnets, with particular reference to an earlier post entitled Reflections on Birdwatching.  It occurred to me that possibly the references to birds were being picked up (and taken completely out of context) by automatic spam bots, causing the post to receive more than the usual amount of spam.  My scientific instincts kicked in and the obvious experimental way to test this hypothesis would be to write a post containing out-of-context references to sex (and if I’d mentioned babes instead of bæbes earlier, that would have been another potential spam bait :)).  It will be interesting to see what happens…

Another missed milestone

After missing the mark by a whole year on my post to mark the 25th anniversary of my violin grade 1 exam (not that I was planning to mark that occasion anyway until I realised on Wednesday that it was the day and miscounted the number of years!), I’ve just noticed that another ultimately-not-that-significant milestone has just slipped by.

The post before this one was my 100th post on this blog.  Not bad for 16 months work for a well-established sporadic blogger.  I haven’t counted the posts on my old blogs (see here for a post about those with links to the ones that are still around) but I’m not sure I ever reached 100 even after several years of blogging.

I wonder how long it will take me to reach 200?