Sunday, November 20, 2022

More Upgrades, and Electric Milk-Crates

A busy day yesterday. I released the sheet music to The Anatomy Of Emotions on itch.io, and packaged up the old Noise Station, and put that up there too.

Then, at 14:30, mum and I had a mile walk to the railway station, to Warrington, and two miles to Paul's house. We arrived just as his removal van pulled up at 16:00. I immediately got unloading the boxes, books, bed(s), and various things. It's fortunate that I'm used to lugging heavy loads, all due to music performances. Those huge amps are great weight training. In 30 minutes of near-running pace, we were done. I gulped down to lukewarm tea and saw that it was 16:40. I thought that the train back was due at 17:10, so mum and I marched back at pace, not wanting to miss this. We arrived at the station at 17:06, and expected the train to be late, but it was actually due at twenty-something past, and was late, so we had a frosty 20 or 25 minutes to wait on the bleak platform of bleak Warrington - truly a dismal town.

Then, the walk home, but I went on to Deb's, so another two miles or so. I was aching a bit by this time but happily so, not exhausted. Some live performances use more energy than this.

While walking I was thinking of Prometheus. The different plugins use effect buffers, which can vary by plugin. Some use none at all, but some (delays) use big ones. Now, all have 'utility' variables, which can be floats or longs. There are 256 of these, a fixed size.

I explained this to Deb in visual language. The audio effects are like cardboard boxes in a row, each a different colour, and the sound bounces from one to the next, changing as it goes. Each box has a milk-crate inside with 256 holes for milk bottles. The effects sometimes need to remember something, so they make a note on a bit of paper and put the note in one of the holes, looking at it later when needed. Most of the effects don't use many holes, and in fact no effect uses all 256, the whole milk-crates worth. Some don't use or need any holes.

So it can be a bit wasteful. There are 12 effects per track and per instrument, but the songs use some too, and those 256 empty slots add up to 2Mb or so with song of a lot of instrument and tracks. The best option is to make each box the size that's needed, so that each effect can specify how many 'holes' it needs, and for Prometheus to only reserve that many. The downside is the complexity of all of that.

But, this is the best solution, and I always aim for an ideal. Before now, I never really considered a dynamically sized 'utility buffer' like this, only aiming for a 'good maximum', but now is a perfect time to program something so radical because I have a new song format and any future upgrades will need to automatically update and import older formats. Over time this import feature will only ever grow. It's best to leap to an 'ideal' as quickly as possible, and after 15 years, the program must, surely, be evolving into something good by now.

So I've spent today upgrading to add this new feature. It is rather complicated because a track needs to store this 'box size' twice; once for the track effect, but once for ANY instrument that might play on the track, because you might play, say, a drum on any or all tracks at once. So, I need to calculate the biggest 'crate' of any instrument, and keep that space there, waiting for the musical instruments that pass by... this is a bit like the cardboard boxes running down a road - but this time it is empty, so uses the milk-crate by the roadside as its storage. These 'roadside' milk-crates need constantly updating: when you load or save an instrument, for example. They need to be big enough for the requirements of the biggest box in the song.

Incidentally, we can't go reserving space 'live' as the boxes appear, that's far too slow.

Well. Much of the coding is done, but it is exhausting and exacting work, like operating on an anaesthetised patient. This software is so massively complicated, perhaps my Magnum Opus. I move slowly, a little change here, a test there, but there's so much to change that I need to work fast enough to hold it all in my head at once. Only by seeing everything can errors be averted.

The next big step is recompling all of the plugins... again. That will take at least a day; but I know that I must actually practice the Bob Dylan songs, as I'm due to play 5 live on Wednesday and I've not gone through them yet.