So, i have a code that I copied from ceammc's sfizz~ for my new sfz~ object to load alternate tunings. The object loads SFZ soundfont files
All we need is a string into a built in sfizz_load_scala_string function.
The string is tuning name, number of steps and steps in cents in this format "weird\n4\n155\n555\n777\n1111\n"
So I am trying to build this string from a list of intervals in cents and it is failing, but trying the string above works!
The code from ceammc's sfizz~ uses this structure and if I print the string in the code I do get something that looks exactly like a string that gets accepted, but trying to build this string this way fails somehow (while it must work for ceammc maybe, haven't tested)
*char* scale[2048] = "autogenerated scale\n";
*char** pscale = &scale[0] + strlen(scale);
pscale += sprintf(pscale, "%d\n", ac);
*for*(*int* i = 1; i < ac; i++)
pscale += sprintf(pscale, "%f\n", atom_getfloat(av+i));
So I am here asking for some other strategy to build this string or a way to fix whatever could be wrong here.
thanks
oh, here's the link to the code in the repo https://github.com/porres/pd-else/blob/master/sfizz~/sfizz_puredata.c#L107
Em dom., 9 de jul. de 2023 às 15:07, Alexandre Torres Porres < porres@gmail.com> escreveu:
So, i have a code that I copied from ceammc's sfizz~ for my new sfz~ object to load alternate tunings. The object loads SFZ soundfont files
All we need is a string into a built in sfizz_load_scala_string function.
The string is tuning name, number of steps and steps in cents in this format "weird\n4\n155\n555\n777\n1111\n"
So I am trying to build this string from a list of intervals in cents and it is failing, but trying the string above works!
The code from ceammc's sfizz~ uses this structure and if I print the string in the code I do get something that looks exactly like a string that gets accepted, but trying to build this string this way fails somehow (while it must work for ceammc maybe, haven't tested)
*char* scale[2048] = "autogenerated scale\n"; *char** pscale = &scale[0] + strlen(scale); pscale += sprintf(pscale, "%d\n", ac); *for*(*int* i = 1; i < ac; i++) pscale += sprintf(pscale, "%f\n", atom_getfloat(av+i));
So I am here asking for some other strategy to build this string or a way to fix whatever could be wrong here.
thanks
created an issue https://github.com/porres/pd-else/issues/1684
Em dom., 9 de jul. de 2023 às 15:16, Alexandre Torres Porres < porres@gmail.com> escreveu:
oh, here's the link to the code in the repo https://github.com/porres/pd-else/blob/master/sfizz~/sfizz_puredata.c#L107
Em dom., 9 de jul. de 2023 às 15:07, Alexandre Torres Porres < porres@gmail.com> escreveu:
So, i have a code that I copied from ceammc's sfizz~ for my new sfz~ object to load alternate tunings. The object loads SFZ soundfont files
All we need is a string into a built in sfizz_load_scala_string function.
The string is tuning name, number of steps and steps in cents in this format "weird\n4\n155\n555\n777\n1111\n"
So I am trying to build this string from a list of intervals in cents and it is failing, but trying the string above works!
The code from ceammc's sfizz~ uses this structure and if I print the string in the code I do get something that looks exactly like a string that gets accepted, but trying to build this string this way fails somehow (while it must work for ceammc maybe, haven't tested)
*char* scale[2048] = "autogenerated scale\n"; *char** pscale = &scale[0] + strlen(scale); pscale += sprintf(pscale, "%d\n", ac); *for*(*int* i = 1; i < ac; i++) pscale += sprintf(pscale, "%f\n", atom_getfloat(av+i));
So I am here asking for some other strategy to build this string or a way to fix whatever could be wrong here.
thanks
I fixed it, sorry for the noise and thanks for the help Seb Shader, the issue wasn't the string building
cheers
Em dom., 9 de jul. de 2023 às 16:15, Alexandre Torres Porres < porres@gmail.com> escreveu:
created an issue https://github.com/porres/pd-else/issues/1684
Em dom., 9 de jul. de 2023 às 15:16, Alexandre Torres Porres < porres@gmail.com> escreveu:
oh, here's the link to the code in the repo https://github.com/porres/pd-else/blob/master/sfizz~/sfizz_puredata.c#L107
Em dom., 9 de jul. de 2023 às 15:07, Alexandre Torres Porres < porres@gmail.com> escreveu:
So, i have a code that I copied from ceammc's sfizz~ for my new sfz~ object to load alternate tunings. The object loads SFZ soundfont files
All we need is a string into a built in sfizz_load_scala_string function.
The string is tuning name, number of steps and steps in cents in this format "weird\n4\n155\n555\n777\n1111\n"
So I am trying to build this string from a list of intervals in cents and it is failing, but trying the string above works!
The code from ceammc's sfizz~ uses this structure and if I print the string in the code I do get something that looks exactly like a string that gets accepted, but trying to build this string this way fails somehow (while it must work for ceammc maybe, haven't tested)
*char* scale[2048] = "autogenerated scale\n"; *char** pscale = &scale[0] + strlen(scale); pscale += sprintf(pscale, "%d\n", ac); *for*(*int* i = 1; i < ac; i++) pscale += sprintf(pscale, "%f\n", atom_getfloat(av+i));
So I am here asking for some other strategy to build this string or a way to fix whatever could be wrong here.
thanks