Csound Csound-dev Csound-tekno Search About

Cast from S to i

Date2016-01-20 00:38
FromGuillermo Senna
SubjectCast from S to i
Hi,

Is there a way to cast from a String (containing numbers only) to an 
i-variable? If there isn't one, is there a way I could (indirectly) 
accomplish that?

Thanks.

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

Date2016-01-20 00:47
FromKevin Welsh
SubjectRe: Cast from S to i
I haven't personally tried it yet, but Rory had suggested
strtod(STRING) to me for a similar problem on the cabbage forums.
Looks like it would probably work, but I had ended up working around
my problem a different way.

http://csound.github.io/docs/manual/strtod.html

On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna  wrote:
> Hi,
>
> Is there a way to cast from a String (containing numbers only) to an
> i-variable? If there isn't one, is there a way I could (indirectly)
> accomplish that?
>
> Thanks.
>
> 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

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

Date2016-01-20 01:19
FromGuillermo Senna
SubjectRe: Cast from S to i
It works! Thank you Kevin. On an unrelated subject, I was wondering if 
you were able to solve your build issues in Mac OS. I was trying to 
solve a similar problem for a friend. I've found this -> 
http://sourceforge.net/p/csound/mailman/message/34440982/
Did you try copying libpng into /usr/local/lib?

Cheers.

On 19/01/16 21:47, Kevin Welsh wrote:
> I haven't personally tried it yet, but Rory had suggested
> strtod(STRING) to me for a similar problem on the cabbage forums.
> Looks like it would probably work, but I had ended up working around
> my problem a different way.
>
> http://csound.github.io/docs/manual/strtod.html
>
> On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna  wrote:
>> Hi,
>>
>> Is there a way to cast from a String (containing numbers only) to an
>> i-variable? If there isn't one, is there a way I could (indirectly)
>> accomplish that?
>>
>> Thanks.
>>
>> 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
> 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

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

Date2016-01-20 01:36
FromKevin Welsh
SubjectRe: Cast from S to i

I did not solve that yet... Thanks for the tip! I wont be able to try it for a little bit, but I'll keep my fingers crossed and give it a shot ASAP.

On Jan 19, 2016 8:20 PM, "Guillermo Senna" <gsenna@gmail.com> wrote:
It works! Thank you Kevin. On an unrelated subject, I was wondering if you were able to solve your build issues in Mac OS. I was trying to solve a similar problem for a friend. I've found this -> http://sourceforge.net/p/csound/mailman/message/34440982/
Did you try copying libpng into /usr/local/lib?

Cheers.

On 19/01/16 21:47, Kevin Welsh wrote:
I haven't personally tried it yet, but Rory had suggested
strtod(STRING) to me for a similar problem on the cabbage forums.
Looks like it would probably work, but I had ended up working around
my problem a different way.

http://csound.github.io/docs/manual/strtod.html

On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna <gsenna@gmail.com> wrote:
Hi,

Is there a way to cast from a String (containing numbers only) to an
i-variable? If there isn't one, is there a way I could (indirectly)
accomplish that?

Thanks.

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
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

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
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

Date2016-01-20 06:51
Fromjoachim heintz
SubjectRe: Cast from S to i
yes, if the string is something like "1.414", you can use the opcode strtod.

if the string contains more than one number, separated by any character, 
you can use the UDO StrayGetNum, which returns the element you indicate, 
for instance:

iNum StrayGetNum "1 2 3 4 5", 2
-> iNum = 3

https://github.com/csudo/csudo/blob/master/strays/StrayGetNum.csd

best -
	joachim


On 20/01/16 02:19, Guillermo Senna wrote:
> It works! Thank you Kevin. On an unrelated subject, I was wondering if
> you were able to solve your build issues in Mac OS. I was trying to
> solve a similar problem for a friend. I've found this ->
> http://sourceforge.net/p/csound/mailman/message/34440982/
> Did you try copying libpng into /usr/local/lib?
>
> Cheers.
>
> On 19/01/16 21:47, Kevin Welsh wrote:
>> I haven't personally tried it yet, but Rory had suggested
>> strtod(STRING) to me for a similar problem on the cabbage forums.
>> Looks like it would probably work, but I had ended up working around
>> my problem a different way.
>>
>> http://csound.github.io/docs/manual/strtod.html
>>
>> On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna 
>> wrote:
>>> Hi,
>>>
>>> Is there a way to cast from a String (containing numbers only) to an
>>> i-variable? If there isn't one, is there a way I could (indirectly)
>>> accomplish that?
>>>
>>> Thanks.
>>>
>>> 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
>> 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
>
> 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
>

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

Date2016-01-20 07:08
FromGuillermo Senna
SubjectRe: Cast from S to i
Thanks joachim! I was about to go on reinventing the wheel.

On 20/01/16 03:51, joachim heintz wrote:
> yes, if the string is something like "1.414", you can use the opcode 
> strtod.
>
> if the string contains more than one number, separated by any 
> character, you can use the UDO StrayGetNum, which returns the element 
> you indicate, for instance:
>
> iNum StrayGetNum "1 2 3 4 5", 2
> -> iNum = 3
>
> https://github.com/csudo/csudo/blob/master/strays/StrayGetNum.csd
>
> best -
>     joachim
>
>
> On 20/01/16 02:19, Guillermo Senna wrote:
>> It works! Thank you Kevin. On an unrelated subject, I was wondering if
>> you were able to solve your build issues in Mac OS. I was trying to
>> solve a similar problem for a friend. I've found this ->
>> http://sourceforge.net/p/csound/mailman/message/34440982/
>> Did you try copying libpng into /usr/local/lib?
>>
>> Cheers.
>>
>> On 19/01/16 21:47, Kevin Welsh wrote:
>>> I haven't personally tried it yet, but Rory had suggested
>>> strtod(STRING) to me for a similar problem on the cabbage forums.
>>> Looks like it would probably work, but I had ended up working around
>>> my problem a different way.
>>>
>>> http://csound.github.io/docs/manual/strtod.html
>>>
>>> On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna 
>>> wrote:
>>>> Hi,
>>>>
>>>> Is there a way to cast from a String (containing numbers only) to an
>>>> i-variable? If there isn't one, is there a way I could (indirectly)
>>>> accomplish that?
>>>>
>>>> Thanks.
>>>>
>>>> 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
>>> 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
>>
>> 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
>>
>
> 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

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

Date2016-01-22 04:36
FromKevin Welsh
SubjectRe: Cast from S to i
Wow, this is a *really* useful shortcut!  Seems like a great
alternative to using table reads in many simple cases.

On Wed, Jan 20, 2016 at 2:08 AM, Guillermo Senna  wrote:
> Thanks joachim! I was about to go on reinventing the wheel.
>
>
> On 20/01/16 03:51, joachim heintz wrote:
>>
>> yes, if the string is something like "1.414", you can use the opcode
>> strtod.
>>
>> if the string contains more than one number, separated by any character,
>> you can use the UDO StrayGetNum, which returns the element you indicate, for
>> instance:
>>
>> iNum StrayGetNum "1 2 3 4 5", 2
>> -> iNum = 3
>>
>> https://github.com/csudo/csudo/blob/master/strays/StrayGetNum.csd
>>
>> best -
>>     joachim
>>
>>
>> On 20/01/16 02:19, Guillermo Senna wrote:
>>>
>>> It works! Thank you Kevin. On an unrelated subject, I was wondering if
>>> you were able to solve your build issues in Mac OS. I was trying to
>>> solve a similar problem for a friend. I've found this ->
>>> http://sourceforge.net/p/csound/mailman/message/34440982/
>>> Did you try copying libpng into /usr/local/lib?
>>>
>>> Cheers.
>>>
>>> On 19/01/16 21:47, Kevin Welsh wrote:
>>>>
>>>> I haven't personally tried it yet, but Rory had suggested
>>>> strtod(STRING) to me for a similar problem on the cabbage forums.
>>>> Looks like it would probably work, but I had ended up working around
>>>> my problem a different way.
>>>>
>>>> http://csound.github.io/docs/manual/strtod.html
>>>>
>>>> On Tue, Jan 19, 2016 at 7:38 PM, Guillermo Senna 
>>>> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> Is there a way to cast from a String (containing numbers only) to an
>>>>> i-variable? If there isn't one, is there a way I could (indirectly)
>>>>> accomplish that?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> 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
>>>>
>>>> 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
>>>
>>>
>>> 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
>>>
>>
>> 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
>
>
> 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

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