logo       

Re: n_map "freq" -1: msg#00257

audio.supercollider.devel

Subject: Re: n_map "freq" -1

On Aug 25, 2004, at 11:38 AM, Julian Rohrhuber wrote:

if I set consecutive controls by giving a name and then a number, my only intention could reasonably be to set the consecutive _unnamed_ controls.
Setting other named controls that follow after these is not really what a message like /n_mapn "freq" 0 5 expresses.

Yes it IS what that expresses. That was what it was meant to express originally.
If I want to map \gate, \freq, \amp, \pan on consecutive buses, then I can do

\n_mapn, id, \gate, bus, 4

as long as these are the same rate controls.

sorry to be so persistent.

\n_mapn, id, \gate, bus, 4

does not really express very well the mapping of the four controls \gate, \freq, \amp, \pan.

it is practical, but not expressive. Do you always remember the order of args in a synthdef?
or regarding to the parallelism to argument passing:
as soon as using keywords, all other args have to be keywords, too.


ok, I see now. a ParamSpec only keeps its own index, and I guess it would need some other methods to make a node iterate over its controls, finding whether a name exists for it. It would mean a different osc message.
It would be very handy, but I don't know if it is reasonable.

something like this:

void Graph_MapNControl(Graph* inGraph, int32 inHash, int32 *inName, uint32 inNumChannels, uint32 inBus)
{
ParamSpecTable* table = GRAPH_PARAM_TABLE(inGraph);
ParamSpec *spec = table->Get(inHash, inName);
if (spec) {
uint32 index;
Graph_MapControl(inGraph, spec->mIndex, inBus);
for (uint i=1; i<inNumChannels-1; ++i) {
index = inBus + i;
int32 j = table->IndexFor(inHash, index);
*spec = table->mItems[j];
if(*spec->mName >= 0x80000000) return // stop at next named control
Graph_MapControl(inGraph, spec->mIndex, inBus + i);
};
}
}
(this code is not correct, because I don't know how to derive a key from a value in the HashTable)

the command could be called n_mapnc (clip) maybe.
But please tell me if it is a bad idea, I appreciate that the server should be kept simple.
--








.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise