Csound Csound-dev Csound-tekno Search About

[Csnd] Odd strupper & strupperk behaviour

Date2025-02-18 19:58
FromMaximilian Marcoll
Subject[Csnd] Odd strupper & strupperk behaviour
Attachmentssmime.p7s  

Hi everyone!

There seems to be a problem with the strupper and strupperk opcodes.
Both seem to retain portions of a previously processed string, which are returned if the current string is shorter than the previous one.


The following code demonstrates the issue:


<CsoundSynthesizer>
<CsInstruments>

sr = 44100
0dbfs = 1
nchnls = 1

instr 1

String1 = p4
String2 sprintfk "%s\n", String1
prints String2
endin

instr 2
String1 = p4
String2 sprintfk "%s\n", String1
String3 strupper String2
prints String3
endin


instr 3
String1 = p4
String2 sprintfk "%s\n", String1
String3 strupperk String2
prints String3
endin


</CsInstruments>
<CsScore>

i1 0 1 "the longer string"
i1 1 1 "shorter"
i2 2 1 "the longer uppercase string"
i2 3 1 "shorter"
i3 4 1 "the longer uppercase string"
i3 5 1 "shorter"

</CsScore>
</CsoundSynthesizer>

[running 6.18 on Mac OS 15.1]



________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar













________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar













Date2025-02-18 20:33
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Odd strupper & strupperk behaviour
Could you open a ticket in github and we'll look at it.

thx
Prof. Victor Lazzarini
Maynooth University
Ireland

On 18 Feb 2025, at 19:58, Maximilian Marcoll <maximilian.marcoll@hfm-weimar.de> wrote:


Hi everyone!

There seems to be a problem with the strupper and strupperk opcodes.
Both seem to retain portions of a previously processed string, which are returned if the current string is shorter than the previous one.


The following code demonstrates the issue:


<CsoundSynthesizer>
<CsInstruments>

sr = 44100
0dbfs = 1
nchnls = 1

instr 1

String1 = p4
String2 sprintfk "%s\n", String1
prints String2
endin

instr 2
String1 = p4
String2 sprintfk "%s\n", String1
String3 strupper String2
prints String3
endin


instr 3
String1 = p4
String2 sprintfk "%s\n", String1
String3 strupperk String2
prints String3
endin


</CsInstruments>
<CsScore>

i1 0 1 "the longer string"
i1 1 1 "shorter"
i2 2 1 "the longer uppercase string"
i2 3 1 "shorter"
i3 4 1 "the longer uppercase string"
i3 5 1 "shorter"

</CsScore>
</CsoundSynthesizer>

[running 6.18 on Mac OS 15.1]



________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar













________________________________

Prof. Maximilian Marcoll
Studio Director
Studio for Electroacoustic Music (SEAM)
University of Music Franz Liszt Weimar
Bauhaus University Weimar












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