[Cs-dev] strings (prints) question
Date | 2015-10-03 18:59 |
From | Peiman Khosravi |
Subject | [Cs-dev] strings (prints) question |
Attachments | None None |
Hello, Is there any reason why the csd below prints out "soundin.666" instead of just "666"? Many Thanks Peiman <CsoundSynthesizer> <CsOptions> -d -odac </CsOptions> <CsInstruments> sr = 44100 ksmps = 1 nchnls = 2 0dbfs = 1.0 instr 1 Scn = p4 prints Scn endin </CsInstruments> <CsScore> i1 0 1 666 </CsScore> </CsoundSynthesizer> |
Date | 2015-10-03 19:06 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
because 666 is the sign of the beast... ...no seriously: 666 is not a string. So when you assign a numeric p4 to a string, it interprets this as a code to use with soundfiles, making the string that gets printed. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2015-10-03 19:11 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
Thanks Victor. Is there any way to convert an integer to string? On 03/10/2015 19:06, Victor Lazzarini
wrote:
|
Date | 2015-10-03 19:34 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
stroI and strod should do the trick Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2015-10-03 19:43 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
As always thank you. I promise to be more careful and avoid such
numbers in the future! Best, Peiman On 03/10/2015 19:34, Victor Lazzarini
wrote:
|
Date | 2015-10-03 19:46 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
If you don't there will be retribution. You will be made to listen to iron maiden for a whole day. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2015-10-03 20:29 |
From | Anders Genell |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
Why not render it?
|
Date | 2015-10-03 21:50 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | strtod.html strtol.html None None |
After listening to iron maiden I've realised that
strtod and
strtol do the
opposite of what I'm after! On 03/10/2015 19:46, Victor Lazzarini
wrote:
|
Date | 2015-10-03 22:39 |
From | richard |
Subject | Re: [Cs-dev] strings (prints) question |
Maybe write i1 0 1 "666" ? Richard Dobson On 03/10/2015 19:11, Peiman Khosravi wrote: > Thanks Victor. Is there any way to convert an integer to string? > > On 03/10/2015 19:06, Victor Lazzarini wrote: >> because 666 is the sign of the beast... >> >> ...no seriously: 666 is not a string. So when you assign a numeric p4 >> to a string, it interprets this as a code to use with soundfiles, >> making the string that gets printed. >> ... > > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2015-10-03 22:41 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
I would but I'm getting the number from the channel count to split a
multichannel file into multi-mono. However, I think I can live with
the soundin prefix! <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments> sr = $SR ksmps = 1 nchnls = $NCHNLS 0dbfs = 1.0 instr 1 ilength filelen "$FILE" ; Length of file in seconds ichanNumb filenchnls "$FILE" icnt = 0 while icnt < ichanNumb do icnt += 1 event_i "i", 2, 0, ilength*0.02, icnt od endin instr 2 asig[] diskin2 "$FILE", 50 Scn = p4 Ssuffix strcat ".", Scn Ssuffix strcat Ssuffix, ".aif" SfileName strcat "$OUT", Ssuffix fout SfileName, 2, asig[p4-1] prints SfileName endin </CsInstruments> <CsScore> i1 0 .005 </CsScore> </CsoundSynthesizer> On 03/10/2015 22:39, richard wrote:
Maybe write i1 0 1 "666" ? Richard Dobson On 03/10/2015 19:11, Peiman Khosravi wrote:Thanks Victor. Is there any way to convert an integer to string? On 03/10/2015 19:06, Victor Lazzarini wrote:because 666 is the sign of the beast... ...no seriously: 666 is not a string. So when you assign a numeric p4 to a string, it interprets this as a code to use with soundfiles, making the string that gets printed...._______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-devel------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/csound-devel |
Date | 2015-10-04 00:02 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
Ah, yes. You want sprintf Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland
|
Date | 2015-10-04 00:36 |
From | Peiman Khosravi |
Subject | Re: [Cs-dev] strings (prints) question |
Attachments | None None |
Ah yes that does it! Thanks P On 04/10/2015 00:02, Victor Lazzarini
wrote:
|