logo       

Re: NRT options Part II: msg#00173

audio.supercollider.devel

Subject: Re: NRT options Part II

Once again, sorry to be a bother about this, but could somebody please commit the changes to Score unless any other problems are seen? The changes are below, and a Score.sc file is attached.

Thanks,

Josh

Changes:

<x-tad-smaller> section {</x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> start = 0.0, end = </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>, configevents = </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.section(score, start, end, configevents);
}


*section {</x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> list, start = 0, end = </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>, configevents = </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>;
</x-tad-smaller><x-tad-smaller>var</x-tad-smaller><x-tad-smaller> sectionlist;
end.isNil.if{end = list[list.size - 1][0]};
sectionlist = </x-tad-smaller><x-tad-smaller>Array</x-tad-smaller><x-tad-smaller>.new;
list.do { </x-tad-smaller><x-tad-smaller>arg</x-tad-smaller><x-tad-smaller> item;
if(item[0].inclusivelyBetween(start, end)) {
item = item.copy;
item[0] = item[0] - start;
sectionlist = sectionlist.add(item);
}
};
sectionlist = sectionlist.add([end - start, [</x-tad-smaller><x-tad-smaller>\c_set</x-tad-smaller><x-tad-smaller>, 0, 0]]);
if(configevents.notNil,
{if(configevents.isArray,
{if(configevents[0] == 0.0,
{sectionlist = sectionlist.addFirst(configevents)},
{</x-tad-smaller><x-tad-smaller>"Configuration events should have a timestamp of 0.0"</x-tad-smaller><x-tad-smaller>.warn; ^</x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>})},
{</x-tad-smaller><x-tad-smaller>"Configuration events need to be a bundle array: [time, [events]]"</x-tad-smaller><x-tad-smaller>.warn;
^</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>.new(sectionlist);
}


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>;
if(duration.notNil, {list = </x-tad-smaller><x-tad-smaller>this</x-tad-smaller><x-tad-smaller>.section(list, 0, duration, </x-tad-smaller><x-tad-smaller>nil</x-tad-smaller><x-tad-smaller>).score});
</x-tad-smaller><x-tad-smaller>this</x-tad-smaller><x-tad-smaller>.write(list, 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);
}
</x-tad-smaller>

Attachment: Score.sc
Description: Binary data


On Aug 19, 2004, at 7:34 PM, Joshua Parmenter wrote:

Hi Julian,

Thanks. .copy still confuses me a bit, but I think I understand a bit better after your example. Attached is a copy of Score.sc with the changes below.

Josh
<Score.sc>
On Aug 19, 2004, at 1:57 PM, Julian Rohrhuber wrote:

sectionlist = Array.new;
list.do { arg item;
if(item[0].inclusivelyBetween(start, end)) {
item = item.copy;
item[0] = item[0] - start;
sectionlist = sectionlist.add(item);
}
};
******************************************
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

******************************************
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