Csound Csound-dev Csound-tekno Search About

[Csnd] fout - close the file

Date2017-09-06 21:10
FromRoger Kelly
Subject[Csnd] fout - close the file
Is there a way to get fout to close the file before the end of the  score run?

I want to close fout and then reopen it with an ftgen.

basically this is the area of code:


if ktotaltick < isampletime then

   fout "/Users/A727200/proj/mbox/mbox/track3.wav", 14, ainl,ainr

   outs ainl,ainr

else

   ; NEED TO CLOSE THE FILE HERE!

   Sfile = "/Users/A727200/proj/mbox/mbox/track2.wav"

    

   ilen filelen Sfile ; Find length

   isr filesr Sfile ; Find sample rate


   isamps = ilen * isr*2 ; Total number of samples


    printks "samples %f\n", .1,isamps

    itab ftgen 8, 0, isamps, 1,"/Users/A727200/proj/mbox/mbox/track3.wav", 0, 0, 0

    printks "playback",.1

    al, ar loscil 1, 1, 8, 1

     outs al,ar


endif


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

Date2017-09-06 21:17
FromVictor Lazzarini
SubjectRe: [Csnd] fout - close the file
stopping the instrument should close the file.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 6 Sep 2017, at 21:11, Roger Kelly <loraxman@GMAIL.COM> wrote:

Is there a way to get fout to close the file before the end of the  score run?

I want to close fout and then reopen it with an ftgen.

basically this is the area of code:


if ktotaltick < isampletime then

   fout "/Users/A727200/proj/mbox/mbox/track3.wav", 14, ainl,ainr

   outs ainl,ainr

else

   ; NEED TO CLOSE THE FILE HERE!

   Sfile = "/Users/A727200/proj/mbox/mbox/track2.wav"

    

   ilen filelen Sfile ; Find length

   isr filesr Sfile ; Find sample rate


   isamps = ilen * isr*2 ; Total number of samples


    printks "samples %f\n", .1,isamps

    itab ftgen 8, 0, isamps, 1,"/Users/A727200/proj/mbox/mbox/track3.wav", 0, 0, 0

    printks "playback",.1

    al, ar loscil 1, 1, 8, 1

     outs al,ar


endif


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

Date2017-09-06 21:52
FromRoger Kelly
SubjectRe: [Csnd] fout - close the file
Gave it a try.  Just what I needed!! Thanks

On Wed, Sep 6, 2017 at 3:17 PM, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
stopping the instrument should close the file.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 6 Sep 2017, at 21:11, Roger Kelly <loraxman@GMAIL.COM> wrote:

Is there a way to get fout to close the file before the end of the  score run?

I want to close fout and then reopen it with an ftgen.

basically this is the area of code:


if ktotaltick < isampletime then

   fout "/Users/A727200/proj/mbox/mbox/track3.wav", 14, ainl,ainr

   outs ainl,ainr

else

   ; NEED TO CLOSE THE FILE HERE!

   Sfile = "/Users/A727200/proj/mbox/mbox/track2.wav"

    

   ilen filelen Sfile ; Find length

   isr filesr Sfile ; Find sample rate


   isamps = ilen * isr*2 ; Total number of samples


    printks "samples %f\n", .1,isamps

    itab ftgen 8, 0, isamps, 1,"/Users/A727200/proj/mbox/mbox/track3.wav", 0, 0, 0

    printks "playback",.1

    al, ar loscil 1, 1, 8, 1

     outs al,ar


endif


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