[Sc-devel] SendFloatArray from Server to Lang
Dan Stowell
danstowell at gmail.com
Mon Nov 5 11:40:15 PST 2007
I'd be in favour of this for 3.2, yes.
Have you planned the format of the OSC messages? Just like SendTrig's
messages but of variable length? i.e. sending [9.9, 6.2, 3.3] comes
across like [ /tr, nodeid, someinteger, 9.9, 6.2, 3.3 ]?
Dan
P.S. The gmail thing is a *feature* ;)
2007/11/4, Click Nilson <clicksonnil at gmail.com>:
> Dear all,
>
> I'm not suggesting the below for any 3.1.1 this week, but I am
> starting discussion re: 3.2. This is something that has come up in
> exploring potential machine listening capabilities.
>
> I've been looking into how difficult it is to add the capability to
> the server to send back an array of floats. This would be really
> useful for UGens that extract features which can then play a role in
> compositional decisions language side; ie, find the top N peaks in
> the spectrum, find N timbral features, polyphonic pitch detection,
> extract first N MFCCs etc. I'd really like to be able to send an
> arbitrary number of floats (well, up to packet size allowance) from a
> plugin as an OSC message.
>
> I draft a solution below; I think I know how to implement this. The
> possible gotcha is that dynamically loaded plugins can't pass an
> array of floats via a pointer to the server, because the address
> space is not shared. But I'm hoping that's not actually an issue?
>
> Any comments? Can I go ahead once 3.1.1 is settled?
>
> Nick
>
>
> Draft of additions required:
>
> SC_Node.cpp
> void Node_SendFloatArray(Node* inNode, int arrayID, int size, float*
> values)
>
> SC_World.cpp
> void FloatArrayMsg::Perform()
>
> ft->fSendFloatArray = &Node_SendFloatArray;
>
> SC_Prototypes.h
> void Node_SendFloatArray(Node* inNode, int arrayID, int size, float*
> values);
>
> SC_HiddenWorld.h
> struct FloatArrayMsg {
> World *mWorld;
> int32 mNodeID;
> int32 mArrayID;
> float* mValues;
> int32 size;
>
> void Perform();
> };
>
> typedef MsgFifoNoFree<FloatArrayMsg, 1024> FloatArrayFifo;
>
> And an addition of one more step to:
> SC_CoreAudio.cpp
> SC_AudioDriver::RunThread()
> Shouldn't impact performance in any substantial way.
>
>
>
>
> _______________________________________________
> Sc-devel mailing list
> Sc-devel at create.ucsb.edu
> http://www.create.ucsb.edu/mailman/listinfo/sc-devel
>
--
http://www.mcld.co.uk
More information about the Sc-devel
mailing list