fluid-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [fluid-dev] Extracting preset names and numbers


From: Marcus Weseloh
Subject: Re: [fluid-dev] Extracting preset names and numbers
Date: Fri, 28 Sep 2018 07:10:42 +0200

Hi,

here is some documentation about sf2utils: https://pypi.org/project/sf2utils/
Especially the "Library use" and "High level library API" sections are interesting for you use-case.

Cheers,

   Marcus

Am Fr., 28. Sep. 2018 um 00:00 Uhr schrieb Ben Gonzales <address@hidden>:
Thanks Marcus (and Andreas).

I'll give both of those a try. Is there a way of just getting the preset
no. and name using sf2utils?

The following works, but it's difficult to separate the "name" from
other info

sf2parse filename.sf2 | grep Preset

I get:

Preset[000:056] Trumpet 2 bag(s) from #0
Preset[000:057] Trombone 2 bag(s) from #2
Preset[000:064] Soprano Sax 2 bag(s) from #4
Preset[000:065] Alto Sax 2 bag(s) from #6
Preset[000:066] Tenor Sax 6 bag(s) from #8
Preset[000:068] Oboe 2 bag(s) from #14
Preset[000:071] Clarinet 6 bag(s) from #16
Preset[000:070] Bassoon 3 bag(s) from #22
Preset[000:073] Flute 5 bag(s) from #25
Preset[000:074] Recorder 3 bag(s) from #30
Preset[001:056] Trumpet 2 9 bag(s) from #33
Preset[001:057] Trombone 2 4 bag(s) from #42
Preset[001:060] Solo French Horn 2 bag(s) from #46
Preset EOP

Of course, it can be done, but is there an easier way?

Ben

On 27/09/18 21:49, Andreas Müller wrote:
> On Thu, Sep 27, 2018 at 1:13 PM, Marcus Weseloh <address@hidden> wrote:
>> Hey Ben,
>>
>> there's the sf2utils package: https://pypi.org/project/sf2utils/
>>
>> I've used this for a while for exactly the same use-case: reading the preset
>> names and displaying them in a list. It works quite well, but is a little
>> slow opening Soundfonds with a large number of presets / instruments /
>> zones.
>>
>> I've since created my own module that is much faster, as it only reads the
>> preset names and doesn't load all the information about generators,
>> modulators, instruments etc. You can find the code here:
>> https://github.com/midigurdy/mg-core/blob/7af42f4bedc7fd071fab139b21e7444d24e5b361/mgurdy/src/mg/sf2.py#L160
>>
>> Cheers,
>>
>>      Marcus
> And I wrote something in C [1] - if I only had known about sf2utils...
>
> Andreas
>
> [1] https://github.com/schnitzeltony/soundfont-cmdline-tools
>> Am Mi., 26. Sep. 2018 um 23:53 Uhr schrieb Ben Gonzales <address@hidden>:
>>> Hi all.
>>>
>>> I'm playing around with a headless RPi with fluidsynth and I'm thinking
>>> of incorporating a small display with button controls to select things
>>> like the preset, the octave, transpose, etc.   I'd like to be able to
>>> extract the preset names and numbers from the target sf2 file so I could
>>> use them in the display program, but I'm having difficulty finding a
>>> suitable utility.
>>>
>>> Any suggestions? Python would be nice...
>>>
>>> Ben
>>>
>>> _______________________________________________
>>> fluid-dev mailing list
>>> address@hidden
>>> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>>
>> _______________________________________________
>> fluid-dev mailing list
>> address@hidden
>> https://lists.nongnu.org/mailman/listinfo/fluid-dev
>>
> _______________________________________________
> fluid-dev mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/fluid-dev


_______________________________________________
fluid-dev mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/fluid-dev

reply via email to

[Prev in Thread] Current Thread [Next in Thread]