Saturday, October 19, 2024

Prometheus v3.50 MIDI Import Victory

A long day of programming that ends in victory!

It's hard to explain what I'm trying to program, I will try. Imagine you have a MIDI sequence at 60 beats-per-minute that plays three bells, one per second, so one on each beat. In most MIDI imports, the sequencer would set the time to 60, and import one bell per beat, as you may expect.

But I wanted to import the notes at one-per-second irrespective of the speed the song is playing. Even if the song is slowing down or modulating. I wanted the notes to, rock-solidly, appear at 1-second, 2-seconds, 3-seconds. For this, I converted the MIDI notes into samples-offsets, so 44100ths (by default) of a second. Then I back-converted that into to location in the sequencer by running through all of the time modulations up to that point.

It was complicated, but I got it working in the end. On the way I discovered two older bugs; one which 'forgot' the initial modulator settings, thus changing them after playing and stopping a song (if they were programmatically changed during playback); and a second crash bug which should have been checked for in any of the previous 250 updates! It simply didn't update the selection when a track was deleted, so the selection could span beyond the sequence to dead tracks, causing a crash upon copy or delete.

It's amazing that 'The Cabinet of Dr Eckelmann' has directly led to two big new features in Prometheus. Several tracks are now complete for this album, 11 or so. Most are drafts that need final tweaks. Deb and I recorded some leaf-tramping sounds last night, which I may add to 'We Used To Store Sunlight'. I've also completed about 50% of 'Dumberdash', but there is a lot to do there.

Oh for more time! Of for more life! I need to divert a little now. I need to do work on some paintings to prepare them for the Grosvenor competition, and I want to create a new Flatspace IIk Music Pack: Music Pack 4. I also want to create a new array of sound effect packs specifically for SFXEngine. The biggest job here is the store artwork.

Onwards we charge.