<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">(If we go into development details, this discussion could be moved to pd-dev.)<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On May 4, 2021, at 10:54 AM, Clemens Wegener <<a href="mailto:clemens@chair.audio" class="">clemens@chair.audio</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I also think it makes sense to specify arguments to tabread~ (or delread~) to specify the interpolation.<div class=""><br class=""><div class="">Dan you are suggesting an api like this to manage code size and structuring.</div><div class=""><div class="">I see, because when we put everything into the tabread~ (or delread~) class with just flags from arguments/messages, it would get hard to maintain.</div></div></div></div></div></blockquote><div><br class=""></div><div>Exactly. Hacking away and cramming everything in the existing class starts to get unweidly and harder to extend/maintain.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class="">E.g. for tabread:</div><div class="">So we would create a header „d_array.h" with the function declarations?</div></div></div></div></blockquote><div><br class=""></div><div>Possibly. I did this approach because I wanted to split out the file type implementations and there were a number of helper functions as well. In this case, if the api is relatively small and self-contained, a header is probably not necessary.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class="">Should every interpolation type have its own function declaration or do we override for different types?</div></div></div></div></blockquote><div><br class=""></div><div>No override.</div><div><br class=""></div><div>I'd say there would just need to be a way to pass the array and samples to/from the algorithm, so that would be formalized via function which each implementation can do separately. Then choosing the algorithm just changes which function pointers are called. In the sound file update, the soundfile type is a struct and each implementation sets the function pointers and registers itself on setup (at the bottom of each type implementation file). I used this pattern as it is a common C approach and used through out the Pd sources, as far as I can tell, although I would not say I am a C master having started with C++ & object-orientation.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class="">(A bit like an abstract class, but I don’t know how this works in C)</div><div class="">The definitions would still go into „d_array.c“?</div></div></div></div></blockquote><div><br class=""></div><div>That was my approach with the soundfile update. The sound file implementations are in separate files ala d_soundfile_aiff.c.. In this case, I imagine the algorithms are not as complicated, so maybe they can all go in one file such as d_array_inter.c (aka interpolation), etc.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><div class="">Refactoring and testing this could take quite some time...<br class=""></div></div></div></div></div></blockquote><div><br class=""></div><div>Yup. My approach was to start only by refactoring the existing code and separating it without changing anything major. Once that was working, then I started updates and bug fixes. It was maybe 1 month of work with help form others in testing, but I don't think this will take nearly as long.</div><br class=""><blockquote type="cite" class=""><div class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""><div class=""><div class=""><blockquote type="cite" class=""><div class="">Am 2021-05-04 um 04:35 schrieb Alexandre Torres Porres <<a href="mailto:porres@gmail.com" class="">porres@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class="">Em seg., 3 de mai. de 2021 às 12:52, Dan Wilcox <<a href="mailto:danomatika@gmail.com" class="">danomatika@gmail.com</a>> escreveu:<br class=""></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;" class="">Maybe I'm opening a can of worms, but I could imagine tabread etc taking an argument to specify which algorithm to use among a (small) list of those available. The current algorithm would be the default so as not to break existing patches. :)</div></blockquote><div class=""><br class=""></div><div class="">I had suggested the same! ;) </div></div></div>
_______________________________________________<br class=""><a href="mailto:Pd-list@lists.iem.at" class="">Pd-list@lists.iem.at</a> mailing list<br class="">UNSUBSCRIBE and account-management -> <a href="https://lists.puredata.info/listinfo/pd-list" class="">https://lists.puredata.info/listinfo/pd-list</a><br class=""></div></blockquote></div><br class=""></div></div></div></div></blockquote></div><br class=""><div class="">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">--------</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">Dan Wilcox</div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://twitter.com/danomatika" class="">@danomatika</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://danomatika.com" class="">danomatika.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;"><a href="http://robotcowboy.com" class="">robotcowboy.com</a></div><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><br class="Apple-interchange-newline">
</div>
<br class=""></body></html>