Dear all,
I have implemented most MIDI code loading and editing features on the
sound-object prototype page "prototype.php".
I used MIDI class (https://github.com/robbie-cao/midi-class-php)
exclusively for converting a loaded MIDI file to a text format. This
text is then analysed to produce (1) the sequence of time-stamped MIDI
messages and (2) a comprehensive text representation of these messages.
As suggested by Anthony, I have sent a message to the person in charge
of the MIDI class project to enquire about the status of its licence.
Whatever the case, as we are only using the file conversion procedure,
which could be implemented again following the same procedure on
BP2.9.8. (Just boring code conversion!)
Once the conversion has been done, several buttons are available to
modify the code, notably suppressing channel or polyphonic pressure,
pitchbend, or volume controls that may not be relevant to a "prototype"
as these are normally set by the context of the sound-object.
A tough work that forced me to revise MIDI encoding and juggling with
hexadecimal figures… I checked errors at the best comparing code in and
out, but the final check will be the audio effect!
Another difficulty is the impossibility to manipulate all data in the
RAM, not because of RAM size limitations, but because of the limited
number of input variables that PHP can handle by default. If you load a
MIDI sequence containing 5000 messages (including continuous flows of
channel pressure, volume etc.) then PHP will cry that it does not accept
more than 1000 variables. Indeed this can be set in "PHP.INI" but we
should not expect normal people to do this…
Therefore, when opening a '-mi' file, the machine creates a temporary
disk space to store every prototype separately, and MIDI codes are also
saved in separate files. Fortunately machines are fast enough to make
this process invisible! And the automatic garbage collector deletes
obsolete temp folders after 24 hours.
As usual, the new version is on my site:
https://leti.lt/bolprocessor/
I carefully cleaned up the PHP files to render changes more
comprehensible on Git. :-) The commit could be commented as:
"MIDI file upload and conversion, access to modifications of MIDI
sequences on sound-object prototypes."
Bernard
|