[Csnd] filevalid at krate?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] filevalid at krate?

tgrey
Speaking of filevalid... it seems filevalid only operates at irate, but strings can operate at krate.

Would it be possible for filevalid to get "native" k-rate output?  I've written a UDO wrapper to force reinits when the input string changes, and that seems to work fine for my purposes... but it does seem like a logical addition to eventually add to the builtin opcode.

Here's the example UDO for anyone interested:

opcode FileValidK,k,S
  SFileName xin

  if(changed(SFileName)==1) then
    reinit MyReinit
  endif

  MyReinit:
  if(strlenk(SFileName)>0) then
    iFileExists      filevalid SFileName
  endif
  kIsValid = iFileExists

  xout kIsValid
endop
Csound mailing list [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] filevalid at krate?

jpff
Would a version that accepted k-rate input anfd gave k-rate outut be
sufficient?  I think that would just require a nw entry in the opcode list
with no new code.


On Sat, 26 May 2018, Kevin Welsh wrote:

> Speaking of filevalid... it seems filevalid only operates at irate, but
> strings can operate at krate.
> Would it be possible for filevalid to get "native" k-rate output?  I've
> written a UDO wrapper to force reinits when the input string changes, and that
> seems to work fine for my purposes... but it does seem like a logical addition
> to eventually add to the builtin opcode.
>
> Here's the example UDO for anyone interested:
>
> opcode FileValidK,k,S
>   SFileName xin
>
>   if(changed(SFileName)==1) then
>     reinit MyReinit
>   endif
>
>   MyReinit:
>   if(strlenk(SFileName)>0) then
>     iFileExists      filevalid SFileName
>   endif
>   kIsValid = iFileExists
>
>   xout kIsValid
> endop
> Csound mailing list [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] filevalid at krate?

tgrey
I think what you're proposing is that there be two different versions of the opcode, one that takes in an irate string and outputs an irate var, and a different opcode that takes in a krate string, and output a krate var.  Would this be two differently named opcodes as compared to one opcode that could do either based on the output request of the user?

I'm not particularly picky in how it's implemented, so that should suit my needs just fine.  But I'm also not very knowledgable about what goes on "behind the curtain" with csound, so whatever is determined to be the best balance between easy to implement, logical for users, backwards compatible, and forward thinking. :)

On Sat, May 26, 2018 at 8:35 AM, jpff <[hidden email]> wrote:
Would a version that accepted k-rate input anfd gave k-rate outut be sufficient?  I think that would just require a nw entry in the opcode list with no new code.



On Sat, 26 May 2018, Kevin Welsh wrote:

Speaking of filevalid... it seems filevalid only operates at irate, but
strings can operate at krate.
Would it be possible for filevalid to get "native" k-rate output?  I've
written a UDO wrapper to force reinits when the input string changes, and that
seems to work fine for my purposes... but it does seem like a logical addition
to eventually add to the builtin opcode.

Here's the example UDO for anyone interested:

opcode FileValidK,k,S
  SFileName xin

  if(changed(SFileName)==1) then
    reinit MyReinit
  endif

  MyReinit:
  if(strlenk(SFileName)>0) then
    iFileExists      filevalid SFileName
  endif
  kIsValid = iFileExists

  xout kIsValid
endop
Csound mailing list [hidden email]
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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] filevalid at krate?

jpff
Same name decided by result type

Sent from Blue
On 26 May 2018, at 13:48, Kevin Welsh <[hidden email]> wrote:
I think what you're proposing is that there be two different versions of the opcode, one that takes in an irate string and outputs an irate var, and a different opcode that takes in a krate string, and output a krate var.  Would this be two differently named opcodes as compared to one opcode that could do either based on the output request of the user?

I'm not particularly picky in how it's implemented, so that should suit my needs just fine.  But I'm also not very knowledgable about what goes on "behind the curtain" with csound, so whatever is determined to be the best balance between easy to implement, logical for users, backwards compatible, and forward thinking. :)

On Sat, May 26, 2018 at 8:35 AM, jpff <[hidden email]> wrote:
Would a version that accepted k-rate input anfd gave k-rate outut be sufficient?  I think that would just require a nw entry in the opcode list with no new code.



On Sat, 26 May 2018, Kevin Welsh wrote:

Speaking of filevalid... it seems filevalid only operates at irate, but
strings can operate at krate.
Would it be possible for filevalid to get "native" k-rate output?  I've
written a UDO wrapper to force reinits when the input string changes, and that
seems to work fine for my purposes... but it does seem like a logical addition
to eventually add to the builtin opcode.

Here's the example UDO for anyone interested:

opcode FileValidK,k,S
  SFileName xin

  if(changed(SFileName)==1) then
    reinit MyReinit
  endif

  MyReinit:
  if(strlenk(SFileName)>0) then
    iFileExists      filevalid SFileName
  endif
  kIsValid = iFileExists

  xout kIsValid
endop
Csound mailing list [hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] filevalid at krate?

tgrey
Perfect, I think that sounds like the best case scenario, but I wasn't sure if there might be a reason it was impossible.  I know k-rate strings are a little bit outside of the ordinary, so I wasn't sure what complications might arise.

On Sat, May 26, 2018 at 9:04 AM, John ff <[hidden email]> wrote:
Same name decided by result type

Sent from Blue
On 26 May 2018, at 13:48, Kevin Welsh <[hidden email]> wrote:
I think what you're proposing is that there be two different versions of the opcode, one that takes in an irate string and outputs an irate var, and a different opcode that takes in a krate string, and output a krate var.  Would this be two differently named opcodes as compared to one opcode that could do either based on the output request of the user?

I'm not particularly picky in how it's implemented, so that should suit my needs just fine.  But I'm also not very knowledgable about what goes on "behind the curtain" with csound, so whatever is determined to be the best balance between easy to implement, logical for users, backwards compatible, and forward thinking. :)

On Sat, May 26, 2018 at 8:35 AM, jpff <[hidden email]> wrote:
Would a version that accepted k-rate input anfd gave k-rate outut be sufficient?  I think that would just require a nw entry in the opcode list with no new code.



On Sat, 26 May 2018, Kevin Welsh wrote:

Speaking of filevalid... it seems filevalid only operates at irate, but
strings can operate at krate.
Would it be possible for filevalid to get "native" k-rate output?  I've
written a UDO wrapper to force reinits when the input string changes, and that
seems to work fine for my purposes... but it does seem like a logical addition
to eventually add to the builtin opcode.

Here's the example UDO for anyone interested:

opcode FileValidK,k,S
  SFileName xin

  if(changed(SFileName)==1) then
    reinit MyReinit
  endif

  MyReinit:
  if(strlenk(SFileName)>0) then
    iFileExists      filevalid SFileName
  endif
  kIsValid = iFileExists

  xout kIsValid
endop
Csound mailing list [hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] filevalid at krate?

tgrey
Sorry, this dawned on me as soon as I hit send...

There might also be a use case where a user provides an i-rate string and requests a k-rate result.  I'm not sure if the i vs k rate string input is handled differently, so perhaps it's worth mentioning.

On Sat, May 26, 2018 at 9:09 AM, Kevin Welsh <[hidden email]> wrote:
Perfect, I think that sounds like the best case scenario, but I wasn't sure if there might be a reason it was impossible.  I know k-rate strings are a little bit outside of the ordinary, so I wasn't sure what complications might arise.

On Sat, May 26, 2018 at 9:04 AM, John ff <[hidden email]> wrote:
Same name decided by result type

Sent from Blue
On 26 May 2018, at 13:48, Kevin Welsh <[hidden email]> wrote:
I think what you're proposing is that there be two different versions of the opcode, one that takes in an irate string and outputs an irate var, and a different opcode that takes in a krate string, and output a krate var.  Would this be two differently named opcodes as compared to one opcode that could do either based on the output request of the user?

I'm not particularly picky in how it's implemented, so that should suit my needs just fine.  But I'm also not very knowledgable about what goes on "behind the curtain" with csound, so whatever is determined to be the best balance between easy to implement, logical for users, backwards compatible, and forward thinking. :)

On Sat, May 26, 2018 at 8:35 AM, jpff <[hidden email]> wrote:
Would a version that accepted k-rate input anfd gave k-rate outut be sufficient?  I think that would just require a nw entry in the opcode list with no new code.



On Sat, 26 May 2018, Kevin Welsh wrote:

Speaking of filevalid... it seems filevalid only operates at irate, but
strings can operate at krate.
Would it be possible for filevalid to get "native" k-rate output?  I've
written a UDO wrapper to force reinits when the input string changes, and that
seems to work fine for my purposes... but it does seem like a logical addition
to eventually add to the builtin opcode.

Here's the example UDO for anyone interested:

opcode FileValidK,k,S
  SFileName xin

  if(changed(SFileName)==1) then
    reinit MyReinit
  endif

  MyReinit:
  if(strlenk(SFileName)>0) then
    iFileExists      filevalid SFileName
  endif
  kIsValid = iFileExists

  xout kIsValid
endop
Csound mailing list [hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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