-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[patch] add API for real time midi stream parsing #150
Comments
so, it seems this patch, if accepted, would superseded #108 ? |
@stsp Is this still an issue? If so, I would rather prefer making |
Hi! fluidsynth is alive? Great news! |
My current solution is to embed the |
IIRC there were more patches from me, |
Ok, then let's make it public. I also dont share David's concerns that parsing might change, since
So far only see #148, which made it into 1.1.7. |
My preference would be to allow both APIs - Yes, I meant #148, thanks! |
And with both you mean the patch of this ticket and making |
Yes, but this will require you some |
Also timidity has such API (I coded the |
munt has such API too (looks quite close |
My problem with When making
Which is basically my understanding of having an API that just works. |
Yes, implementation was hacky for sure. |
|
Looking into |
Would it make sense for the public parser |
I see: you basically want
Unfortunately due to |
Yes, that would be a convenient API.
But is it better than to just immediately parse
Sounds good. :) |
IMO yes, because then the user enjoys full freedom of whatever he wants to do. |
IIRC I was not able to find an API that |
Just out of curiosity, could you please |
to parse to fluid_event_t and optionally convert back
fluid_event_t is the more powerful one, so converting back from it might be
problematic.
Those *_LAST are as well as every other enum value guaranteed to stay the
same in order to provide ABI compatibility. I dont know if or how
downstream uses them (sure, could be they use it in an array or for
iteration, idk). In fact it doesnt matter, it's a public enum so they are
allow to do this. That's why one usually adds new enum values at the end,
i.e. after *_LAST. However due to the semantic of *_LAST it needs to stay
the very last enum value. The only option upstream has is to add new values
prior to that. But this would change the value of *_LAST. It's a dilemma...
so we'll get completely rid of it.
|
In fact also in fluidsynth I can |
I dont want to tweak
|
But doesn't it do this already?
This does not differ from what OSS does.
I have no doubts that parser should create The one and only difference I can see between |
No. It offers events that are semantically similar. Neither does their type id match with GM MIDI, nor are they limited to 16 channels.
Forget about
It will always only support data types that are directly supported by fluidsynth. There are so many midi-like sequenced formats that starting to introduce foreign data types would be a never ending story. |
But other projects also have 2 different representations: |
Accessors of FYI: Fluidsynths external events:
Fluidsynths internal event:
|
By "accessors" I only meant getters. |
Be |
Unnecessary,
Generated by a parser that only understands rawmidi. rawmidi doesnt understand or provide any extensions of |
Yes, but the conversion is more difficult in this case.
Yes, that's exactly what I say. |
Sry, but this is a hack. If a downstream app only knows about
How would that make anything clearer?
Ok, then I misread that. Anyway if |
But will it really need that? The problem with having getters directly to |
Yes, because you cannot rely on downstream apps solely using
All the getters of
I still dont see the problem. Why should the getters suddenly stop working? |
No-no, it would be much better if downstream apps
Redundancy.
If you teach |
Cant tell, but since
And that's why I want
That's what you have
But this doesnt mean they stop working or we're unable to expand |
The idea of distinction comes from the fact So from my point of view these types are different
If the answers are both "no", then I'd say your |
I disagree. While
I dont see such a separation. And given your path "from_app->to_parser->to_app": I dont understand why you need fluidsynth types at all, as you dont seem to be doing anything with fluidsynth in this case. Also I'm not the first one having the idea of removing |
Yes, just using its parser, and the getters to |
Great, so after having had so much off topic talk about #308, this statement makes me believe that exposing "Abusing" fluidsynth as parser library replacement is not what originally was intended by exposing the parser and I'm currently thinking about reverting this. |
If it does discard things, surely it will do so also
That's my point too, partially.
So to me reverting it from core but still providing |
I mean, in an absence of any other rawmidi |
Yes, but it doesnt matter, because fluidsynth doesnt use such long sysex messages.
Wont happen. Let fluidsynth use the alsa_raw midi driver, connect to this port in your app and feed it with raw midi events as it arrives. Or properly parse them yourself and push them to fluidsynth manually.
This the point, because |
But you have a getters for
Even once you cease using
It would be a pity if I'll have to dig for another |
In fact, I have a parser rip-off since it was |
Getters are used to lookup events, e.g. if you receive them in a callback function to see what's inside and transform the event if need be. I wont remove any getters.
You even said yourself that these are completely separate paths in your app. And since for this use-case you dont need fluidsynth at all, it is invalid to abuse fluidsynth as parser, esp. because it doesnt even suit your needs (sysex). To me it seems that you want to go with the most comfortable solution by solely using fluidsynth. However it is not fluidsynth's job to solve your problem of custom rawmidi processing. Ofc internally fluidsynth is capable of that, but only in means to synthesize sound. This use-case however applies to the alsa_raw midi driver. |
And the solution is?
But this doesn't give me the parser, which I need too |
And the solution is?
Use a proper parsing library.
But this doesn't give me the parser, which I need too
Srsly, you dont need fluidsynth's limited parser, you need a parsing
library.
|
Hi.
It does look like fluidsynth currently does
not have any API that allows to deal with the
simple midi stream in real time.
For instance, the linux OSS sequencer has
SEQ_MIDIOUT() macro for that, and alsa has
snd_rawmidi_write().
This patch adds fluid_sequencer_add_midi_data_to_buffer()
function and a few more.
Reported by: stsp
Original Ticket: fluidsynth/tickets/152
The text was updated successfully, but these errors were encountered: