Quantcast

[Csnd] Passing a string to CSD?

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Passing a string to CSD?

eddyc
Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
Thanks
Ed
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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

jpff
Can you give a uecase?¬` what do you want to do with te string?


On Thu, 13 Apr 2017, Ed Costello wrote:

> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
> Thanks
> Ed
> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
The string is a path that will be used to open a file for processing.
Ed

> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>
> Can you give a uecase?¬` what do you want to do with te string?
>
>
> On Thu, 13 Apr 2017, Ed Costello wrote:
>
>> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
>> Thanks
>> Ed
>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

rorywalsh

On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
The string is a path that will be used to open a file for processing.
Ed

> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>
> Can you give a uecase?¬` what do you want to do with te string?
>
>
> On Thu, 13 Apr 2017, Ed Costello wrote:
>
>> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
>> Thanks
>> Ed
>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
Works great, thanks!
Ed

On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:


On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
The string is a path that will be used to open a file for processing.
Ed

> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>
> Can you give a uecase?¬` what do you want to do with te string?
>
>
> On Thu, 13 Apr 2017, Ed Costello wrote:
>
>> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
>> Thanks
>> Ed
>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
Is it also possible to end a performance when a condition has been reached, for instance:

if (ki == iFrameCount) then
endperformanceopcode

endif

Thanks
Ed

On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:

Works great, thanks!
Ed

On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:


On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
The string is a path that will be used to open a file for processing.
Ed

> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>
> Can you give a uecase?¬` what do you want to do with te string?
>
>
> On Thu, 13 Apr 2017, Ed Costello wrote:
>
>> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
>> Thanks
>> Ed
>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Victor Lazzarini
In reply to this post by eddyc
You can also use macros:

csound --omacro:name=blah …

then you can use it like this

 printf_i "%s \n", 1, "$name"


========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>
> Works great, thanks!
> Ed
>
>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>
>> Can you use --strset?
>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>
>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>> The string is a path that will be used to open a file for processing.
>> Ed
>>
>> > On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>> >
>> > Can you give a uecase?¬` what do you want to do with te string?
>> >
>> >
>> > On Thu, 13 Apr 2017, Ed Costello wrote:
>> >
>> >> Is it possible to pass a string to a CSD file where I would like to say perform some processing on a file, like “csound process.csd -ofilename “myfile.wav”. I have seen that there is the option to define macros, but that seems to be just for either orchestra or score.
>> >> Thanks
>> >> Ed
>> >> 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


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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Steven Yi
In reply to this post by eddyc
Not sure what the bigger context is, but you can use turnoff to turn
off the instance of whatever you are rendering. If that's not the only
thing running, you might use an "e" event with event, event_i,
schedule, etc.

On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:

> Is it also possible to end a performance when a condition has been reached,
> for instance:
>
> if (ki == iFrameCount) then
> endperformanceopcode
>
> endif
>
> Thanks
> Ed
>
> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>
> Works great, thanks!
> Ed
>
> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>
> Can you use --strset?
> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>
> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>
>> The string is a path that will be used to open a file for processing.
>> Ed
>>
>> > On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>> >
>> > Can you give a uecase?¬` what do you want to do with te string?
>> >
>> >
>> > On Thu, 13 Apr 2017, Ed Costello wrote:
>> >
>> >> Is it possible to pass a string to a CSD file where I would like to say
>> >> perform some processing on a file, like “csound process.csd -ofilename
>> >> “myfile.wav”. I have seen that there is the option to define macros, but
>> >> that seems to be just for either orchestra or score.
>> >> Thanks
>> >> Ed
>> >> 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

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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Victor Lazzarini
This is what Steven meant:

if times:k() > 1 then
 event "e", 0, 0
endif

will close Csound after 1 second.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>
> Not sure what the bigger context is, but you can use turnoff to turn
> off the instance of whatever you are rendering. If that's not the only
> thing running, you might use an "e" event with event, event_i,
> schedule, etc.
>
> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>> Is it also possible to end a performance when a condition has been reached,
>> for instance:
>>
>> if (ki == iFrameCount) then
>> endperformanceopcode
>>
>> endif
>>
>> Thanks
>> Ed
>>
>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>
>> Works great, thanks!
>> Ed
>>
>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>
>> Can you use --strset?
>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>
>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>
>>> The string is a path that will be used to open a file for processing.
>>> Ed
>>>
>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>
>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>
>>>>
>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>
>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>> that seems to be just for either orchestra or score.
>>>>> Thanks
>>>>> Ed
>>>>> 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
>
> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
In reply to this post by Steven Yi
I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 256
nchnls = 2
0dbfs  = 1

#include “PvsConvert.udo"

instr AudioFileToPvs

    Spath strget 0
    iFFTSize init 1024
    iHop init iFFTSize/4
    ki init 0

    iFileLength filelen Spath

    iFileLength = iFileLength * sr
    kFrameLength = int((iFileLength - iFFTSize) / iHop)


    aSig diskin2 Spath

 
    kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop

    // Write to kmagnitudes[] and kfrequencies to hdf5 file….

   if (ki == kFrameLength) then
       // end performance somehow?
    endif

    ki += 1
endin

schedule("AudioFileToPvs", 0, -1)

</CsInstruments>
<CsScore>
</CsScore>
</CsoundSynthesizer>


The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?

Ed


> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>
> Not sure what the bigger context is, but you can use turnoff to turn
> off the instance of whatever you are rendering. If that's not the only
> thing running, you might use an "e" event with event, event_i,
> schedule, etc.
>
> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>> Is it also possible to end a performance when a condition has been reached,
>> for instance:
>>
>> if (ki == iFrameCount) then
>> endperformanceopcode
>>
>> endif
>>
>> Thanks
>> Ed
>>
>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>
>> Works great, thanks!
>> Ed
>>
>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>
>> Can you use --strset?
>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>
>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>
>>> The string is a path that will be used to open a file for processing.
>>> Ed
>>>
>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>
>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>
>>>>
>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>
>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>> that seems to be just for either orchestra or score.
>>>>> Thanks
>>>>> Ed
>>>>> 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
>
> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
Ed

> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>
> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>
> <CsoundSynthesizer>
> <CsOptions>
> </CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 256
> nchnls = 2
> 0dbfs  = 1
>
> #include “PvsConvert.udo"
>
> instr AudioFileToPvs
>
>    Spath strget 0
>    iFFTSize init 1024
>    iHop init iFFTSize/4
>    ki init 0
>
>    iFileLength filelen Spath
>
>    iFileLength = iFileLength * sr
>    kFrameLength = int((iFileLength - iFFTSize) / iHop)
>
>
>    aSig diskin2 Spath
>
>
>    kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>
>    // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>
>   if (ki == kFrameLength) then
>       // end performance somehow?
>    endif
>
>    ki += 1
> endin
>
> schedule("AudioFileToPvs", 0, -1)
>
> </CsInstruments>
> <CsScore>
> </CsScore>
> </CsoundSynthesizer>
>
>
> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>
> Ed
>
>
>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>
>> Not sure what the bigger context is, but you can use turnoff to turn
>> off the instance of whatever you are rendering. If that's not the only
>> thing running, you might use an "e" event with event, event_i,
>> schedule, etc.
>>
>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>> Is it also possible to end a performance when a condition has been reached,
>>> for instance:
>>>
>>> if (ki == iFrameCount) then
>>> endperformanceopcode
>>>
>>> endif
>>>
>>> Thanks
>>> Ed
>>>
>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>
>>> Works great, thanks!
>>> Ed
>>>
>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>
>>> Can you use --strset?
>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>
>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>
>>>> The string is a path that will be used to open a file for processing.
>>>> Ed
>>>>
>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>
>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>
>>>>>
>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>
>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>> that seems to be just for either orchestra or score.
>>>>>> Thanks
>>>>>> Ed
>>>>>> 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
>>
>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Steven Yi
Normally you shouldn't do it, but you might try to run all of the code
in a k-rate loop then exit (including diskin2, PvsConvert).  If none
of the opcodes refer to any kind of global counter in the CSOUND
struct, you might be able to get away with it.

On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:

> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
> Ed
>
>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>
>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 256
>> nchnls = 2
>> 0dbfs  = 1
>>
>> #include “PvsConvert.udo"
>>
>> instr AudioFileToPvs
>>
>>    Spath strget 0
>>    iFFTSize init 1024
>>    iHop init iFFTSize/4
>>    ki init 0
>>
>>    iFileLength filelen Spath
>>
>>    iFileLength = iFileLength * sr
>>    kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>
>>
>>    aSig diskin2 Spath
>>
>>
>>    kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>
>>    // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>
>>   if (ki == kFrameLength) then
>>       // end performance somehow?
>>    endif
>>
>>    ki += 1
>> endin
>>
>> schedule("AudioFileToPvs", 0, -1)
>>
>> </CsInstruments>
>> <CsScore>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>
>> Ed
>>
>>
>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>
>>> Not sure what the bigger context is, but you can use turnoff to turn
>>> off the instance of whatever you are rendering. If that's not the only
>>> thing running, you might use an "e" event with event, event_i,
>>> schedule, etc.
>>>
>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>> Is it also possible to end a performance when a condition has been reached,
>>>> for instance:
>>>>
>>>> if (ki == iFrameCount) then
>>>> endperformanceopcode
>>>>
>>>> endif
>>>>
>>>> Thanks
>>>> Ed
>>>>
>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>
>>>> Works great, thanks!
>>>> Ed
>>>>
>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>
>>>> Can you use --strset?
>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>
>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>
>>>>> The string is a path that will be used to open a file for processing.
>>>>> Ed
>>>>>
>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>
>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>
>>>>>>
>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>
>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>> that seems to be just for either orchestra or score.
>>>>>>> Thanks
>>>>>>> Ed
>>>>>>> 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
>>>
>>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Victor Lazzarini
But if he is opening a CSD running it and closing it, he could just write a normal instrument that checks for time and writes
a file using the hdf5 opcode, and use -n to prevent the IO functions to be called (since he does not need them). I don’t
think a special k-rate loop is needed, it should be just as fast with a normal instrument.
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 14 Apr 2017, at 00:43, Steven Yi <[hidden email]> wrote:
>
> Normally you shouldn't do it, but you might try to run all of the code
> in a k-rate loop then exit (including diskin2, PvsConvert).  If none
> of the opcodes refer to any kind of global counter in the CSOUND
> struct, you might be able to get away with it.
>
> On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:
>> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
>> Ed
>>
>>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>>
>>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>>
>>> <CsoundSynthesizer>
>>> <CsOptions>
>>> </CsOptions>
>>> <CsInstruments>
>>>
>>> sr = 44100
>>> ksmps = 256
>>> nchnls = 2
>>> 0dbfs  = 1
>>>
>>> #include “PvsConvert.udo"
>>>
>>> instr AudioFileToPvs
>>>
>>>   Spath strget 0
>>>   iFFTSize init 1024
>>>   iHop init iFFTSize/4
>>>   ki init 0
>>>
>>>   iFileLength filelen Spath
>>>
>>>   iFileLength = iFileLength * sr
>>>   kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>>
>>>
>>>   aSig diskin2 Spath
>>>
>>>
>>>   kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>>
>>>   // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>>
>>>  if (ki == kFrameLength) then
>>>      // end performance somehow?
>>>   endif
>>>
>>>   ki += 1
>>> endin
>>>
>>> schedule("AudioFileToPvs", 0, -1)
>>>
>>> </CsInstruments>
>>> <CsScore>
>>> </CsScore>
>>> </CsoundSynthesizer>
>>>
>>>
>>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>>
>>> Ed
>>>
>>>
>>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>>
>>>> Not sure what the bigger context is, but you can use turnoff to turn
>>>> off the instance of whatever you are rendering. If that's not the only
>>>> thing running, you might use an "e" event with event, event_i,
>>>> schedule, etc.
>>>>
>>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>>> Is it also possible to end a performance when a condition has been reached,
>>>>> for instance:
>>>>>
>>>>> if (ki == iFrameCount) then
>>>>> endperformanceopcode
>>>>>
>>>>> endif
>>>>>
>>>>> Thanks
>>>>> Ed
>>>>>
>>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>>
>>>>> Works great, thanks!
>>>>> Ed
>>>>>
>>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>>
>>>>> Can you use --strset?
>>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>>
>>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>>
>>>>>> The string is a path that will be used to open a file for processing.
>>>>>> Ed
>>>>>>
>>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>>
>>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>>
>>>>>>>
>>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>>
>>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>>> that seems to be just for either orchestra or score.
>>>>>>>> Thanks
>>>>>>>> Ed
>>>>>>>> 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
>>>>
>>>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Steven Yi
Ah yes, -n would do the job nicely.

On Thu, Apr 13, 2017 at 9:48 PM, Victor Lazzarini
<[hidden email]> wrote:

> But if he is opening a CSD running it and closing it, he could just write a normal instrument that checks for time and writes
> a file using the hdf5 opcode, and use -n to prevent the IO functions to be called (since he does not need them). I don’t
> think a special k-rate loop is needed, it should be just as fast with a normal instrument.
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 14 Apr 2017, at 00:43, Steven Yi <[hidden email]> wrote:
>>
>> Normally you shouldn't do it, but you might try to run all of the code
>> in a k-rate loop then exit (including diskin2, PvsConvert).  If none
>> of the opcodes refer to any kind of global counter in the CSOUND
>> struct, you might be able to get away with it.
>>
>> On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:
>>> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
>>> Ed
>>>
>>>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>>>
>>>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>>>
>>>> <CsoundSynthesizer>
>>>> <CsOptions>
>>>> </CsOptions>
>>>> <CsInstruments>
>>>>
>>>> sr = 44100
>>>> ksmps = 256
>>>> nchnls = 2
>>>> 0dbfs  = 1
>>>>
>>>> #include “PvsConvert.udo"
>>>>
>>>> instr AudioFileToPvs
>>>>
>>>>   Spath strget 0
>>>>   iFFTSize init 1024
>>>>   iHop init iFFTSize/4
>>>>   ki init 0
>>>>
>>>>   iFileLength filelen Spath
>>>>
>>>>   iFileLength = iFileLength * sr
>>>>   kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>>>
>>>>
>>>>   aSig diskin2 Spath
>>>>
>>>>
>>>>   kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>>>
>>>>   // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>>>
>>>>  if (ki == kFrameLength) then
>>>>      // end performance somehow?
>>>>   endif
>>>>
>>>>   ki += 1
>>>> endin
>>>>
>>>> schedule("AudioFileToPvs", 0, -1)
>>>>
>>>> </CsInstruments>
>>>> <CsScore>
>>>> </CsScore>
>>>> </CsoundSynthesizer>
>>>>
>>>>
>>>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>>>
>>>> Ed
>>>>
>>>>
>>>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>>>
>>>>> Not sure what the bigger context is, but you can use turnoff to turn
>>>>> off the instance of whatever you are rendering. If that's not the only
>>>>> thing running, you might use an "e" event with event, event_i,
>>>>> schedule, etc.
>>>>>
>>>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>>>> Is it also possible to end a performance when a condition has been reached,
>>>>>> for instance:
>>>>>>
>>>>>> if (ki == iFrameCount) then
>>>>>> endperformanceopcode
>>>>>>
>>>>>> endif
>>>>>>
>>>>>> Thanks
>>>>>> Ed
>>>>>>
>>>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>>>
>>>>>> Works great, thanks!
>>>>>> Ed
>>>>>>
>>>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>>>
>>>>>> Can you use --strset?
>>>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>>>
>>>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>>>
>>>>>>> The string is a path that will be used to open a file for processing.
>>>>>>> Ed
>>>>>>>
>>>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>>>
>>>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>>>> that seems to be just for either orchestra or score.
>>>>>>>>> Thanks
>>>>>>>>> Ed
>>>>>>>>> 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
>>>>>
>>>>> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
Yeah -n works great, I was just wondering though, I want to include my UDOs in the file from another folder but it doesn’t seem to be working, just doing something like #include “Spectrum.udo” works if the csd and the udo are in the same folder, moving the udo up a directory though and doing #include “../Spectrum.udo” does not work, is this the expected behaviour?
Ed

> On 14 Apr 2017, at 02:50, Steven Yi <[hidden email]> wrote:
>
> Ah yes, -n would do the job nicely.
>
> On Thu, Apr 13, 2017 at 9:48 PM, Victor Lazzarini
> <[hidden email]> wrote:
>> But if he is opening a CSD running it and closing it, he could just write a normal instrument that checks for time and writes
>> a file using the hdf5 opcode, and use -n to prevent the IO functions to be called (since he does not need them). I don’t
>> think a special k-rate loop is needed, it should be just as fast with a normal instrument.
>> ========================
>> Prof. Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy,
>> Maynooth University,
>> Maynooth, Co Kildare, Ireland
>> Tel: 00 353 7086936
>> Fax: 00 353 1 7086952
>>
>>> On 14 Apr 2017, at 00:43, Steven Yi <[hidden email]> wrote:
>>>
>>> Normally you shouldn't do it, but you might try to run all of the code
>>> in a k-rate loop then exit (including diskin2, PvsConvert).  If none
>>> of the opcodes refer to any kind of global counter in the CSOUND
>>> struct, you might be able to get away with it.
>>>
>>> On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:
>>>> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
>>>> Ed
>>>>
>>>>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>>>>
>>>>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>>>>
>>>>> <CsoundSynthesizer>
>>>>> <CsOptions>
>>>>> </CsOptions>
>>>>> <CsInstruments>
>>>>>
>>>>> sr = 44100
>>>>> ksmps = 256
>>>>> nchnls = 2
>>>>> 0dbfs  = 1
>>>>>
>>>>> #include “PvsConvert.udo"
>>>>>
>>>>> instr AudioFileToPvs
>>>>>
>>>>>  Spath strget 0
>>>>>  iFFTSize init 1024
>>>>>  iHop init iFFTSize/4
>>>>>  ki init 0
>>>>>
>>>>>  iFileLength filelen Spath
>>>>>
>>>>>  iFileLength = iFileLength * sr
>>>>>  kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>>>>
>>>>>
>>>>>  aSig diskin2 Spath
>>>>>
>>>>>
>>>>>  kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>>>>
>>>>>  // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>>>>
>>>>> if (ki == kFrameLength) then
>>>>>     // end performance somehow?
>>>>>  endif
>>>>>
>>>>>  ki += 1
>>>>> endin
>>>>>
>>>>> schedule("AudioFileToPvs", 0, -1)
>>>>>
>>>>> </CsInstruments>
>>>>> <CsScore>
>>>>> </CsScore>
>>>>> </CsoundSynthesizer>
>>>>>
>>>>>
>>>>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>>>>
>>>>> Ed
>>>>>
>>>>>
>>>>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>>>>
>>>>>> Not sure what the bigger context is, but you can use turnoff to turn
>>>>>> off the instance of whatever you are rendering. If that's not the only
>>>>>> thing running, you might use an "e" event with event, event_i,
>>>>>> schedule, etc.
>>>>>>
>>>>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>>>>> Is it also possible to end a performance when a condition has been reached,
>>>>>>> for instance:
>>>>>>>
>>>>>>> if (ki == iFrameCount) then
>>>>>>> endperformanceopcode
>>>>>>>
>>>>>>> endif
>>>>>>>
>>>>>>> Thanks
>>>>>>> Ed
>>>>>>>
>>>>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>>>>
>>>>>>> Works great, thanks!
>>>>>>> Ed
>>>>>>>
>>>>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>>>>
>>>>>>> Can you use --strset?
>>>>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>>>>
>>>>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> The string is a path that will be used to open a file for processing.
>>>>>>>> Ed
>>>>>>>>
>>>>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>>>>
>>>>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>>>>
>>>>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>>>>> that seems to be just for either orchestra or score.
>>>>>>>>>> Thanks
>>>>>>>>>> Ed
>>>>>>>>>> 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
>>>>>>
>>>>>> 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

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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

Steven Yi
That should work, at least is has for me in my libsyi test CSD files
to use "../some.udo". (Just tested with solina_chorus.csd in that
project).

On Fri, Apr 14, 2017 at 6:52 PM, Ed Costello <[hidden email]> wrote:

> Yeah -n works great, I was just wondering though, I want to include my UDOs in the file from another folder but it doesn’t seem to be working, just doing something like #include “Spectrum.udo” works if the csd and the udo are in the same folder, moving the udo up a directory though and doing #include “../Spectrum.udo” does not work, is this the expected behaviour?
> Ed
>
>> On 14 Apr 2017, at 02:50, Steven Yi <[hidden email]> wrote:
>>
>> Ah yes, -n would do the job nicely.
>>
>> On Thu, Apr 13, 2017 at 9:48 PM, Victor Lazzarini
>> <[hidden email]> wrote:
>>> But if he is opening a CSD running it and closing it, he could just write a normal instrument that checks for time and writes
>>> a file using the hdf5 opcode, and use -n to prevent the IO functions to be called (since he does not need them). I don’t
>>> think a special k-rate loop is needed, it should be just as fast with a normal instrument.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy,
>>> Maynooth University,
>>> Maynooth, Co Kildare, Ireland
>>> Tel: 00 353 7086936
>>> Fax: 00 353 1 7086952
>>>
>>>> On 14 Apr 2017, at 00:43, Steven Yi <[hidden email]> wrote:
>>>>
>>>> Normally you shouldn't do it, but you might try to run all of the code
>>>> in a k-rate loop then exit (including diskin2, PvsConvert).  If none
>>>> of the opcodes refer to any kind of global counter in the CSOUND
>>>> struct, you might be able to get away with it.
>>>>
>>>> On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:
>>>>> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
>>>>> Ed
>>>>>
>>>>>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>>>>>
>>>>>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>>>>>
>>>>>> <CsoundSynthesizer>
>>>>>> <CsOptions>
>>>>>> </CsOptions>
>>>>>> <CsInstruments>
>>>>>>
>>>>>> sr = 44100
>>>>>> ksmps = 256
>>>>>> nchnls = 2
>>>>>> 0dbfs  = 1
>>>>>>
>>>>>> #include “PvsConvert.udo"
>>>>>>
>>>>>> instr AudioFileToPvs
>>>>>>
>>>>>>  Spath strget 0
>>>>>>  iFFTSize init 1024
>>>>>>  iHop init iFFTSize/4
>>>>>>  ki init 0
>>>>>>
>>>>>>  iFileLength filelen Spath
>>>>>>
>>>>>>  iFileLength = iFileLength * sr
>>>>>>  kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>>>>>
>>>>>>
>>>>>>  aSig diskin2 Spath
>>>>>>
>>>>>>
>>>>>>  kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>>>>>
>>>>>>  // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>>>>>
>>>>>> if (ki == kFrameLength) then
>>>>>>     // end performance somehow?
>>>>>>  endif
>>>>>>
>>>>>>  ki += 1
>>>>>> endin
>>>>>>
>>>>>> schedule("AudioFileToPvs", 0, -1)
>>>>>>
>>>>>> </CsInstruments>
>>>>>> <CsScore>
>>>>>> </CsScore>
>>>>>> </CsoundSynthesizer>
>>>>>>
>>>>>>
>>>>>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>>>>>
>>>>>> Ed
>>>>>>
>>>>>>
>>>>>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>>>>>
>>>>>>> Not sure what the bigger context is, but you can use turnoff to turn
>>>>>>> off the instance of whatever you are rendering. If that's not the only
>>>>>>> thing running, you might use an "e" event with event, event_i,
>>>>>>> schedule, etc.
>>>>>>>
>>>>>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>>>>>> Is it also possible to end a performance when a condition has been reached,
>>>>>>>> for instance:
>>>>>>>>
>>>>>>>> if (ki == iFrameCount) then
>>>>>>>> endperformanceopcode
>>>>>>>>
>>>>>>>> endif
>>>>>>>>
>>>>>>>> Thanks
>>>>>>>> Ed
>>>>>>>>
>>>>>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> Works great, thanks!
>>>>>>>> Ed
>>>>>>>>
>>>>>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> Can you use --strset?
>>>>>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>>>>>
>>>>>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>>>>>
>>>>>>>>> The string is a path that will be used to open a file for processing.
>>>>>>>>> Ed
>>>>>>>>>
>>>>>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>>>>>
>>>>>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>>>>>
>>>>>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>>>>>> that seems to be just for either orchestra or score.
>>>>>>>>>>> Thanks
>>>>>>>>>>> Ed
>>>>>>>>>>> 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
>>>>>>>
>>>>>>> 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
>
> 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
|  
Report Content as Inappropriate

Re: [Csnd] Passing a string to CSD?

eddyc
Yeah,

Ran into some weirdness there, was probably my fault but seemed like it didn’t like the path or directory structure or whatever. Works now though! thanks
Ed

> On 15 Apr 2017, at 00:03, Steven Yi <[hidden email]> wrote:
>
> That should work, at least is has for me in my libsyi test CSD files
> to use "../some.udo". (Just tested with solina_chorus.csd in that
> project).
>
> On Fri, Apr 14, 2017 at 6:52 PM, Ed Costello <[hidden email]> wrote:
>> Yeah -n works great, I was just wondering though, I want to include my UDOs in the file from another folder but it doesn’t seem to be working, just doing something like #include “Spectrum.udo” works if the csd and the udo are in the same folder, moving the udo up a directory though and doing #include “../Spectrum.udo” does not work, is this the expected behaviour?
>> Ed
>>
>>> On 14 Apr 2017, at 02:50, Steven Yi <[hidden email]> wrote:
>>>
>>> Ah yes, -n would do the job nicely.
>>>
>>> On Thu, Apr 13, 2017 at 9:48 PM, Victor Lazzarini
>>> <[hidden email]> wrote:
>>>> But if he is opening a CSD running it and closing it, he could just write a normal instrument that checks for time and writes
>>>> a file using the hdf5 opcode, and use -n to prevent the IO functions to be called (since he does not need them). I don’t
>>>> think a special k-rate loop is needed, it should be just as fast with a normal instrument.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy,
>>>> Maynooth University,
>>>> Maynooth, Co Kildare, Ireland
>>>> Tel: 00 353 7086936
>>>> Fax: 00 353 1 7086952
>>>>
>>>>> On 14 Apr 2017, at 00:43, Steven Yi <[hidden email]> wrote:
>>>>>
>>>>> Normally you shouldn't do it, but you might try to run all of the code
>>>>> in a k-rate loop then exit (including diskin2, PvsConvert).  If none
>>>>> of the opcodes refer to any kind of global counter in the CSOUND
>>>>> struct, you might be able to get away with it.
>>>>>
>>>>> On Thu, Apr 13, 2017 at 6:29 PM, Ed Costello <[hidden email]> wrote:
>>>>>> Just saw you email there after sending the last one Victor, I’ll give that a go thanks!
>>>>>> Ed
>>>>>>
>>>>>>> On 13 Apr 2017, at 23:28, Ed Costello <[hidden email]> wrote:
>>>>>>>
>>>>>>> I want to write a csd that I can call from command line with a string path argument. It’ll open up the audio file convert to pvs frames and write them to a hdf5 file as fast as possible and then return. I have this so far:
>>>>>>>
>>>>>>> <CsoundSynthesizer>
>>>>>>> <CsOptions>
>>>>>>> </CsOptions>
>>>>>>> <CsInstruments>
>>>>>>>
>>>>>>> sr = 44100
>>>>>>> ksmps = 256
>>>>>>> nchnls = 2
>>>>>>> 0dbfs  = 1
>>>>>>>
>>>>>>> #include “PvsConvert.udo"
>>>>>>>
>>>>>>> instr AudioFileToPvs
>>>>>>>
>>>>>>> Spath strget 0
>>>>>>> iFFTSize init 1024
>>>>>>> iHop init iFFTSize/4
>>>>>>> ki init 0
>>>>>>>
>>>>>>> iFileLength filelen Spath
>>>>>>>
>>>>>>> iFileLength = iFileLength * sr
>>>>>>> kFrameLength = int((iFileLength - iFFTSize) / iHop)
>>>>>>>
>>>>>>>
>>>>>>> aSig diskin2 Spath
>>>>>>>
>>>>>>>
>>>>>>> kframe, kmagnitudes[], kfrequencies[] PvsConvert aSig, iFFTSize, iHop
>>>>>>>
>>>>>>> // Write to kmagnitudes[] and kfrequencies to hdf5 file….
>>>>>>>
>>>>>>> if (ki == kFrameLength) then
>>>>>>>    // end performance somehow?
>>>>>>> endif
>>>>>>>
>>>>>>> ki += 1
>>>>>>> endin
>>>>>>>
>>>>>>> schedule("AudioFileToPvs", 0, -1)
>>>>>>>
>>>>>>> </CsInstruments>
>>>>>>> <CsScore>
>>>>>>> </CsScore>
>>>>>>> </CsoundSynthesizer>
>>>>>>>
>>>>>>>
>>>>>>> The PvsConvert thing is just a udo that does the pvs conversion (obvs). Any ideas the best way to proceed?
>>>>>>>
>>>>>>> Ed
>>>>>>>
>>>>>>>
>>>>>>>> On 13 Apr 2017, at 23:15, Steven Yi <[hidden email]> wrote:
>>>>>>>>
>>>>>>>> Not sure what the bigger context is, but you can use turnoff to turn
>>>>>>>> off the instance of whatever you are rendering. If that's not the only
>>>>>>>> thing running, you might use an "e" event with event, event_i,
>>>>>>>> schedule, etc.
>>>>>>>>
>>>>>>>> On Thu, Apr 13, 2017 at 5:53 PM, Ed Costello <[hidden email]> wrote:
>>>>>>>>> Is it also possible to end a performance when a condition has been reached,
>>>>>>>>> for instance:
>>>>>>>>>
>>>>>>>>> if (ki == iFrameCount) then
>>>>>>>>> endperformanceopcode
>>>>>>>>>
>>>>>>>>> endif
>>>>>>>>>
>>>>>>>>> Thanks
>>>>>>>>> Ed
>>>>>>>>>
>>>>>>>>> On 13 Apr 2017, at 18:34, Ed Costello <[hidden email]> wrote:
>>>>>>>>>
>>>>>>>>> Works great, thanks!
>>>>>>>>> Ed
>>>>>>>>>
>>>>>>>>> On 13 Apr 2017, at 18:27, Rory Walsh <[hidden email]> wrote:
>>>>>>>>>
>>>>>>>>> Can you use --strset?
>>>>>>>>> http://csound.github.io/docs/manual/CommandFlagsCategory.html
>>>>>>>>>
>>>>>>>>> On 13 April 2017 at 18:25, Ed Costello <[hidden email]> wrote:
>>>>>>>>>>
>>>>>>>>>> The string is a path that will be used to open a file for processing.
>>>>>>>>>> Ed
>>>>>>>>>>
>>>>>>>>>>> On 13 Apr 2017, at 18:23, jpff <[hidden email]> wrote:
>>>>>>>>>>>
>>>>>>>>>>> Can you give a uecase?¬` what do you want to do with te string?
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Thu, 13 Apr 2017, Ed Costello wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Is it possible to pass a string to a CSD file where I would like to say
>>>>>>>>>>>> perform some processing on a file, like “csound process.csd -ofilename
>>>>>>>>>>>> “myfile.wav”. I have seen that there is the option to define macros, but
>>>>>>>>>>>> that seems to be just for either orchestra or score.
>>>>>>>>>>>> Thanks
>>>>>>>>>>>> Ed
>>>>>>>>>>>> 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
>>>>>>>>
>>>>>>>> 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
>>
>> 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
Loading...