|
Re: NRT option?: msg#00147audio.supercollider.devel
When you mentioned using a script, it occurred to me that this is something that could possibly be done with Score. Would something like this work as a change to Score.recordNRT? <x-tad-smaller> recordNRT { </x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> oscFilePath, outputFilePath, inputFilePath, sampleRate = 44100, headerFormat = </x-tad-smaller><x-tad-smaller>"AIFF"</x-tad-smaller><x-tad-smaller>, sampleFormat = </x-tad-smaller><x-tad-smaller>"int16"</x-tad-smaller><x-tad-smaller>, options, completionString=</x-tad-smaller><x-tad-smaller>""</x-tad-smaller><x-tad-smaller>, duration = </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>; </x-tad-smaller><x-tad-smaller>this</x-tad-smaller><x-tad-smaller>.class.recordNRT( score, oscFilePath, outputFilePath, inputFilePath, sampleRate, headerFormat, sampleFormat, options, completionString, duration ); } *recordNRT { </x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> list, oscFilePath, outputFilePath, inputFilePath, sampleRate = 44100, headerFormat = </x-tad-smaller><x-tad-smaller>"AIFF"</x-tad-smaller><x-tad-smaller>, sampleFormat = </x-tad-smaller><x-tad-smaller>"int16"</x-tad-smaller><x-tad-smaller>, options, completionString=</x-tad-smaller><x-tad-smaller>""</x-tad-smaller><x-tad-smaller>, duration = </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>; var finallist; if(duration.notNil, {finallist = Array.new; list.do{|i| if(i[0] <= duration, { finallist = finallist.add(i)})}; finallist.sort({arg a, b; a[0] < b[0]}); finallist = finallist.add([duration, [\c_set, 0, 0]])}, {finallist = list}); </x-tad-smaller><x-tad-smaller>this</x-tad-smaller><x-tad-smaller>.write(finallist, oscFilePath); unixCmd(program + </x-tad-smaller><x-tad-smaller>" -N"</x-tad-smaller><x-tad-smaller> + oscFilePath + (inputFilePath ? </x-tad-smaller><x-tad-smaller>"_"</x-tad-smaller><x-tad-smaller>) + outputFilePath + sampleRate + headerFormat + sampleFormat + (options ?? {</x-tad-smaller><x-tad-smaller>ServerOptions</x-tad-smaller><x-tad-smaller>.new}).asOptionsString + completionString); } With the added duration argument, this works: y = </x-tad-smaller><x-tad-smaller>Score</x-tad-smaller><x-tad-smaller>.new([ [0, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [1, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [2, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [3, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [4, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [5, [</x-tad-smaller><x-tad-smaller>\s_new</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>\default</x-tad-smaller><x-tad-smaller>, -1, 0, 0]], [6, [</x-tad-smaller><x-tad-smaller>\c_set</x-tad-smaller><x-tad-smaller>, 0, 0]] ]) o = </x-tad-smaller><x-tad-smaller>ServerOptions</x-tad-smaller><x-tad-smaller>.new.numOutputBusChannels = 1; </x-tad-smaller><x-tad-smaller>// mono output</x-tad-smaller><x-tad-smaller> </x-tad-smaller><x-tad-smaller>// will only write 3 sceconds worth </x-tad-smaller><x-tad-smaller> y.recordNRT(</x-tad-smaller><x-tad-smaller>"/tmp/trashme.osc"</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>"test.aif"</x-tad-smaller><x-tad-smaller>, options: o, duration: 3) </x-tad-smaller><x-tad-smaller>// retains the score</x-tad-smaller><x-tad-smaller> y.score </x-tad-smaller><x-tad-smaller>// records everything</x-tad-smaller><x-tad-smaller> y.recordNRT(</x-tad-smaller><x-tad-smaller>"/tmp/trashme.osc"</x-tad-smaller><x-tad-smaller>, </x-tad-smaller><x-tad-smaller>"test.aif"</x-tad-smaller><x-tad-smaller>, options: o) </x-tad-smaller> If this makes sense to everyone, could someone please commit it? I could also update the Score helpfile if this works. Thanks James for pointing me in a different direction, Josh On Aug 17, 2004, at 5:11 PM, James McCartney wrote: On Aug 17, 2004, at 2:41 PM, Joshua Parmenter wrote:****************************************** Joshua D. Parmenter Graduate Student, Music Composition "...Some people think a composer's supposed to please them, but in a way a composer is a chronicler... He's supposed to report on what he's seen and lived." -Charles Mingus _______________________________________________ sc-dev mailing list sc-dev-Ayv8T2snMLBt9CRQqspbbg@xxxxxxxxxxxxxxxx http://www.create.ucsb.edu/mailman/listinfo/sc-dev |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: NRT option?: 00147, James McCartney |
|---|---|
| Next by Date: | Julian: "corrected sustain which was not put back in the environment": 00147, James McCartney |
| Previous by Thread: | Re: NRT option?i: 00147, James McCartney |
| Next by Thread: | Re: NRT options Part II: 00147, Joshua Parmenter |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |