| Yes; like this:
> ;SEND AUDIO TO OUTPUTS
> outs asig1, asig2
> ;ACCUMULATE ALL NOTES TO THE GLOBAL VARIABLES gasend1 and 2
> ;THIS WILL PERMIT OVERLAPPING NOTES
> gasend1 = gasend1 + asig1
> gasend2 = gasend2 + asig2
> endin
>
> instr 2 ;RECORDS ALL SOUND
> ;RECORD A STEREO 16 BIT SOUND FILE
> fout "test.wav", 4, gasend1, gasend2
Art Hunkins
----- Original Message -----
From: "Stefan Thomas"
To:
Sent: Sunday, April 05, 2009 5:41 PM
Subject: [Csnd] Re: RE: Re: Re: making a wav file from live midi input
Sorry,
one last question: how can I record a stereo-file with fout?
2009/4/5 Iain McCurdy :
> Hi Stefan,
>
> There are a few thing to change in your example.
> You should place the fout (sound file recording) line in an separate
> always
> on instrument. This will then record the entire performance including
> overlapping notes correctly.
> You only need to use global variables (one beginning with 'g') when you
> want
> to use the same variable across two or more instruments. Non-global
> variables only have scope within the instrument within which they have
> been
> created. Non-global variables with the same name in different instruments
> are different variables probably with different values.
> In the amended version of your code (below) a global variable is used to
> accumulate the audio from all instr 1 instances, thereby allowing
> overlapping notes/polyphony to be recorded.
> A single instance of instr 2, the file recording instrument, runs for the
> entire duration of our realtime performance. Do not run more that one
> instance of the same fout line! I think this was what was messing up the
> signal quality of your original code - every time a new note was played a
> new instance of the same fout line would be created.
> Our global variable needs to be initialised just (just after the header
> block) as will be needed in instr 2 before we have had a chance to play
> any
> notes on the keyboard and therefore give it a different value in instr 1.
> It needs to be cleared (set to zero) when we are finished with it at the
> end
> of instr 2 because of the accumulation thing that we are doing in instr 1.
> If you forget to do this you will very quickly end up with an unpleasant
> sound in your sound file recording (try it!).
>
> Hope this helps,
> Iain
>
>
>
> -odevaudio -M1 -b400
>
>
> sr = 44100
> kr = 4410
> ksmps = 10
> nchnls = 2
>
> ;SET INITIAL VALUE FOR gasend (SILENCE)
> gasend init 0
>
> instr 1 ;OSCILLATOR INSTRUMENT
> ;READ RT-MIDI NOTE NUMBERS, CONVERT TO CPS
> icps cpsmidi
> ;READ RT-MIDI VELOCITY, CONVERT TO AMP VALUES WITHIN THE RANGE 0-10000
> iamp ampmidi 10000
> ;CREATE A HARMONIC TONE
> asig oscili iamp, icps, 1
> ;SEND AUDIO TO OUTPUTS
> outs asig, asig
> ;ACCUMULATE ALL NOTES TO THE GLOBAL VARIABLE gasend
> ;THIS WILL PERMIT OVERLAPPING NOTES
> gasend = gasend + asig
> endin
>
> instr 2 ;RECORDS ALL SOUND
> ;RECORD A MONO 16 BIT SOUND FILE
> fout "test.wav", 4, gasend
> ;CLEAR GLOBAL VARIABLE (I.E. ASSIGN IT TO ZERO)
> gasend = 0
> endin
>
>
>
>
>
>
>
>
>
>
> ;FUNCTION TABLE OF A HARMONIC TIMBRE
> f1 0 1024 10 1 0 .25 0 .17
> i2 0 600 ;RECORDING INSTRUMENT RUNS CONTINUOUSLY
>
>
>
>> Date: Sun, 5 Apr 2009 11:37:07 +0200
>> From: kontrapunktstefan@googlemail.com
>> To: csound@lists.bath.ac.uk
>> Subject: [Csnd] Re: Re: making a wav file from live midi input
>>
>> Dear all,
>> thanks for Your fast answers. I have been able to play live while
>> making a wav-file at the same time, but the quality of the wav-file is
>> terrible. I don't know where I could change this.
>> Here is the code:
>>
>>
>> -odevaudio -M1 -b400
>>
>>
>> sr = 44100
>> kr = 4410
>> ksmps = 10
>> nchnls = 2
>>
>> instr 1
>> ;READ RT-MIDI NOTE NUMBERS, CONVERT TO CPS
>> icps cpsmidi
>> ;READ RT-MIDI VELOCITY, CONVERT TO AMP VALUES WITHIN THE RANGE 0-10000
>> iamp ampmidi 10000
>> ;CREATE A SINE TONE
>> asig oscili iamp, icps, 1
>> ;SEND AUDIO TO OUTPUTS
>> outs asig, asig
>> ga1 = asig
>> ga2 = asig
>> fout "test.wav", 4, ga1, ga2
>> endin
>>
>>
>> f1 0 1024 10 1 0 .25 0 .17
>> i1 0 600 ;let dummy instrument run so performance doesn't end
>>
>>
>>
>>
>> 2009/4/5 joachim heintz :
>> > If you use QuteCsound as frontend, you can simply push the Record
>> > button
>> > for
>> > this.
>> > Best -
>> > joachim
>> >
>> >
>> > Am 05.04.2009 um 00:07 schrieb Stefan Thomas:
>> >
>> >> Dear community,
>> >> I have succesfully made my first few patches and I can play it live
>> >> via midi, using "-odevaudio -M1 -b400" as csounds options.
>> >> Now I would like to record what I'm playinf directly to a wave file,
>> >> but I don't know how to do it.
>> >> Maybee I should mention, that I'm using a linux machine, with kubuntu
>> >> studio.
>> >> Thanks for Your support
>> >> Stefan
>> >>
>> >>
>> >> Send bugs reports to this list.
>> >> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> >> "unsubscribe
>> >> csound"
>> >
>> >
>> >
>> > Send bugs reports to this list.
>> > To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> > "unsubscribe
>> > csound"
>> >
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>
> ________________________________
> Rediscover HotmailĀ®: Get e-mail storage that grows with you. Check it out.
Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"=
|