Monday, 3 September 2018

Fixing That Missing Artwork in iTunes

Macs make a lot more sense when you think of them as designed to be stand-alone. OS X can do networking, but it doesn’t really get it. That’s partly because of the UNIX everything-is-a-file philosophy: Unix doesn’t see networks, it only sees external drives. Windows sees networks and drives on the networks, which sounds as if it should be the same, but really is not.

Windows exposes the filesystem to the user in its programmes, and asks the user to make the filesystem their friend. In Windows you open a file by navigating through the filesystem in the File Open dialog or by clicking on a name in the Recently Used Files list. The only time you see icons representing your files in Windows is a) when you’re looking at the directory in Explorer, or b) when you’re using a programme that’s modelled on something from OSX, such as Calibre or most music management programs.

By design, OS X hides all the nasty OS stuff - such as the filesystem - from the user. This is usually done by adding an intermediate layer between the user interface and the filesystem. In an OS X programme the user sees a friendly icon and clicks on that: the programme looks at a database file - usually in XML format - that tells it where the file is stored. This works wonderfully until the user does something with their music files directly via the filesystem, say, with Finder and then everything goes to pieces. Because the database behind the cool interface has not been updated and indeed can’t be updated with changes made directly via Finder or with Unix commands on the Terminal.

OS X wants you to deal with your music collection ONLY through iTunes or a similar programme. That is the only way the database is kept up to date. It’s also the only way that the very quirky file permissions that iTunes uses get handled correctly. It’s possible to alter the file and directory permissions to 777 (all access to everyone) in Terminal but not have that show up in Finder, or have iTunes behave as if the files and directory have permission 777. (Oh yes, I have done this.)

(Windows programs assume that you’re going to do all sorts of things, so they have a ‘Watch this directory’ function that scans and updates the cool interface when you start the program. That can be kinda annoying at times. But it’s swapping one annoyance for another.)

Suppose you copied Volunteers by the Jefferson Airplane from your Macbook iTunes directory to a backup directory on your NAS. When you later build an iTunes library from this NAS directory, it will add the Volunteers album and files it finds, but you won’t be able to modify the album info, and the artwork will get lost. What’s happened is that the file and directory permissions have become mis-aligned - not in Terminal world, but in the parallel universe of iTunes / Finder permissions.

So how do you get the artwork back, and become able to change the album info?

Here’s the fix that occurred to me…

1. Create a directory in the Music section on the computer that has the iTunes you are using. This will typically be the SDD of your Mac Book / Air / Pro. I called mine Temp. It doesn’t matter.

2. Copy the files from Volunteers (or whatever) into this Temp directory.

3. Use iTunes to delete the original Songs and the Files.

4. Check that the directory for Volunteers (or whatever) is also deleted, as it might not be if it has artwork files or other stuff in it

5. in iTunes, do File -> Add to Library and choose Temp. iTunes will now do its stuff.

6. Now you can add the album artwork and make whatever other changes you want, and it will stick.

7. Delete the files in Temp.

8. Wash. Rinse. Repeat.

9. Works On My Machine and NAS. YMMV.

It sounds clunky, but it soon become muscle memory. Do it as a background job when you’re writing blog entries or something, and you’ll be all caught up before you know it.

Monday, 27 August 2018

Ripping The CD Collection

I’m not an audiophile, but I want the music to sound right. What comes out of my iPhone through the Bose QC20’s noise-cancelling earphones is right for the purpose, but what comes out of the headphone socket through my hifi is muffled and tiring. Same signal, different context. Hence all my fussing around with Dragonflys and Jitterbugs earlier this year. While not quite up to the DAC in my Marantz CD player, the combination is close, and the sound isn’t tiring. And I fall asleep to music from the Bose Colour Sound fed via Bluetooth from my iPhone streaming via WiFi from the NAS.

I was not ripping the CD collection for backup. That would have meant copying the discs. And then buying another NAS to backup the backup, because NAS can fail more frequently than a CD. Anyway, there is a CD backup service: it’s called Amazon, or Foyles, or any number of other online retailers. This won’t work for compilations of obscure composers by performers whose careers never lived up to their early promise (British Piano Music of the 1980’s where art though now?) but then, well, how often did you listen to it when you had it? Classic performances that you really want tend to be re-released. Or surpassed.

I ripped the collection because I stream more than I do, and may stream more, especially with the Sonos in the front room, and because I do put some of it on the iPhone and the Nano for portable use from time to time. And I’ve only got 128GB on my Air SDD. Which is my way of explaining why I used the iTunes default of 192kps M4a.

Why did I use iTunes? For one thing, Hans Beekhuysen mentions it as one of three which are decent rippers. Since one of the others is Roon, that’s a pretty good recommendation. iTunes is good at getting song titles and parsing the artist / composer, no worse than any of the others at getting album art (I tried Clementine: it won some, lost others) and once you accept its quirky little ways is pretty good at managing the library. It’s not Roon. But neither is the price.

So the workflow looks like this:

0. Create an Album Artwork directory on your Mac. Open a new music library in iTunes and point it at your NAS. Save.

1. Put CD into drive

2. Choose the album title that a) isn’t in Japanese, and b) doesn’t say it’s Disk 3 of some ‘Best of Bach’ collection when your CD is a stand-alone

3. Let iTunes do its thing

4. While it is, if you ripping a jazz or classical CD, copy the CD title, paste it into the Amazon search box and see if they have a decent copy of the artwork. Almost always they will, but if not, use Google. I did so on less than one in thirty CDs. Paste the CD title into the the ‘Save As’ name and save it to your Album Artwork directory (*).

5. When the CD is done, eject it, and right-click for Album Info. Here I put in the artwork, change the Album Artist to the composer for classical music, and get rid of the [Disc 1] that often appears in titles. Sometimes, as with the 22-CD Stravinsky set, the disk number is useful, but not for double-albums.

6. Untick that damn Album is compilation of songs by various artists box. Otherwise it winds up in a Compilations directory. And you won’t find it when browsing with File Explorer.

7. Press OK and find something to do while iTunes does its thing with the music files over the WiFi to the NAS.

It’s tedious. It’s best done while doing something else, pausing to deal with the album info, eject the disc, put another one in. I did it in batches of about twenty, one day at a a time, until it was over.

8. Review the results and edit. How much work you put into changing what iTunes (or any other organiser) found is up to you. Filling in the missing artwork, un-compiling compilations that aren’t really, making sure that J S Bach is spelled and spaced like that in all the albums so it’s easier to find when browsing outside of iTunes… just how anally-retentive are you? (Turns away as if this doesn’t concern him…) The day you see me changing genres, I really will have nothing to do.

9. Accept that the music catalogue is a case of progress not perfection. I’m going to make tweaks every now and then when I notice something.

Because some of the files I have were ripped earlier, under different versions of iTunes, there were permission issues, and I needed to refresh the library in the way described in a future post. It was worth it. A library with every bit of cover art and all the double-albums put together is a thing of delight.

(*) WHY THE FRACK DON’T JAZZ and CLASSICAL CD’S HAVE ARTWORK? I load a progressive house CD, it has artwork. I load a Mahler box-set, I have to get the artwork myself. Digital music libraries and organiser programs have been with us for over a decade, and iTunes, Roon and all the others aren't going to disappear. How difficult can it be for a record company to package all its artwork up and send the zip to Apple? And how difficult would it be for Apple not to charge the record company, in the name of giving us all a better experience? Not even Amazon restrict the number of times we can find and download artwork. (Because they’re smart: every time you get some artwork from them, they get some more goodwill, and you might buy something.) Music industry, get your freaking act together on this.

Monday, 20 August 2018

July 2018 Diary

You would think these were the easiest posts to write. All I have to do is list everything I did. I should be able to do that the day after the ends of the month. Yet I never get round to doing it until the middle of the month. Is there a reason for the hesitation? I don’t feel as if I’ve done enough in the month and would rather not have to document it so quickly?

At the start if the month I went to Doddle at Liverpool Street collected the Asus Aspire I’d ordered in June. I don’t know about your offices, but ours actively discourages having items delivered. The post room for our floor is a pile of letters and packages: nothing is delivered, and there are no pigeon-holes. Send me something to that address and it will never reach me. So Doddle is a really useful service.

In the middle of the month, I collected the Sonos Beam soundbar. I had it working the next evening. Oh yeah. More oomph, clearer speech, fuller sound. My TV set doesn’t have the HDMI-out for sound, so I have to use the optical digital adapter, and there’s a very slight delay between the screen and the soundbar, but once the brain understands what’s happening, it adapts after about five minutes. If you have a modern TV and don’t have a decent soundbar or a 5.1, you are missing out. And yes, the Sonos is controlled by an app you load onto your iDevice and the app can stream music from your subscription service.

I got a day trip for work up to sunny Solihull via Euston and Birmingham International. Most of the day was spent in trains, taxis and conference rooms, so I had no real sense of the place, but it makes a change from the usual commute. I’ve been to Birmingham town centre before with work, and only really remember the awful road system and the restaurants down by the canal. I collected the soundbar from Sonos’ Covent Garden shop on the way back from Solihull, and by the time got to Richmond was so darn hungry - conference centre food doesn’t count - that I had some “street food” at the Yo! Sushi across from the station.

Sis and I had our annual trip up the Kingsland Road to Tay Do for Vietnamese at the start of the month, taking the long but half-scenic route back via the North London Line rather the usual route on the Overground.

I saw Leave No Trace at the Curzon Soho - excellent - and got through S6 of House. I read Ellen Wood’s East Lynne, Joel Dicker’s The Truth About The Harry Quebert Affair, and David Szalay’s All That Man Is. East Lynne was a best-seller in the 19th century, and it’s a fantastic read. I started on Cobbet’s Rural Rides, but that’s bedtime reading, so it will be many months before that gets finished.

I almost finished the great CD ripping project. I’m going to write about that separately.

It was too damn hot. I managed to keep up the exercise for a couple of weeks, and then the heat just wore me down. Sleep is not as good as it needs to be. I don’t like being sweaty and hot. I spent a lot of the heat indoors, with the curtains drawn to keep the heat down.

Thursday, 2 August 2018

Terence M: RIP

My oldest AA friend Terence died recently. His girlfriend called me with the news at the weekend.. She lives out of London caring for her mother during the week, and had been trying to get in touch with him during the week and asked the Police to make a Welfare Call. The police had to break the door down and found Terence dead.

Terence was about ten years younger than me, had a couple more years’ sobriety, was an engineer in a local engineering firm when we first met, married a slightly crazy Irish girl in early sobriety and then they divorced, then took up with a girl in AA I’d been out with, who was also mildly crazy, and had a couple of children with her. They split up after about five years or so and she moved to Oxford, taking the children with her. I think I may have been the only person who knew what he was dealing with.

He was made redundant from the engineering firm because seniority - they could get someone cheaper - and re-trained as a psychiatric nurse specialising in addictions. I think he had about three healthy years working in the NHS and then some damn doctor told him he had Type 2 Diabetes and prescribed the foul drugs they push. Instead of doing what my doc did when my blood sugar was high, which was to terrify me into changing my diet and exercising more. So Terence started to put on weight, and got other complications, for which yet more drugs were needed, but only after endlessly delayed consultations. Then one afternoon he fell off the couch and two of his vertebrae crumbled. His girlfriend was visiting at the time, and called an ambulance.

And from there it got worse and worse. Delayed tests and operations. Painkillers. Endless infections written off as due to diabetes. More weight gain and bloating. Anti-depressants. Testosterone shots. Chemicals I thought only existed for school experiments. He could barely walk a mile without being exhausted. He had to stop working and spent days dealing with social security and NHS bureaucracy for pensions, benefits, sickness payments and the rest. That went on for about five years up to now. My timings may be off slightly.

I have no idea how he did it. Chronic pain, poor sleep, unable to exercise, infections of the ear, treatments that didn’t work, on and on and on. And yet he was fundamentally in good spirits, I think because he thought there was a chance something could be done.

Then this summer his brother-in-law died. His brother-in-law had been a mentor and guide to Terence when he was younger, and I think may have helped him deal with the drink and drugs. That hit Terence harder than he thought it would, he told me he was having trouble getting over it. Other family members - it was a big family - died and he was properly upset and bounced back in the proper time. This seemed to hit him a lot harder.

That and problems with an operation to reduce the size of his stomach - a version of a gastric bypass for non-medical types - which he hoped would make a big change for him. Except there was an issue with anaesthetics which lead to the operation being cancelled, and then the team didn’t follow-through on that so there were more delays.

After his brother-in-law died, in June Terence picked up a drink, because sleep, or emotions or something. The reasons normal people have a drink, to take the edge off. A few weeks ago he asked to get alcohol counselling through the NHS.

Then the weather changed, and in that heat I suspect he had real problems getting any sleep. Plus he got yet another infection so was on antibiotics. I suspect that he could’t sleep and took a drink or some extra pills or both. He had a ‘fuck it’ streak.

He got his diabetes diagnosis before I got my high blood-sugar diagnosis. That was why I was not going to let the doc pin that diagnosis on me. It seemed to me that doctors stop thinking once they write ‘Type 2 Diabetes’ on your card.

I’m going to miss him. He guided me through some of the traps and pitfalls of AA-the-real-life-community that I might not have seen. He was very realistic and not afraid to pass judgement when it was needed. But it’s a blessing for him. Since he was living in hell already, I guess that means he’s gone to heaven.

He’s not in pain anymore, and that’s what counts.

Monday, 23 July 2018

Writing a Python Program: Tools

Real Developers use vi at the command line and have memorised the every single Python library. Actually, Read Developers probably don't use Python. This is for the rest of us. There’s no question of anyone knowing all the Python libraries by heart, let alone by muscle memory. It’s impossible for any one mere mortal to know the Excel VBA object model and all the constants. That’s why VBA has Intellisense, which Microsoft patented, forcing everyone else to provide a slightly cut back version called ‘auto-complete’. PyCharm has autocomplete, but not the full-fledged Intellisense. Auto-complete doesn’t walk you through all the parameters for a function, nor offer values when the number of options is less than about five. Microsoft spent all that money developing Intellisense because they knew if would pay back in productivity and user loyalty. The minimalist Python IDE is IDLE, which doesn’t have a visual form editor. To find the typos in your code, you have to run the program and then deal with the messages from the python debugger. That’s what makes it minimalist. PyCharm Community Edition has a neat feature where it puts red line in the right of the code screen against the lines it thinks are wrong in some way, thus sparing you doing debugging runs to find the bits where you forgot to put ‘:’ at the end of a ‘def’. This helps, but if the interpreter spots something else wrong while your code is running, you have to correct it and start over. This is when one realises that the VBA editor / debugger is a thing of utter wonder. Being able to do on-the-fly code correction while debugging is like having a superpower. No other IDE provides it. A search for the reason brought up a comment from someone on the original VBA project to the effect that the trick was keeping track of all the threads and re-aligning them when the user had re-coded and started from some earlier point in the program that they halted. That is nowhere near as easy to do as it is to say. While it doesn’t take much time to stop, edit, and re-run code from the start, as PyCharm and all the others force us to do, compared with the Microsoft Way, it just feels clunky. To me. I'm going to try Visual Studio Code from Microsoft next time I do something. The demo looks interesting. Anything to get on-the-fly debugging again. But then Real Developers don't need to debug. (PS: It's too hot for me to keep up my usual schedule. Normal service will be resumed when this hot spell breaks.)

Monday, 16 July 2018

June 2018 Diary

June was a good month. I had a week off from work, in the week before the weather turned really hot.

I did lots of gardening - always in the morning when it was cool. I now have a neat front hedge and a nice clean garden shed. The lawn has given up growing in this heat.

The big thing was buying three toys. A Bose Colour bluetooth speaker to replace the Roberts radio by my bedside. Now I can stream from all the music on my NAS via my iPhone. Falling asleep to some Gregorian Chant makes a welcome change from Chill on DAB. Second toy was a replacement laptop for my ageing Samsung. It’s an Acer Aspire with an Intel 8X chip, a 1TB HDD and a 1080p screen with wireless AC, and it was just over £500. I ordered that from Amazon and it arrived in July. Third toy was the Sonos Beam soundbar I saw in the Sonos shop in Covent Garden. It was on pre-order, and that’s coming in July as well. I’ve been thinking about all that stuff for a while, and getting all that sorted out was a good feeling.

I read Len Deighton’s Bomber, Micahel Jago’s The Man Who Was George Smiley, Sabine Hossenfelder’s Lost In Math, Eric Ambler’s The Mask of Dimitrious, Andre Breton’s Nadja and Laurnet Binet’s The 7th Function of Language. Bomber really is something else, at times approaching a new kind of hyper-realist literature.

I saw Jeune Femme, Zama, and L’Amant Double at the Curzon Bloomsbury; and Hereditary at the Curzon Soho. I’ve now used all my four free tickets that come with Curzon memberships, and good value that makes it as well. I got through S5 of House as well.

I had supper with my mate in Richmond, and supper with Sis at Gymkhana. Gymkhana is way too expensive for what it is, which is not even, I think, superior Indian food. It’s not a lot better than you’ll get from your local takeaway. I also had supper at Tapas Brindisa (okay) and lunch at Polpo (good) in Soho, the Fish Market at Liverpool St (good), and lunch at Vinotecha (disappointing).

I started on the Great CD Ripping project. Using iTunes, which no less an authority than Hans Beekhuyzen says is fit-for-purpose. Classical CD’s and artwork? Only a handful had it, the rest has to downloaded from Amazon or Google.

Thursday, 28 June 2018

First Sunny Saturday of the Year - Breakfast


I passed Balans Cafe at thought, I wonder if they will do me a bacon sandwich and a coffee, even though it's not on the menu? They did, and I settled in, opened up my iPad and must have fumbled, brought the camera up, and took this by accident.