Hi Christof,

Thanks so much for getting back to us (and so quickly).  This is very helpful 
for Jake.  I told him how quickly the PD community would respond and you did 
not disappoint.  We’ll continue to work based on your advice and will update 
when we are further along.

Does anyone know why Jake can’t seem to sign up for the list?

Cheers,
Rick



> On Aug 15, 2019, at 4:15 PM, Christof Ressi <[email protected]> wrote:
> 
> Hi Rick,
>  
> > Pd crashes every time a bang hits the object, which is what triggers the 
> > internal calculations, including reading the text files.
>  
> Actually, it should also crash when using the float inlets. The problem is 
> that his object contains a "struct date *mydate;" member which points to 
> nowhere. Accessing this pointer will of course lead to a segfault. It should 
> be a "struct date mydate;" instead.
>  
> Also, all the "t_atom mer[3]", "t_atom ven[3]", etc. members are only used in 
> trackingPlanets_bang, so they should be local variables.
>  
> Generally, I think he doesn't understand pointers and memory management very 
> well. Take this example:
>  
> double* coef1 = malloc(sizeof(double));
> double* coef2 = malloc(sizeof(double));
> double* coef3 = malloc(sizeof(double));
> struct term termi;
> termi.numTerm = getTermNum(line);
> readTermCoefs(line, coef1, coef2, coef3);
> termi.a = *coef1;
> termi.b = *coef2;
> termi.c = *coef3;
>  
> This should simply read:
>  
> struct term termi;
> termi.numTerm = getTermNum(line);
> readTermCoefs(line, &termi.a, &termi.b, &termi.c);
>  
> Note in his original code, coef1, coef2, coef3 are never freed. In fact, his 
> code is full of those tiny memory leaks.
>  
> I don't want to sound too harsh but I think Jacob needs to first learn the 
> basics of the C programming language before attempting to write a Pd 
> external. There are some good books and tutorials with lots of practical 
> exerices. Also, he might want to show his code to a more experienced C 
> programmer (might be a teacher or colleague) to get some feedback.
>  
> Also, I highly recommend learning the very basics of a debugger to find out 
> where your program crashes. Assuming he's using GCC, it's enough to start Pd 
> in the debugger, e.g. "gdb --args pd ./mypatch.pd" -> "run", and after the 
> crash type "bt" to get the backtrace.
>  
> Best,
>  
> Christof
>  
> Gesendet: Donnerstag, 15. August 2019 um 22:28 Uhr
> Von: "Rick Snow" <[email protected]>
> An: [email protected]
> Cc: "Gartenstein, Jacob P" <[email protected]>
> Betreff: [PD] Student Project Advice
> Hi all,
>  
> I have a student trying to sign up to the list and ask a question but he is 
> having some trouble being approved to this list.  I am pasting his question 
> below and will send any responses to him!  Thanks for any advice you might 
> have.  His email address is [email protected] <mailto:[email protected]>
>  
> From: Gartenstein, Jacob P
> Sent: Wednesday, August 14, 2019 12:50 AM
> To: [email protected] <mailto:[email protected]> <[email protected] 
> <mailto:[email protected]>>
> Subject: Questions about External 
>  
> Dear Pd Community - 
>  
> I'm trying to create an object, via a pd external, which takes in several 
> parameters, does internal calculations, and outputs several lists of floats.  
> Part of the internal calculation process includes reading thousands of lines 
> of equation coefficients from text documents.  These coefficients, along with 
> the input parameters, are necessary to perform the internal calculations.  
>  
> I've linked the pd external, entitled trackingPlanets, which creates in pd 
> but doesn't perform any of the desired functionality.  Pd crashes every time 
> a bang hits the object, which is what triggers the internal calculations, 
> including reading the text files.  Through the course of some tests, I've 
> discovered that the text file reading functions cause pd to crash. 
>  
> My questions:
>  
> Is there some method to internally read data from text files in pd?
>  
> Are the internal calculations too much and causing pd to crash?
>  
> Are there more efficient methods of reaching my desired functionality that 
> may help pd run more smoothly?
>  
> Thanks in advance for the help,
>  
> Jake Gartenstein 
>  
> Materials:
> https://drive.google.com/drive/folders/1KYB9GyP31I9tGfwFnY7ctfUH24qvClXa?usp=sharing
>  
> <https://nam03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdrive.google.com%2Fdrive%2Ffolders%2F1KYB9GyP31I9tGfwFnY7ctfUH24qvClXa%3Fusp%3Dsharing&data=02%7C01%7Crsnow%40tulane.edu%7C27f33351311e468b113508d721beaad3%7C9de9818325d94b139fc34de5489c1f3b%7C0%7C0%7C637014975096336581&sdata=ktqk8oIAPoijOZ2rONBoGoJYdtKQvCqBg6BJNrAIlQo%3D&reserved=0>
>  
> _______________________________________________ [email protected] mailing 
> list UNSUBSCRIBE and account-management -> 
> https://lists.puredata.info/listinfo/pd-list 
> <https://lists.puredata.info/listinfo/pd-list>
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to