logo       

Re: NRT option?: msg#00147

audio.supercollider.devel

Subject: Re: NRT option?

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:

Often, when I am working on something in NRT, it is fairly large. If the piece I am working on is 100 seconds total, but am working on only the first 20 seconds, I either need to:

a) render out the entire 100 seconds each time to hear my changes.
b) alter the score by cutting out all events after 20 seconds and replacing them with the dummy command.

If I could tell scsynth to only render out the first 20, that would save time (since I wouldn't have to render out everything) or it would save me from having to manually delete items from a score.

Why do you have to do it manually? Use a script.
The score is an input just like a command line argument is an input. It should be little different to change one than another. Sounds like you just need a function to easily truncate a score.
Adding this parameter will not address being able to start at any point in a score, which would require some score manipulation anyway.

Obviously having a flag to do this would be convenient (though by no means necessary).

Thanks,

Josh

_______________________________________________
sc-dev mailing list
sc-dev-Ayv8T2snMLBt9CRQqspbbg@xxxxxxxxxxxxxxxx
http://www.create.ucsb.edu/mailman/listinfo/sc-dev

******************************************
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>
Google Custom Search

News | FAQ | advertise