Recent posts

#81
Mac installation / Re: Fixed filter banks hang on...
Last post by j_p_higgins - June 05, 2025, 12:27:19 AM
Thanks for the update Richard and for figuring out the issue!
#82
Mac installation / Re: Fixed filter banks hang on...
Last post by rwdobson - June 04, 2025, 03:42:40 PM
Hello,

there is indeed a bug here, a memory error unsurprisingly. The array allocated for internal parameters ("param") is too small, currently 18, needs to be at least 21. When that location is written to, it happens, on this Mac, to corrupt the internal sfsys file ID for the infile, so that calls to write data fail, in this case causing an endless loop.

The short-term fix to make is in the library file tklib3.c (folder "cdp2k"), at and after line 175. Before the malloc call, the value of "storage_cnt" needs to be increased, e.g. "storage_cnt += 8".

Then recompile the library, and relink "filter".

This is a bug that I need to report directly to Trevor Wishart, who can provide the necessary changes to the parameter count. I will only update sources on GitHub once I have that from him.

Well done to all for diving into the code - not as you see, for the faint-hearted. Any time a program fails "sometimes", or not at all in some cases, the culprit is very likely to be a memory error of this kind. Easier to describe than find...
#83
Mac installation / Re: Fixed filter banks hang on...
Last post by j_p_higgins - June 04, 2025, 01:05:08 AM
Sorry to keep spamming the forum, I hope this info is useful to someone. I have a somewhat working solution.

Adding a lot of cleanup to free all the filter arrays in dz that I can find in the code after print_messages_and_close_sndfiles seems to make the process want to run multiple times with different filter modes and settings. What I have done is giving me a segfault error (exit code 11) when its done although it does run the filtering fine and produce the outfile. I think the segfault is probably just me trying to free something twice.

Seems like maybe mac is being picky about reallocating memory between runs and trying to reuse old things.

Not sure if this is the real fix, think I might just be sticking a plaster on the issue and hiding it. But, hopefully knowing that changing this and replacing soundseekx make this process want to run properly on mac will point someone who actually knows what they're doing in the right direction of the fault.

My guess is that as SoundLoom calls each process and closes it up fully after run, that that is why it works when called directly in SoundLoom but that calling it multiple times in the same terminal session or batch file doesn't close it fully and that is why some stuff is getting left over and is causing issues on subsequent runs.
#84
Mac installation / Re: Fixed filter banks hang on...
Last post by j_p_higgins - June 03, 2025, 04:14:34 PM
I thought sndseekex might be the problem so added the function below and tried calling that instead. Doing this allows the process to run multiple times (at least on intel macs I don't have an arm mac for testing) although if I change any of the filter settings between runs the filter still loops around the processing section forever. I've tried adding some additional cleanup of dz at the end of main.c but it doesn't seem to be making any difference.

int safe_sndseek(dataptr dz) {
    // Get the input filename before closing
    const char* filename_tmp = snd_getfilename(dz->ifd[0]);
    if (!filename_tmp) {
        fprintf(stderr, "safe_sndseek: ERROR — could not retrieve filename from ifd[0] = %d\n", dz->ifd[0]);
        return -1;
    }

    // Allocate memory and copy the filename
    char* filename_buf = malloc(strlen(filename_tmp) + 1);
    if (!filename_buf) {
        fprintf(stderr, "safe_sndseek: ERROR — memory allocation failed for filename copy\n");
        return -1;
    }
    strcpy(filename_buf, filename_tmp);

    fprintf(stderr, "safe_sndseek: Retrieved filename = %s\n", filename_buf);

    // Close the input file
    fprintf(stderr, "safe_sndseek: Closing input file descriptor %d\n", dz->ifd[0]);
    sndcloseEx(dz->ifd[0]);

    // Reopen the input file
    dz->ifd[0] = sndopenEx(filename_buf, 0, 0);
    if (dz->ifd[0] < 0) {
        fprintf(stderr, "safe_sndseek: ERROR — failed to reopen input file: %s\n", filename_buf);
        free(filename_buf);
        return -2;
    }

    fprintf(stderr, "safe_sndseek: Reopened input file. New ifd[0] = %d\n", dz->ifd[0]);

    // Clean up
    free(filename_buf);

    // Reset internal counters for reading
    reset_filedata_counters(dz);
    fprintf(stderr, "safe_sndseek: reset_filedata_counters completed.\n");

    return 0;
}

#85
General Board / Re: Soundshaper - problem when...
Last post by Vasilakis - June 03, 2025, 10:34:35 AM
Hello,

Thanks for looking into my problem.

So it was a simple patch where I had one sound source and then Reverb, Speed, FltVari, Speed cells.
It was saved with "include source(s)" and "whole patch" options (I think both are enabled by default).

Then, what happens when I try to load it.

I press "load" button, choose the patch (with .ssp extension), then I get warning window telling me "previous patch files may not all be cleared..." (which suprises me as I try to load patch right after starting Soundshaper, before doing anything else), I press "ok", then it says "Missing source for cell A_0 Load original if possible", I press "yes". Then, if I click at A0 and press "play", the original file plays fine ("snd1.wav" and with correct folder path). If I try clicking on process cells, playback options are greyed out.

Then I press "Run" button. Something happens. On the bottom of the page, it says "Infile length not available. File may not exist". Then, if I click any cells, it says "file does not exist". If I click on A0 and press "play", it still plays fine. If I try "play" on any cells, then error window appears with same note (file does not exist).

Report window, of opened, still shows unreadable symbols ("~A_4.bat" �Ґ пў«пҐвбп ў�гваҐ��Ґ© Ё«Ё ў�Ґи�Ґ©
Є®¬ �¤®©, ЁбЇ®«�塞®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв�л¬ д ©«®¬.)

Now, if I do double-click on any of the processes, as you suggest above. Let's try with Reverb. Firstly, it greets me with message "parameter file does not exist". Then it loads parameters page and another warning message ('''' is not a valid integer value). I press "ok", then click "render" and then it says "Expected output file was not found". After which, report window changes content to the following:

rgain    : set level of dense reverb (0.0 <= rgain <= 1.0)
mix      : dry/wet balance (source and reverb): 1.0<-- mix -->= 0.0
rvbtime  : reverb decay time (to -60dB) in seconds
absorb  : degree of hf damping to suggest air absorption: 0.0 <= absorb <= 1.0
lpfreq  : lowpass filter cutoff freq (Hz) applied at input to reverb
to disable either filter (absorb, lpfreq), use the value 0
trtime  : trailer time added to outfile for reverb tail (secs)
times.txt: list of delay times (msecs) for 6 comb and 4 allpass filters

Then, if I click "run" again it says "multi processing finished", but nothing actually changes as I still get "file does not exist" messages etc.

Now, if I try double-clicking Speed instead, it firstly talks about lack of .prm, and then says "Cell's input file does not exist. Cannot re-edit cell".

So that's what happens to me. Now, if I restart Soundshaper and load patch again, and say "NO" when asked, and then manually choose snd1.wav. Soundfile loads fine in A0 again, and then software asks me to press "run". However, after that it's all just the same behaviour.



So, long story short, this was my first experience trying to save and load patch, and it ended up not working as I hoped :) Maybe I did some error when saving? Maybe there are other reasons for this behaviour? Still, I hoped that it would be a straightforward process, where you could work on your cell sequence and save it, and then load it the next day, use same or different source and the process sequence would be applied without problems and overall it would feel like opening the saved project to continue working on it.

One more detail I've now noticed, though. When opening parameters for reverb, I notice that Delaytimes datafile is in orange, and if you click on it, the text preview is empty (and there is no filepath displayed under "delaytimes data"). Meanwhile earlyref datafile is just black and if you click, it previews values just fine (and filepath displayed under "earlyref data"). Could this be important?

On a side note, I'm under impression that I've rewritten some of default .brk files for some of processes (for filters, for example), should I just copy the whole txt folder from installation files to restore those?

Thanks, and I hoped I described details now, anything else needed?
#86
General Board / Re: Soundshaper troubles with ...
Last post by Robert Fraser - June 03, 2025, 10:03:58 AM
Hi,

I'm afraid I haven't been able to repeat this problem. I used Speed (Transpose semitones) as a test process. I clicked T-V (automation) and edited the default values graphically, then clicked the SAVE CHANGES button and hit PREVIEW. I repeated this several times, editing the values manually in the edit memo. I could go back through the earlier previews and they were still correct. For the final change, I again edited the data graphically.

The important thing is to click SAVE CHANGES before clicking the PREVIEW button. This seems fussy, but the button appears when changes might not have been saved, and disappears after being clicked.

Maybe you (or others) could reproduce my test and let us know if it doesn't work for you.

Robert
#87
General Board / Re: Soundshaper troubles with ...
Last post by Robert Fraser - June 02, 2025, 10:20:39 PM
Hi,
I'll look into this tomorrow and get back to you.
Robert
#88
General Board / Re: Soundshaper - problem when...
Last post by Robert Fraser - June 02, 2025, 10:18:05 PM
Hi,

There can be issues when running a patch with a different source sound. Where the first cell fails, showing "File does not exist", it's often fixed by re-editing the cell (double-click on it to bring up parameters) and then clicking RUN (PATCH) when the cell has rendered correctly.  What was the process sequence and (especially) what was the process that failed?

On your second point, if your source was called "snd1.wav" and you process it (A1- A4) it shows the original filename preceded by an asterisk to show it's changed. If you then save one of those outputs to file, it'll show that filename instead.

~A_4.bat" �Ґ пў«пҐвбп ў�гваҐ��Ґ© Ё«Ё ў�Ґи�Ґ©
Є®¬ �¤®©, ЁбЇ®«�塞®© Їа®Ја ¬¬®© Ё«Ё Ї ЄҐв�л¬ д ©«®¬.
Well that does seem like a bug! I've never seen that before. Again, I'd need further details of what produced the message.
#89
Mac installation / Re: Fixed filter banks hang on...
Last post by j_p_higgins - June 02, 2025, 03:18:58 AM
Some progress, the issue is being caused by the normalisation step although both that and the filtering seem to work fine individually. If I bypass normalisation by setting do_norm = 0 the process doesn't get stuck looping. I am not really sure though what is causing it to not get stuck. Some things to note:

  • sndseekEx is returning 0, although I haven't yet checked that it is actually succeeding at all steps
  • reset_filedata_counters doesn't reset ssampsread although manually resetting this to 0 didn't make any difference
  • I have now recreated the bug where it runs first time after a reboot but not any subsequent time, it will also sometimes run correctly if I duplicate the input file and run it again with the new file

I might have to stop trying to troubleshoot this now, I haven't done any programming in C since I was a teenager and this is getting a bit beyond me but hopefully these will be helpful pointers for someone who actually knows what they are doing!
#90
Mac installation / Re: Fixed filter banks hang on...
Last post by j_p_higgins - June 01, 2025, 11:49:54 PM
I've spent some time trying to troubleshoot this although my knowledge of C is pretty poor so I'm not doing the best job. I have no fixes yet but in case anyone looks into this, this is what I have found/tried:

  • From inserting some diagnostic prints in the code, it is getting as far as the main processing loop after the normalisation stage and "Info: Running Filter" however, it just loops for ever. On the first loop it reports to have processed some samples but the value of samps_left doesn't go down and after the first loop it just remains at this on every loop:

    samps_left: 1830700 | ssampsread: 0 | filter_tail: 0 | tail_extend: 0

    By the time it reaches the file writing stage in loop, sampsread is always 0.
  • This only seems to occur when it is called from the command line. Running this process within SoundLoom directly runs fine however, if I make it part of a batch file inside SoundLoom and run that from the batch window in SoundLoom it gets stuck looping. I did try forcing sloom to 1 in the code to see if that made a difference, it didn't make a difference but I'm not convinced I did it right.
  • It doesn't make any difference if the process runs with the -t or -s flags.
  • I tried forcing the normalisation scaling on the output to something very high in case the tail logic wasn't seeing a high enough level due to rounding but that didn't seem to make a difference.
  • Some users have reported that it runs fine first time after a reboot but not after that however, I haven't been able to replicate this personally.
  • Sometimes if the filter banks maximum frequency is set close to the minimum frequency it will run - mostly only with filter bank 6. I thought this might suggest denormals were the issue but flushing those didn't seem to make a difference.
  • It runs fine on windows, I haven't had a chance to test it on linux yet but I haven't had any reports from linux users of it not working