Wednesday, April 29, 2020

Stormbringer!

Several years ago, when I was looking to see whether the Island samplers "Bumpers" and "El pea" had received a reissue on cd, I discovered that there was a 3 cd set entitled "Strangely strange" which encompassed (if I remember correctly) all four Island samplers. I only downloaded songs which I didn't already have, so I'm not too familiar with the complete set.

One track which was on 'Bumpers' but not SS, was "Go out and get it" by John and Beverley Martin; this song didn't impress me very much at the time. Someone obviously did their homework, for it was replaced by a song, "Stormbringer!", which is much better. That's an understatement: it's far far better, being an excellent track.

'Stormbringer!' the song starts off with what sounds like a 12 string guitar playing an octave chord with no third, before drums call the song to order. Then follows the weakest of all chord progressions, where a major chord falls to its relative minor (think G -> Em); the feeling which I get from this is one of resignation. The Em then resolves to D which is the tonic (I am probably wrong about the key) and a verse evolves. The chorus is much stronger although the music is familiar with a descending bass line. Then follows a piano solo, picking notes here and there with no attempt to create a melodic line. Another verse follows with understated strings in the left channel accompanied by very assertive drums. Those drums: one could make a substantiated claim that they are the lead instrument here. They're not keeping time but rather punctuating and emphasising the lyrics. The sound of this song is very 'open': instruments can breathe; they're not competing from room in the audio spectrum, instead each contributes a little to the final product, where the total is greater than the sum of its parts. I suppose that this is part of the production style of Joe Boyd.

It is customary to mention at this point that the entire 'Stormbringer!' album was recorded in Woodstock NY under the influence of The Band. Levon Helm does indeed play on two tracks but ironically not the eponymous song; the outstanding drummer is Herbie Lovelle, otherwise known as a session drummer. The pianist and musical director is Paul Harris, with whom Joe Boyd also worked with on Nick Drake's albums.

I was so enraptured by this song that of course I had to listen to the entire album: I wish I hadn't. The album is credited to John and Beverley Martin: Beverley was quite possibly better known at the time. and so the album is approximately shared 50:50 with his and her songs. I do not like the Beverley songs and I don't like her singing (or her phrasing): there's an 'ad lib' in one of her songs which is cringe induring. 'Come and get it' is about the third best song on the album, which isn't saying much, and 'John the Baptist' is second best. The title song stands head and shoulders above everything else.

I wondered what their follow-up record, "The road to ruin", would sound like: one listen discouraged me so much that I am disinclined to try again. Then the marriage fell apart and John went out on his own (or maybe the other way around), developing an echoplexed sound and becoming a professional drunk. None of his later, electric, work matches the beauty of 'Stormbringer!' (the song); his singing also became more relaxed, or to use the technical term, 'slurred'. This does not press my buttons.

'The road to ruin' compared to 'Stormbringer!' sounds a little like Nick Drake's 'Bryter Layter' compared to 'Five leaves left', which is not accidental as they had the same producer, Joe Boyd, and many of the musicians that played on 'Bryter Layter' also played on 'The road to ruin'. I thought that I would look up the Joe Boyd angle in his autobiography, 'White Bicycles': I was quite surprised to read that Joe didn't think much of John Martyn.

"[Chris] Blackwell [owner of Island records] made me a present of John Martyn. He had released a couple of LPs on Island but Chris didn’t really know what to do with him and thought I ought to. I admired his playing but had never been a huge fan. When John started living and performing with Beverley Kutner, an ex-Denny Cordell artist [that] Tod Lloyd wanted to sign to Witchseason, I was stuck with him. I recorded an album with the couple in America using a New York pianist named Paul Harris as musical director. I thought Paul’s style would work for ‘Time Has Told Me’, so when he came to London to finish John & Beverley’s Stormbringer, I introduced him to Nick."

I actually saw John and Beverley Martin perform in the time between the two albums in April 1970 when they appeared on a treble bill with Fotheringay headlining and Nick Drake supporting. As I've written elsewhere, unfortunately I have no recollection of this evening whatsoever, so much so that I don't know whether Nick Drake even appeared or whether J&B performed as a duo or with extra musicians.

Someone else's take on this album can be found here.

Tuesday, April 28, 2020

Pitfalls when designing Priority forms

I'm not sure whether what I will describe here can be defined as a bug; it's certainly not a feature. Let's call it a pitfall - in fact, last night I was considering created a completely new blog which would be called 'Programming Pitfalls in Priority' or PPP for short (where 'programming' is an adjective, not a verb). I have now done so and so this entry can be found here. From now on, Priority tips and pitfalls will appear on my new blog and not this one.

Disclaimer: all of the below is written to the best of my knowledge. As this topic is barely documented, I have to base my comments on my experience which may well be limited. In other words, there may be a simple way of getting around the pitfall described below of which I am simply unaware.

The scenario: a client wants to add a new personalised field to an existing form. My normal way of doing this is to add the required field to the base table of the form and then add the field to the form which will display it; a more complicated method involves adding the field to a continuation table (good examples of this are the service calls and projects forms). Built-in triggers on every form are responsible for loading and saving all data which is displayed on the form which is derived from the base table, whereas the developer is responsible for loading and saving data which comes from a continuation table. In other words, if I add a field to a base table and then to a form, I don't have to worry about it being loaded or saved. 

The problem: after a few days' testing, the client decides that she doesn't need the added field. OK: the automatic, unthinking, simple solution is simply to remove the field from the form by deleting the definition. WRONG!!!! Form preparation, after adding the field, will modify the built-in triggers to include the new field (if it was defined as belonging to the base table) and so deleting the field from the form will cause these triggers to scream that they are missing a field when a user accesses this form. What is worse is that 'form preparation' does not detect this problem. The developer has no way of accessing the built-in triggers so it is not possible to remove from them the references to the new field. 

The correct way to 'remove' the added field would seem to be to hide it, not delete it.

In my opinion, the bug is that after deleting the field, form preparation does not update the built-in triggers and instruct them to remove the added field.   

Ironically, displaying the field via a continuation table does not cause this problem as the field is loaded and saved 'manually' and so the developer can simply remove the references to the added field.

Saturday, April 25, 2020

VideoPad

A friend asked me the other day whether I knew of a simple program to edit video files. After one minute of research, I discovered that the default Movie player in Windows 10 enables one to trim video files, i.e. extract a portion of an existing file and save this portion to a new file. I checked that this indeed does work and passed the tip on.

The next time that we discussed this topic, she said that the player didn't work on her computer and that it was 'LimitedWare', that it [presumably the editing functionality] stops working after a certain time. It may be so but that doesn't interest me. Someone else had suggested a program called VideoPad which I saw on her desktop when we had a zoom chat. I intuited that this program could put together several video files in order to create a composite movie.

Today I downloaded and installed the program; I used it to create a movie of clips which my wife had filmed of our garden and balconies. I wanted to see whether this program could replace the venerable (but painful) Microsoft Movie Maker. On the basis of the short film which I made, the answer is YES! There are both time line and storyboard views as well as transitions. I didn't see whether the possibility of turning a picture by 90 degrees exists, but I suspect that it does. Fewer transitions between two clips are available in VP than in MMM, but the existing ones are sufficient as normally I only use fades and cross-fades .

Extra advantages: the program accepts both mp4 and mov files without the need to convert them to wmv, which saves time. The program can output to a variety of formats, where mp4 is the default, as well as to ISO format in order to burn a DVD. In other words, VideoPad is much better than MMM for these functions.

Summing up: it seems that VideoPad is anywhere between the same and infinitely better than MMM, so I will definitely use it for my next movie project. Except that I can't imagine what this next project might be as the possibility of a holiday abroad is currently 0%. 

One idea which I had was as follows: in 'the old days' before we had a video camera which directly created computer files (since 2013), I used to transfer video cassettes directly to DVDs, without any editing. I could take such a dvd, upload it into a computer as one huge file then cut it into myriad pieces, each one a 'scene'. Then I could recombine chosen pieces in order to create a more coherent movie. Of course, the quality won't be so high as my current movies, as the very first step was analog to digital, but there won't be any further loss of quality along the way. I have to admit that such a project currently has a very low possibility of happening.

Another more up-to-date and ongoing project is to make a compilation of grand-daughter number two in her first steps. 

I am 'coming out of the bunker' and going back to work in my office tomorrow. The major thing that I am going to miss is the quiet of home; I haven't heard a work of Russian in six weeks. I suspect that whilst working I will listen to music through headphones for most of the time. I will wear a mask every time that I leave my minimal work space, although I don't know what to do about gloves - especially when going to the toilet. I don't particularly want to use eight pairs of gloves a day, but on the other hand, I don't want to touch 'communal surfaces' with my bare hands.

[Edit: frequent hand washing replaces the need for gloves]

Friday, April 17, 2020

Intra-program messaging

I wrote just over a month ago: "For fun, I started work on Friday evening, writing a program [the bakery manager] in which every screen is non-modal (this should be an interesting experiment), continued on Saturday and finished yesterday evening with a few reports". This program, like the OP's management program, is composed mainly of pairs of screens: one screen displays records about an entity (customers, sales items, orders, nicknames) and the other screen in the pair allows a given record to be edited. Normally, this second, edit, screen is invoked by using the ShowModal method, but this time around I wanted to try something different.

The edit screens are non-modal MDI son screens, as are their parent screens. The method which I originally chose to allow an edit screen to communicate with its parent was to invoke a procedure in the main form which then iterated through all the currently displayed MDI son screens in order to find a form which could be updated. When walking the dog the other day, I thought of a different and faster method (no pun intended) to achieve this.

The parent screen invokes the edit screen via a 'Create' call instead of 'Execute': this is simply using a more modern technique and has nothing to do with the intra-program messaging. In the past, normally one parameter was passed to the edit screen, the index number of the tuple to be edited (for a new tuple, -1 is passed). In the new scheme of things, two parameters are now passed: the index number as before along with the handle of the calling screen. When the edit screen finishes, it sends a message to this handle with the index number of the tuple which has been edited (if -1 was originally passed then a new value will be returned). No more calling the main screen, etc.

In the calling screen, I added one new procedure, DefaultHandler, which handles all messages sent to this screen. I'm only interested in one, so all the others are passed onto the inherited handler. As this procedure handles messages with a high frequency, my handler should be as short as possible, so all it does is save the passed index number then sets a timer to execute in 500 ms. It is the timer which does the actual updating - previously this was in the procedure which was called by the main form.

Following is an example of the new (for me) code paradigm
procedure TDoCustomers.DefaultHandler(var Message);
begin
 with TMessage (Message) do
  if msg = WM_UpdateCust then
   begin
    newcust:= wparam;
    timer1.enabled:= true;
   end
  else inherited DefaultHandler (Message);
end;
procedure TDoCustomers.Timer1Timer(Sender: TObject);
begin
 timer1.enabled:= false;
 try
  qCustomers.disablecontrols;
  if qCustomers.locate ('id', newcust, []) then qCustomers.delete;
  qGetOne.params[0].asinteger:= newcust;
  qGetOne.open;
  if qCustomers.state in [dsInactive] then qCustomers.open;
  qCustomers.append;
  qCustomersID.asinteger:= newcust;
  qCustomersCustName.asstring:= qGetOneCustName.asstring;
  qCustomersTaksiv.asinteger:= qGetOneTaksiv.asinteger;
  qCustomers.post;
  qGetOne.close;
  qCustomers.locate ('id', newcust, []);
 finally
  qCustomers.enablecontrols;
 end;
end;
This code also shows one of my discoveries from six years ago: instead of closing the dataset then retrieving all the records again, I simply add the new tuple.

This new technique works for adding customers, sales items and nicknames, but not yet for orders: in the first three cases, there is one parent screen calling one edit screen, but with orders, there are a couple of parent screens which can call the 'edit order' screen, but only one of them should be updated (an order can be made from the customers screen and from the orders screen). The customers screen does not know (at the moment) the handle of the orders screen so this can't be passed to the edit screen. At the moment, I've used the old technique for updating this type of datum; I'm sure that I'll think of a solution when I'm showering or walking the dog.

Wednesday, April 15, 2020

Italian holiday film

I thought that I would do something useful with all the time that I have on my hands (it's the Passover holiday which lasts a week) and so decided to create a film from our 2018 holiday in Italy

The first step in doing so is to convert all the MOV files to WMV format so that Movie Maker can handle them; there is a program which does this painlessly albeit slowly. At the same time, I discovered that there were a few files which lasted several minutes and generally showed pictures of my shoes or the inside of my bag: these files were created when I thought that I was turning the camera off when in fact I was turning it on. Of course, I tried not to convert these files, thus saving time and space.

All the videos are organised by day which makes it very easy to know where to find those per topic. I discovered that I had no stills saved - probably due to the great disk crash - but five minutes with my wife's telephone yielded over a hundred photos. As each file's name is basically the date and time of the picture being taken, it was also easy to categorise them.

The next stage was to build a rough cut of the film: Pisa, Riomaggiore and Lucca, then various aspects of our stay in Torino. Once this was done, I slotted in stills; in the past I have presented videos of a location followed by stills of the same, but this time around I mixed stills in-between the videos whenever it seemed appropriate. I also added the transitions, almost always fading from one piece to the next. About half of the stills had the wrong orientation but they seemed to right themselves whenever I watched a preview so I didn't bother to rotate them. 

Once I had everything in the desired order, I added music. There are a few scenes which have their own 'soundtrack': I filmed one scene early in the morning on the roof of our Pisan hotel and all that can be heard are birds so I left this as is. Another scene has about ten Hare Krishna devotees winding their way through the tables of people eating al fresco - obviously they had to be heard. I left in a portion of David Byrne in the cinema museum but found a way to download the complete video from Youtube and include it as an appendix to the film. 

As I have noted in the past, the pain of working with Movie Maker grows as the composite video lengthens. A minimal change at the end of the film requires the computer to become unresponsive for a few minutes. But that's nothing compared to the final part which is the most painful of all: mastering. This procedure takes all the little bits of video and pictures and makes one cohesive file of them all, taking about 45 minutes. Then I watch the completed film ... and see that most of the photos need to be rotated. Another 45 minutes of mastering and then I see ... that two pieces of video have incomprehensibly been added twice. I remove them - then I have to fix the soundtrack as the gaps are now out of synchronisation. This takes about ten minutes and then I have to publish the film again. 

I thought that the fourth revision had fixed everything, but to my horror I discover that the volume has been muted in the section where David Byrne appears in the film museum! Fix this then master again..... Whilst this process is conceptually the same as mixing songs then mastering them, the major difference is the time factor: mastering a song takes around a minute, depending on the length of the song and the number of effects, so it easy to go through several revisions in a short period of time. Mastering films takes a l-o-n-g time.

Obligatory Covid-19 reference: whilst it is great to see again these places that I remember fondly, sadly I wonder when the field by the tower of Pisa or the road of Riomaggiore will be filled again by throngs of happy tourists. Maybe they never will again and this film will serve as a memorial which I can show to our grandchilden: see how it was before the virus! People could walk in the streets, stop, chat and even eat in the open! No masks, no gloves. 

Friday, April 10, 2020

I like the sound of falling rain

Well, I don't really, but I'm prepared to do so for artistic purposes.

About a month ago, I wrote It also rained on and off on Saturday, and at one stage I found myself composing the beginning of a tune whose first line is "I like (love?) to listen to the rain" - I think this is going to be minimalistic as I couldn't develop the tune very much. At the moment it has a very big range - from G below middle C, a note which I can't reach in a dependable manner, to B above middle C, in other words an octave and a half. We'll see.....

I sketched the outline of the music quite fast, then every day I'd add a little bit to the music, fleshing out the arrangement. Instruments were added and taken away in order to match whatever I was hearing in my head at the time. A few days ago I thought that the arrangement was complete, but then I decided to remove two instruments which played only a few bars each and assign their parts to other instruments. I played this arrangement for my wife who said that the introduction was "very much you". Hmmm. I had to go somewhere after this and while I was walking to wherever it was, I thought about her words. It would be better if I could have some prosody - notes which sound like rain. I added some semi-random strokes on a log drum which then became doubled - this is the shower starting and getting heavier - followed by arpeggios on a marimba that lead into the song.

Then I had to concentrate on writing the lyrics. Over three weeks I had succeeded in writing only about six lines, as well as a few notes to myself. I find that I have great difficulty in starting to write lyrics, but the words begin to flow once I get over the initial hump. Of all the lines, I would say about 75% came from the last two days. There is still one little part which I'm not to pleased about: maybe one day I'll think of a better couplet. At the end, I discovered that the title of the song had mutated: instead of "I like to listen to the rain", it had somehow become "I like the sound of falling rain" - and these were the first words that I wrote.

I note that in recent years, I start writing lyrics with a song title: a phrase will catch my attention which serves as as starting point. I didn't write like this in "the old days" - frequently the title would not come directly from the lyrics.

I decided to dedicate yesterday morning to recording the vocals. After getting set up, I sang the song three times, each time improving. I then discovered that the microphone hadn't been defined correctly in the software and so had recorded nothing. I then sang (and recorded) the song a fourth time, which became the master take. I decided to have the vocal in mono with no apparent effects: I had to use slightly different EQ settings from the usual as there was no need for the vocal to cut through a dense instrumental track.

Once again, it's raining outside: I only like the sound when I don't have to go out. My early morning walk with the dog was cut short as it had started raining a few minutes before we went out. I waited an hour when there was no rain, set out, and then half way through it began raining once again. My wife says that there's no such thing as too much rain, but maybe she's reconsidering.....

Thursday, April 09, 2020

Pesach in the shade of Corona

Last night was the first night of Pesach (Passover). Instead of celebrating it with most of the kibbutz in the dining room, we - and everyone else in Israel - was forced to 'celebrate' with 'whoever lives in the flat'. Normally families congregate to celebrate Passover - grandparents, aunts and uncles, sons and daughters - which means that all the roads in the country are always crowded from about 6 pm until midnight.

Not last night. Israel is currently in the middle of a four day complete lock-down; towns are barricaded and the police will stop anyone fool hardy enough to travel on a road. The authorities fear that allowing multi-generational celebrations will destroy all the advances that have been made in the past few weeks with regard to minimising the number of Corona infections.

Back to the kibbutz: every year is posted a seating plan in the entrance to the dining room so that everyone knows where to sit. Yesterday evening some wag sent a message to our internal on-line forum with a map of the kibbutz and each family's location and number of people.

Above is a picture of me reading the blessing for the first of the four cups of wine that are traditionally drunk during the celebration. I don't know whether last night was the worst Seder which I have ever attended: about five years ago we were invited to the parents of my wife's brother's wife and that was an experience that I have no desire to repeat. I wrote here about this festival over the years; it is probably my favourite festival. Not so this year.

One of the major statements of the Seder is 'yesterday we were slaves [in Egypt], today we are free men'. On this basis, someone created the blessing shown on the left. Following a swift translation into English, it says

[Wishing you] A kosher and happy Pesach, in which we will move
  • From darkness to light
  • From slavery to freedom
  • From Corona to health
  • From unpaid leave to employment
  • From blind hatred to love
I couldn't agree more.

Tuesday, April 07, 2020

Statistical methods for Epidemiologists

I wrote yesterday that I am readng a book called 'The signal and the noise' by Nate Silver about predictions; I had got up to the chapter which writes about predicting epidemics, which is a very suitable topic for these days. There is discussion of avian and swine flu, which were predicted to infect many more people than they actually did - which is just as well.

Silver talks about the simplistic SIR model "formulated in 1927, that posits that there are three “compartments” in which any given person might reside at any given time: S stands for being susceptible to a disease, I for being infected by it, and R for being recovered from it. For simple diseases like the flu, the movement from compartment to compartment is entirely in one direction: from S to I to R". Another important variable is R0 which gives an indication of how many healthy people are liable to catch the disease from a carrier.

For 'normal' flu, R0 is about 1.2, but initially scientists were saying that for Covid-19, R0 is about 3, which makes it very infectious. One thing which I haven't seen yet is the major constraint in handling this disease: the number of ventilators. The rationale to handling this epidemic is to try and keep the number of infected people low enough to ensure that they don't overwhelm the hospitals. Eventually everyone will probably catch Covid-19, but if this number is spread out wide enough over time, the health authorities will be able to deal with all the cases.

Another important statistic which I haven't yet seen in Silver's book but is connected to the above constraint is 'how often does the number of infected people double?'. A week ago, the figure in Israel was 3: if there were 1000 infected people on Sunday, then by Wednesday there were 2000. Now they are saying that the rate is 11 days which is a huge improvement, thanks to social distancing and people staying at home. To use an analogy: if the number of infected people is the velocity of a car, then the doubling rate is its acceleration. The health authorities would like zero acceleration, which would mean no increase in velocity (infected people) and even better, deceleration, in which the number of infected people decreases.

The epidemic endgame rests on how long the virus can stay active after it has infected people. If all the non-infected people are kept off the streets and only people who have recovered from the virus are allowed on the streets, what is the possibility of non-infected people catching the virus from those who have recovered? No one knows as yet. What is the influence of temperature and UV light on the virus (think of an Israeli summer and its effect on skin cancer)? Again, no one knows.

Another important datum is the length of time that the virus can lay dormant in a carrier. Let's say that everybody between the ages 20-29 cannot become ill but they can become carriers. If a 20 year old is infected on the first of April, will the virus that she carries be able to infect a 60 year old on the fifth of April? On the tenth of April? At the end of April? This datum again will influence the endgame, which is when people can return to a normal life.

As Silver notes, the important data about an epidemic are known only several years after the epidemic passes. No one knows the data when the epidemic is active and so the health authorities have to make predictions in order to handle the epidemic. This book is about making predictions: how to make models as accurate as can be and how to mitigate biases (something which I have written about recently in my thesis). So, this is very much a book for our times.

Monday, April 06, 2020

Days of Corona (3)

First, I should note that relatively I am having an easy time in these strange days: I am fully employed (albeit working from home) so I don't have any of the monetary worries that a million other Israelis have, and I live on a kibbutz which in this respect is a very safe place to be. I don't even have to leave the house as we can order from the local mini-market via the Internet, and the kibbutz teenagers make deliveries.

Yesterday was even stranger than usual: at 5:30 am, the outside temperature was 25°C, so I took the dog for her morning walk wearing only a t-shirt and trousers. By lunchtime the outside temperature had reached 32.2°C and inside was getting hot too, so I turned on the air-conditioner, initially forgetting that it was still set to heat. After a few minutes I realised my mistake and set the air-conditioner to cool; soon the lounge reached a respectable 26°C. A few hours later I suddenly realised that I was getting cold: the outside temperature had suddenly dropped to 27°C, so I turned off the air-conditioner and opened all the windows.

I received - via DHL - a package sent from iHerb; unless my memory is playing me tricks, I ordered this last Saturday evening, so it arrived in just under eight days. As the kibbutz gate is closed, I had to call the guard to tell him that the DHL truck was on its way to me and that it should be let in. When I went to throw the carton in the carton rubbish bin, I noticed that the only other carton in the bin was also from iHerb; I wonder who it was. Maybe we can make a joint order next time.

Over the past few days, I have read some interesting books. The Le CarrĂ© biography was initially interesting but became less so, the further that I progressed: like his novels, the earlier ones were better than the later ones. Another book was 'The Undoing project' by Michael Lewis, which is about the two Israeli psychologists Danny Kahneman and the late Amos Tversky. I've read some of the material in other contexts, primarily Nobel prize winner Kahneman in his book 'Thinking fast and slow', which I have never finished. The only reason that Tversky didn't share the Nobel was that he died prior to it being awarded to Kahneman. I'm now in the middle of a book called 'The signal and the noise' by Nate Silver about predictions. I'm also rereading 'The Great Influenza' by John Barry which is about the Spanish flu epidemic after the end of the First World War. There should be lesson there for today.

I have just read that the British PM, Boris Johnson, has been hospitalised.