Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#1 bad APPL chunk size in SOS file

closed
Lippold Haken
Analysis (1)
5
2005-01-09
2004-12-13
Mark Loomis
No

It seems as though the chunk size is incorrect for the APPL chunk
in SOS (SPC) files written out via 'exportSpc'. I used the following
Python code fragment to create the SOS file (from morphtest.py):

a = loris.Analyzer( 390 )

cf = loris.AiffFile('clarinet.aiff')
v = cf.samples()
samplerate = cf.sampleRate()

clar = a.analyze( v, samplerate )

loris.channelize( clar, loris.createFreqReference( clar, 0, 1000 ), 1 )
loris.distill( clar )
loris.exportSpc( 'clar.pytest.spc', clar, 90 )

The resulting file has an APPL (SOSe) chunk size of 2092 (0x82c),
though the partial data seems to continue beyond this. The next
chunk (SSND) doesn't start until 0x1800 bytes later. I suspect the
size should have been 0x82c + 0x1800. My AIFF file parser chokes
on this (and any other .spc files) created by Loris.

BTW, what I was hoping to do was to batch convert a larger
number of sample file to SOS format for use with Kyma. The file
appears to be readable in Kyma, but the result is not quite what I
would have expected. I have not been using Loris long enough to
know whether it is a result of the errant chunk size or the settings
I am using in Loris.

thanks
mFl

Discussion

  • Mark Loomis
    Mark Loomis
    2004-12-15

    • assigned_to: nobody --> kfitz
     
  • Kelly Fitz
    Kelly Fitz
    2005-01-03

    • assigned_to: kfitz --> l-haken
     
  • Kelly Fitz
    Kelly Fitz
    2005-01-07

    Logged In: YES
    user_id=65143

    Lippold has proposed a fix for this problem.

    In src/SpcFile.C, line 882 reads

    static const int InitPhaseLth = ( 4*LargestLabel + 8 );

    and should instead read

    static const int InitPhaseLth = ( LargestLabel + 8 );

    If you have a chance to try out, please make that change in the source code and
    rebuild (and install) Loris, and let me know if your AIFF parser is happier with the
    result.

    Thanks,
    -kel

     
  • Mark Loomis
    Mark Loomis
    2005-01-08

    Logged In: YES
    user_id=1176907

    The suggested fix appears to work. Thanks!

    % aiff_info clar.pytest.spc
    AIFF file 'clar.pytest.spc', type = 'AIFF', 4 chunks
    chunk 'COMM': size = 18
    bit_depth = 24
    n_channels = 1
    n_samples = 131584
    sample_rate = 44100
    chunk 'INST': size = 20
    base_note = 90
    detune = 0
    gain = 0
    high_note = 127
    high_velocity = 127
    low_note = 0
    low_velocity = 1
    rel_beg_loop = 0
    rel_end_loop = 0
    rel_loop_mode = no_looping
    sus_beg_loop = 0
    sus_end_loop = 0
    sus_loop_mode = no_looping
    chunk 'APPL': size = 2092
    appl_signature = SOSe
    frame_duration = 2902
    n_partials = 128
    chunk 'SSND': size = 394760
    block_size = 0
    offset = 0

     
  • Kelly Fitz
    Kelly Fitz
    2005-01-09

    Logged In: YES
    user_id=65143

    This change has been committed to CVS, and I am closing this bug.

    -kel

    p.s. That AIFF info tool you have looks pretty useful, what's it's story?

     
  • Kelly Fitz
    Kelly Fitz
    2005-01-09

    • status: open --> closed