Csound Csound-dev Csound-tekno Search About

[Csnd] Write a .txt file

Date2024-04-22 18:41
FromPhilipp Neumann
Subject[Csnd] Write a .txt file
Hello everybody!

Is there a function in csound to create a text file from scratch?
i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.

Greetings,
Philipp
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

Date2024-04-22 18:47
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Write a .txt file
fiopen

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 22 Apr 2024, at 18:42, Philipp Neumann  wrote:
>
> *Warning*
>
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>
> Hello everybody!
>
> Is there a function in csound to create a text file from scratch?
> i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.
>
> Greetings,
> Philipp
> 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

Date2024-04-22 21:27
FromPhilipp Neumann
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Write a .txt file
Thanks Victor!

Now, related to the first question, i want to know if i can delay the #include of the same file. is this possible in some kind of way?
i do this

instr file_validity
  iValid filevalid "midi-presets.txt"
  
  if iValid == 1 igoto skip
    print iValid
    iFile fiopen "midi-presets.txt", 0
  skip:      
  turnoff
endin

and later i do the #include „midi-presets.txt". but when i start csound the files does not exist yet. but i guess the #include is part of the preprocessor, so this is happening even before the init phase.

Or is there a way around this?

Greetings,
Philipp
> Am 22.04.2024 um 19:47 schrieb Victor Lazzarini :
> 
> fiopen
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
>> On 22 Apr 2024, at 18:42, Philipp Neumann  wrote:
>> 
>> *Warning*
>> 
>> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>> 
>> Hello everybody!
>> 
>> Is there a function in csound to create a text file from scratch?
>> i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.
>> 
>> Greetings,
>> Philipp
>> 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

Date2024-04-23 00:06
Fromthorin kerr
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Write a .txt file
Instead of #include, perhaps use compileorc ?

Thorin

On Tue, 23 Apr 2024, 6:28 am Philipp Neumann, <philipp@von-neumann.com> wrote:
Thanks Victor!

Now, related to the first question, i want to know if i can delay the #include of the same file. is this possible in some kind of way?
i do this

instr file_validity
  iValid filevalid "midi-presets.txt"

  if iValid == 1 igoto skip
    print iValid
    iFile fiopen "midi-presets.txt", 0
  skip:     
  turnoff
endin

and later i do the #include „midi-presets.txt". but when i start csound the files does not exist yet. but i guess the #include is part of the preprocessor, so this is happening even before the init phase.

Or is there a way around this?

Greetings,
Philipp
> Am 22.04.2024 um 19:47 schrieb Victor Lazzarini <Victor.Lazzarini@MU.IE>:
>
> fiopen
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 22 Apr 2024, at 18:42, Philipp Neumann <philipp@von-neumann.com> wrote:
>>
>> *Warning*
>>
>> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
>>
>> Hello everybody!
>>
>> Is there a function in csound to create a text file from scratch?
>> i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.
>>
>> Greetings,
>> Philipp
>> 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

Date2024-04-23 07:05
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Write a .txt file
I guess you can try recompiling the code


instead of including



Prof. Victor Lazzarini
Maynooth University
Ireland

On 22 Apr 2024, at 21:28, Philipp Neumann <philipp@von-neumann.com> wrote:

Thanks Victor!

Now, related to the first question, i want to know if i can delay the #include of the same file. is this possible in some kind of way?
i do this

instr file_validity
 iValid filevalid "midi-presets.txt"

 if iValid == 1 igoto skip
   print iValid
   iFile fiopen "midi-presets.txt", 0
 skip:      
 turnoff
endin

and later i do the #include „midi-presets.txt". but when i start csound the files does not exist yet. but i guess the #include is part of the preprocessor, so this is happening even before the init phase.

Or is there a way around this?

Greetings,
Philipp
Am 22.04.2024 um 19:47 schrieb Victor Lazzarini <Victor.Lazzarini@MU.IE>:

fiopen

Prof. Victor Lazzarini
Maynooth University
Ireland

On 22 Apr 2024, at 18:42, Philipp Neumann <philipp@von-neumann.com> wrote:

*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hello everybody!

Is there a function in csound to create a text file from scratch?
i don’t want to write in it, just create if filevalid is 0 and to use it after the init phase.

Greetings,
Philipp
Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882807511%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=lL2%2B6AmSLirohYqvlmpF3bxnVkttjTWHX5%2B40HJDKu8%3D&reserved=0
Send bugs reports to
     https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882821686%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=Cew4occpXay7IMbaM5%2BhR7e5v%2FjakG5cqOIqfj%2BbFIE%3D&reserved=0
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882832260%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=l8E28bMKWQKDkWRHB%2Fb0bjcieOYdOUUOOfmuBLTCzRk%3D&reserved=0
Send bugs reports to
      https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882842075%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=n9TW%2FqLhIbiZqSEckBc1xGtbd9fIuFIhHtnfLlD9Ssg%3D&reserved=0
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882849847%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=8Y7uIBbbWb1Y83WNlGYVhgQf6QRRtZpxRc9hGZS2mKI%3D&reserved=0
Send bugs reports to
       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C02%7CVictor.Lazzarini%40mu.ie%7Cc2e8da9daed5431f70d208dc630ab748%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638494144882857574%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=JEzB8JE9K1YLWNp4xUlzqJnMzJ8gjWOdMvXoUkxh0Q4%3D&reserved=0
Discussions of bugs and features can be posted here