[CM] How to send udp bundles from Grace on Linux?

Forrest Curo treegestalt at gmail.com
Sat Mar 7 20:41:06 PST 2020


In the source file OpenSoundControl.cpp
"sender.send" appears three times.
*In this function, it's working:*

void OpenSoundControl::testOutput() {
  if (!getOutputPort()) return;
  juce::String test = "OSC output test " ;
  float f = (juce::Random::getSystemRandom().nextFloat() * 100.0);
  if (sender.send ("/Grace", (float) f))
    std::cout << "OSC send test succeeded!\n";
  else
    std::cout << "OSC send test failed!\n";
}
*In these other two instances, it isn't working:*
// This should only be called by scheme thread.
bool OpenSoundControl::sendMessage(juce::String path, s7_pointer
schemeMessage)
{
  juce::ScopedLock lock (oscLock);
  if (outputPort == 0)
    return false;
  if (juce::OSCMessage* message = parseMessage(schemeMessage, path))
  {
    bool success = sender.send(*message);
    delete message;
    return success;
  }
  else
    return false;
}

// This should only be called by scheme thread.
bool OpenSoundControl::sendBundle(double time, s7_pointer schemeBundle)
{
  juce::ScopedLock lock (oscLock);
  if (outputPort == 0)
    return false;
  if (juce::OSCBundle* bundle = parseBundle(schemeBundle, time))
  {
    bool success = sender.send(*bundle);
    delete bundle;
    return success;
  }
  else
    return false;
}
=========
What's the difference? Are ' *message' and ' *bundle' missing their
payloads while '(float) f' here directly sends a random float.

?

On Sat, Mar 7, 2020 at 5:34 PM Forrest Curo <treegestalt at gmail.com> wrote:

> Clarifications...
>
> Pure Data -> Grace works fine.
> Grace -> operating system, also Grace  -> Pure Data work <==> sending
> Grace's "Test Output".
>
> If I try:
>
> osc:message("/Grace", :b, {0 2 4 6 8})
>
> or
> osc:message( {"/Grace" 123 456.789 } )
>
>
> there are no error messages, but neither Pure Data nor Bash nc receive anything.
>
>
> On Sat, Mar 7, 2020 at 11:23 AM Orm Finnendahl <
> orm.finnendahl at selma.hfmdk-frankfurt.de> wrote:
>
>> Hi,
>>
>>  for pd I would strongly advise not to use these old third party
>> externals, as pd has builtin support for osc since version 0.46.
>>
>> Especially for testing it probably is much easier to understand what
>> is going on by just plugging directly into the netsend/netreceive
>> objects.
>>
>> For receiving:
>>
>> netreceive -b -u 8888
>> |
>> |
>> oscparse
>> |
>> |
>> print
>>
>> or even connect a print object directly to the netreceive output.
>>
>> For sending from pd:
>>
>> |disconnect, connect localhost 7779(
>> |
>> |
>> netsend -b -u
>>
>> And then use oscformat for formatting osc messages (check the help
>> docs for examples, it's pretty straightforward).
>>
>> --
>> Orm
>>
>> Am Samstag, den 07. März 2020 um 10:59:39 Uhr (-0800) schrieb Forrest
>> Curo:
>> > Interestingly, Grace can receive udp from Pure Data -- but again, Pure
>> Data
>> > won't receive from Grace
>> >
>> > except via the console menu: Audio, Osc out: port 8888, Test Output --
>> This
>> > works!
>> >
>> > When I attempt to format an osc message in Sal
>> > I either get an error (even using Grace's example messages)
>> > or the message goes but is not received by Pure Data.
>> > How is the 'Test Output' message formatted?
>> > ?
>> > ================
>> > from pd:
>> > |connect localhost 7779(
>> > |            [sendtyped / iii 4 5 6 (
>> > |          /
>> > |        [osc/packOSC]
>> > |      /
>> > [iemnet/udpsend]
>> >
>> > receiving (but only from 'Test Output'):
>> > >
>> >
>> > [udpreceive 8888]
>> > |
>> > [print incoming]
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> > On Fri, Mar 6, 2020 at 11:21 PM Tito Latini <tito.01beta at gmail.com>
>> wrote:
>> >
>> > > I forgot... it works with or without daemon-mode here.
>> > > Tested with a recent version.
>> > >
>>
>> > _______________________________________________
>> > Cmdist mailing list
>> > Cmdist at ccrma.stanford.edu
>> > https://cm-mail.stanford.edu/mailman/listinfo/cmdist
>>
>>
>> _______________________________________________
>> Cmdist mailing list
>> Cmdist at ccrma.stanford.edu
>> https://cm-mail.stanford.edu/mailman/listinfo/cmdist
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cm-mail.stanford.edu/mailman/private/cmdist/attachments/20200307/036b3520/attachment-0001.html>


More information about the Cmdist mailing list