Wednesday, April 08, 2009

Patch, Balance, Stop, Mix


(From Flickr) (Brilliant by the way! Buy it!)

I have nothing! Not a jot, not an iota, not a scrap of an idea. There is the single, unfinished phrase "The Patent ..." which means nothing to me and I only wrote it this morning. What can I use to trigger something? A fridge fell over in the street outside at about 3:30 this morning but it didn't wake me up. That is all.

I did do some work on The Steve Reich Simulator V2.0 and was actually able to get .net calling the midi APIs after a few minutes googling which not only solved my problem but indicated that using the APIs to play midi was likely to involve me in a huge amount of work. This is of course rubbish as my wrapper functions have only two lines of code to work out the midi message to send. I also failed to initialise a sleep duration variable for the thread which I am now using to play the notes, meaning that it actually implemented Thread.Sleep(0) which of course just played the sample note continuously and quickly in the thread without letting anything else get a word in. It sounded dangerously scratchy up close and like the closedown beep from a distance. Couldn't do anything else but unplug the PC but all the code was saved and returned uncorrupted. I ran it again after initialising the sleep variable to a minimum value. The test shows that the thread plays the notes in exact tempo without any other processing interfering. The new interface looks good as well. As .net does not have control arrays I decided to define the note structures using a DataGridView (which is of course the reason for using a later version of .net). This means that I can do block settings of notes rather than ticking or unticking myriad check boxes. I suppose I should think about proper note creation but that would take me away from the idea of interactions and counterpoint. Coasting from now on I hope.

No comments: