Csound Csound-dev Csound-tekno Search About

[Csnd] Length limitation of sprintfk. Any workaround?

Date2025-09-06 14:18
FromSigurd Saue
Subject[Csnd] Length limitation of sprintfk. Any workaround?
It appears to me that there is a string length limitation when using sprintfk. My instrument is assembling a scoreline argument using sprintfk, passing a file path as one of the p-fields:

Sline sprintfk "i \"Instr_name\" 0 1 %d \"%s\" ", kID, Sfilepath

printks("%s\n", 1, Sline)

scoreline Sline, 1


For long file paths (due to a complex file structure) the Sline string ends up incomplete. I assume this is a limitation of sprintfk. Is there a workaround here? I can look into ways of shortening the paths, of course, but it would be nice with a more sustainable solution.


Sigurd



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2025-09-06 16:31
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Length limitation of sprintfk. Any workaround?
there should be no limit. Is the file path string right, I mean, can you isolate this to sprintkf?
If so, it's a bug and a ticket would be nice, with a short example demonstrating the issue.

thx

Prof. Victor Lazzarini
Maynooth University
Ireland

On 6 Sep 2025, at 14:18, Sigurd Saue <sigurd.saue@gmail.com> wrote:


You don't often get email from sigurd.saue@gmail.com. Learn why this is important

*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

It appears to me that there is a string length limitation when using sprintfk. My instrument is assembling a scoreline argument using sprintfk, passing a file path as one of the p-fields:

Sline sprintfk "i \"Instr_name\" 0 1 %d \"%s\" ", kID, Sfilepath

printks("%s\n", 1, Sline)

scoreline Sline, 1


For long file paths (due to a complex file structure) the Sline string ends up incomplete. I assume this is a limitation of sprintfk. Is there a workaround here? I can look into ways of shortening the paths, of course, but it would be nice with a more sustainable solution.


Sigurd



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here