Menu

#1417 Not importing banks from soundfonts

None
closed
nobody
None
1
2015-09-15
2013-10-21
No

Can I mention one more bug if it doesn't disturb your work?
In the main screen I go to studio, manage midi devices, banks, import, change file type to sf2, click to open a sf2 file and Rosegarden freezes.
(I waited +/- 15 minutes trying to import the banks from the free soudfont Merlin Gold, nothing happened and I had to kill Rosegarden because it didn't respond to close buttons too. I also tested with other soundfonts.)
If you find it interesting to reproduce and do research on this is the way I did.

Discussion

  • D. Michael McIntyre

    I tested with about 20 different soundfonts, and it worked every time.

    I've had a look around the code, and it's hard to guess where or why it could be hanging like that.

    So I went to find the "free soundfont Merlin Gold" and tried to import the program names from there. It comes as a .sfArk file. I tried importing directly from the .sfArk file, and Rosegarden crashed. We don't support .sfArk files that I know about, and there is apparently no way to convert them to .sf2 without downloading a bunch of development code from some git repository and compiling it. Crashing with an unsupported file is not surprising (although it should be avoided.)

    So I went digging again, and found one already converted to .sf2. I extracted the programs from merlin_gold.sf2 without incident.

    I don't really have a clue why this is happening for you, and can't repeat it.

     
  • Fernando A. Martin

    Ok. It's not a function that I use often and I guess other most users don't, so we may leave it this way if no one else can reproduce it. The good news are that I'm using 13.12 almost everyday and have found no other bugs or problems. :-) (Only I'm used to notation and I never get used to matrix editor and pitch tracker so I didn't test them.)
    I just quoted merlin gold as an example, but I used it decompressed in sf2 format. Strangely it always happens to me in newer versions but not in older ones.
    Sorry I can't give further details because Rosegarden simply freezes, leaving no trace behind and no output even in command line. But if nobody else complains about it, I, for my part, can workaround it with an older version.
    Thanks.

     
  • D. Michael McIntyre

    The good news is this kind of "weird thing for only one user" problem usually goes away on its own as the packages installed on your system evolve over time. Try it again in six months, I bet it's gone.

    It's good that 13.12 is working out for you apart from this. Having real testing prior to the release is a very good thing, and I appreciate your effort!

     
  • Fernando A. Martin

    Thank you for the appreciation. 13.12 is awesome. I created a icon to launch it and fixed it in my kde panel to everyday use.

     
  • Tito Latini

    Tito Latini - 2015-08-28

    It fails if a pad byte is added at the end of a sf2 file (to word align).

    The follow sf2 file is useful for the test:

    https://packages.debian.org/sid/fluid-soundfont-gm
    

    After the pdta-list chunk, file->eof() is never true
    (src/sound/SF2PatchExtractor.cpp:108) and the loop continues forever.

    It should be enough to add a check for EOF after the first `chunk(file)'
    but I prefer the solution of the attached patch (exit after pdta-list chunk).

    The last phdr record is ignored because, from soundfont spec:

    "The terminal sfPresetHeader record should never be accessed, and exists
    only to provide a terminal wPresetBagNdx with which to determine the
    number of zones in the last preset. All other values are conventionally
    zero, with the exception of achPresetName, which can optionally be "EOP"
    indicating end of presets."
    

    Without that change, device[0][0] = "EOP" in the tested sf2 file.

     
  • Ted Felix

    Ted Felix - 2015-09-02

    With this patch I noticed that the first program in bank 0:0 is no longer "EOP" for the Fluid soundfont in Ubuntu. So, this patch fixes that issue. I only tested with a couple of soundfonts, and not very thoroughly. It looks like it's working.

    Like Michael, I can't get the unpatched version to go into an endless loop, though. I tried a release and a debug build. Maybe 32-bit is the problem or uninitialized memory? Any ideas why it might get stuck only for some users?

    Fernando: Can you test this patch? Let us know if you need instructions for applying.

     
  • Fernando A. Martin

    Yeah. I need instructions to apply this. I don't know how I can make it work with rosegarden.

     

    Last edit: Fernando A. Martin 2015-09-03
  • Ted Felix

    Ted Felix - 2015-09-04

    If you've got rosegarden built from svn, you can use the "patch" command to apply Tito's patch. Download the patch someplace (let's assume /tmp) and then from the rosegarden source directory, do this:

    $ patch -p0 </tmp/sf2_extract.patch
    

    That will apply it. Then make as usual and run.

    When you are done testing, you can remove the patch like this:

    $ svn revert -R .
    

    If you haven't built rosegarden from svn yet, the instructions I use are here:

    http://www.rosegardenmusic.com/wiki/dev:eclipse

     
  • Tito Latini

    Tito Latini - 2015-09-08

    Patch applied.

     
  • Fernando A. Martin

    Hi. I downloaded the latest rosegarden code from svn, compiled it and right "after" compiling I applied the patch.
    Then I tried to import the banks of two different soundfonts and at each attempt nothing was imported and rosegarden froze. :(

     
  • Tito Latini

    Tito Latini - 2015-09-08

    The correct order is:

    - apply patch
    - compile
    

    otherwise you continue to use the old code (the application of the
    patch doesn't recompile the changed code).

    However, the recent source code (from svn r14091) contains the
    fix and it is not necessary to apply the patch. Perhaps you have
    a prior version. I have applied the patch today.

     
  • Fernando A. Martin

    Great. I downloaded svn code 14094 and it worked right at first attempt.

     
  • D. Michael McIntyre

    • status: open --> closed
     

Log in to post a comment.