• xgr

    @jancsika 2.1.2 works and lets me delete the knobs without crashing. (Tested on win10)

    (When I correct the path in knopf2.pd from [room_sim_2d ... ] to [iemgui/room_sim_2d ... ] it still doesn't show any knobs. I don't know, if it's because of my code or if there is another error with iemgui. I don't care as I changed the knobs to mknobs anyway, which is an easier and cleaner solution)

    I discovered another error while trying 2.1.2.:
    Unlike pd, Purr Data opens .pd files in the same instance of Purr Data ( is that intendet?). Opening a .pd file by double click doesn't work, when an instance of Purr Data is running and the path to the .pd file contains a german Umlaut ( ü ). Output in console is: error: <filename> : read failed

    posted in news read more
  • xgr

    The last version of pyext is from 2012, but it is stable and works fine with vanilla 0.47-1.

    [pd~] doesn't work on both of my windows machines, win7 and win10. I use the Purr Data version for win 64 you linked on the top of this thread

    pd.PNG

    posted in news read more
  • xgr

    After using Purr Data for a couple of days now, I really appreciate it!
    E.g. I don't want to miss scaling the surface anymore.

    But I still have some questions:

    • Is it possible to use pyext in a reliable manner?
    • What about [pd~]? I really need that. Will it work in future?

    Regards,
    Xaver

    posted in news read more
  • xgr

    I'm on win7 64bit. Downloaded Purr Data today.

    I uploaded one patch which has an error. Because of my settings it adresses iemgui directly, so it isn't found in Purr Data.
    The console told me room_sim_2d .... couldn't create.

    When I go into that patch and try to delete the knobs, I get a crash. I have to close the nw.exes in the task manager of win7. The running pd process can't be killed at all.

    You'll find the patch here (download the folder "crash" and start it from crash/test/test.pd
    https://github.com/XRoemer/puredata

    I got other crashes with a python programm of mine, which I started via pyext. But I'm not shure if pyext should be used with Purr Data, as I installed it manually.

    Best,
    Xaver

    posted in news read more
  • xgr

    Hi,

    first of all: Thanks for your great effort! Purr Data's handling is very nice.

    I played around with it today and tested some of my patches. Purr Data crashed every once in a while. I can't say, where exactly it happens. Is there a log file? I would send it to you.

    And is there a feature list? Would be nice to see what exactly is shipped with Purr Data and where it has extra features. Also which parts of Pd-l2ork are integrated.

    Regards,
    Xaver

    posted in news read more
  • xgr

    I see - I corrected the code.

    Again, thanks a lot for your help.

    posted in extra~ read more
  • xgr

    @Pierre-Guillot said:

    You still don't use the realloc method properly. The method is for reallocation, so you should give it the pointer to the memory you want to resize.
    In your code, you allocate new memory each time you resize the arrays without releasing them thus you have a lot of memory leaks.

    Sorry, I can't see my error. I think, lines 116-119 do free the allocated memory:

    if (x->matrix) free(x->matrix);
        if (x->vector) free(x->vector);
        x->vector = temp_vector;
        x->matrix = temp_matrix;
    

    VS shows me the process memory. When I do produce memory leaks, the process memory should raise, I guess. But with my code it corresponds to the size of the matrix. So lowering the sample length lowers the memory also.

    With the first, x->vector should be set to NULL, this way the method will acts like malloc.

    OK. I added x->matrix = NULL; x->vector = NULL; to the method average_init_arrays

    My updated code is here:
    https://github.com/XRoemer/puredata/blob/master/average%7E/C/r_average%7E2.h
    (I also changed the method average_resize_arrays from:

    void average_resize_arrays(t_average_tilde *x, t_floatarg f) {
    
        x->row = 0;
        x->len_avg = f;
    
        average_resize_avg(x, f);
        average_resize_matrix(x, f);
    
        if (!x->avg && !x->matrix) {
            x->matrix = NULL;
            pd_error(x, "allocation failed");
        }
    }
    

    to:

    void average_resize_arrays(t_average_tilde *x, t_floatarg f) {
    
        x->row = 0;
        x->len_avg = f;
    
        average_resize_avg(x, f);
        average_resize_matrix(x, f);
    
        if (!x->avg || !x->matrix) {
            if (x->matrix) free(x->matrix);
            if (x->vector) free(x->vector);
            x->matrix = NULL;
            x->vector = NULL;
            pd_error(x, "allocation failed");
        }
    }
    

    posted in extra~ read more
  • xgr

    I updated and cleaned the code. It works now.
    https://github.com/XRoemer/puredata/blob/master/average~/C/r_average~2.h
    With a freshly started windows, no other applications started except pd, my object, compiled with optimizations, doesn't consume any remarkable cpu performance on my machine.

    After 10 min running my test patch floating point errors are still below 0.00001. It depends on what you're doing of course, but I can live with that.

    I still have to figure out what you wrote about dspmethod argument. For the moment there is an if statement in the perform method, which bypasses calculations, when reallocation failed and x->matrix is NULL. In terms of optimization, I guess it would be better, to tell pd, not to use the perform method. I don't know, if that's possible.

    posted in extra~ read more
  • xgr

    Perhaps we can create a new thread about C optimizations for real time audio.

    I would appreciate that, although I wouldn't be much of a help.

    I can't recreate the error, are you sure you use the object compiled with the last version of the code. Sometimes on Windows, you really need to clean the project before compiling otherwise the modifications are not taken into account.

    I used your updated code, cleaned and rebuilded the project. Still get exceptions, with and without optimizations.
    After some exceptions I sometimes have to restart the computer, as pd reacts strange on restarting the debugger.
    As I said, I'm new to C and therefore to compiling as well.
    I'm on win7, pd 0.47.1, Virtual Studio 2017 RC

    I tried to follow your advise and implemented the average with one large vector. But I get errors as well - VS tells me, symbols are missing, but doesn't point me to a specific line.
    My code is here:
    https://github.com/XRoemer/puredata/blob/master/average~/C/r_average~2 -not working.h
    EDIT2:
    I made a stupid mistake: forgot to reallocate the avg array. I'll update the code.

    EDIT:
    I had to leave out EXTERN on meanblock_tilde_setup, as I couldn't compile with it. But I guess this is for CPP only, isn't it?
    Also I compiled your meanblock as meanblock.h and not as meanblock.c

    posted in extra~ read more
  • xgr

    EDIT:
    Sorry, I didn't see your last post when I posted this.

    I uploaded my code here:
    https://github.com/XRoemer/puredata/tree/master/average~

    When you download the zip, you'll find the code I compiled in the folder average~/C.
    If you are on windows, there's already a compiled .dll

    You should be able to open test.pd
    You might copy a .wav file into the folder average~/pd_patches/tools for testing.

    I've got two issues with your code:

    • setting length to 100 makes pd unusable, cpu > 100%
    • I get exceptions when I change the length while dsp is on.

    I think, the performance issue is caused by this lines:

    // For each row i of the matrix, adds to the index j of the output vector
        // the value of the column j, like output[j] += matrix[i][j]
        for(i = 0; i < nrows; ++i)
        {
            cout = out;
            for(j = 0; j < n; ++j)
            {
                *cout++ += *read++;
            }
    }
    

    With [switch~4096 64] and a length of 100 your loop does 409600 actions on each dsp tick (length 64).

    In the test.pd there's an array $0-differnce which tracks the differences between your method and mine. When you set both objects to the same length, the differences are close to 0. (Not exactly 0. Maybe floating point errors?)

    My code is still missing a solution for the perform method in case, reallocation failed. I've seen yours if(!dspmethod), but didn't fully understand it yet.

    posted in extra~ read more

Internal error.

Oops! Looks like something went wrong!