Great :-) Now I guess Valentin Schmidt won't reply my email!
Though we are only using the conversion procedure in PHP-MIDI, it is not
such an easy task as I remember from programming it on BP2.
At first we may believe that we should just pick up "status bytes"
(above 127) and then get 1 to 3 data bytes depnding on the status. So,
if the status is "PitchBend" we derive the channel number and timing
from the status byte, and the next two bytes are the value of pitch
bend, low significant byte first. However this is not so easy: il the
pitch bender is moving and no other event is happening, then the stream
does not repeat the status byte! This is called "running status". Great
for the economy of time/space but decoding isn't so easy. I still need
to verify the PHP-MIDI would correctly decode a MIDI file containing
running status, although it is a bit silly not to repeat status bytes in
a file. I cannot check it with BP2 because running status was never used
at the output. Optimizing speed and space was a big deal while creating
BP, but this will be an advantage when we expand it's functionality.
Dealing with MIDI on the PHP interface is quite easy because all MIDI
events are stored in standard text files. These text files will be read
by the console. For instance, I want to create a "Listen to this object"
button in the object prototype editor. All I need to do is save the
object's label in a file and tell BP to take it as a "startup string"
along with the '-mi' file for parameters, MIDI code and/or Csound score.
So, the only missing option as per today is "--startstring filename". It
will be handled by the same procedure as "play selection" on BP2. If
that startup string contains a variable, BP will check that it has been
supplied a grammar to derive it, otherwise the variable will be ignored:
this will be mentioned in a message.
So in the end, the entire interaction of the PHP interface with BP will
be the construction of relevant command lines.
Creating graphics may be a much more complicated task in a multiplatform
environment… I would like to reproduce BP2's graphic display of
sound-object prototypes with position of pivot location on events and
their topological constraints. Well, solutions exists, among which the
GD Library:
https://www.thoughtco.com/gd-library-basics-drawing-with-php-2693791
https://github.com/libgd/libgd/releases/tag/gd-2.3.0
In fact we could just translate the QuickDraw calls to GD and the rest
will be easy!
Bernard
Rainer Schuetz wrote on 26/07/2020 11:28:
> Valentin Schmidt, the author of php-midi seems to adhere to the
> DWTFYWT philosophy in sharing… his stuff was used here as well:
>
> https://github.com/treffynnon/PHP-Midi
>
> So “freeware” seems neither to mean “gratis” nor “libre” in his case,
> but public domain…
>
> I am still kind of curious how that midi stuff will be shared between
> php and bpconsole. But I guess you two are discussing that among
> yourselves, which is fine of course… it’s a quite tricky question, in
> theory it could even become a sensitive one...
>
> Best
> .r.
>
>> On 26. Jul 2020, at 09:25, Bernard Bel <ber...@gm...
>> <mailto:ber...@gm...>> wrote:
>>
>> There will be a new commit of the "php" folder.
>>
>> It may be commented as:
>>
>> "Fixed pitchbend code in objects, implemented adjust duration of object."
>>
>> I also added warnings when trying to work on obsolete '-mi' files:
>> these should have been saved by the last version of BP2.9.8. The
>> upgraded "-mi.abc1" file is attached. I am using copies to check all
>> features of the sound-object prototype editor, watching how BP2.9.8
>> would do it.
>>
>> I started remembering the meaning of the Tref variable associated
>> with sound-object prototypes… I will document this point with a
>> simple example.
>>
>> I am also planning to implement the MIDI to Csound score conversion.
>> This will requite a small refresher course on Csound! ;-)
>>
>> As usual, the new version is on my site:
>> https://leti.lt/bolprocessor/
>>
>> Bernard
>>
>> <-mi.abc1>_______________________________________________
>> bolprocessor-devel mailing list
>> bol...@li...
>> https://lists.sourceforge.net/lists/listinfo/bolprocessor-devel
>
>
>
>
>
> _______________________________________________
> bolprocessor-devel mailing list
> bol...@li...
> https://lists.sourceforge.net/lists/listinfo/bolprocessor-devel
|