Administrateur

  • Profile picture of echeveste
  • Profile picture of Jean-Louis Giavitto
  • Profile picture of Philippe Cuvillier
  • Profile picture of arshiacont

Antescofo

Groupe Public active 2 days et 7 hours ago

The user group for Antescofo.

Simple example of oscrecv

Taggé: 

Auteur 1 Utilisateurs souscrits |
Profile photo of TradDog
TradDog

Hi,

I have been spending some time trying to have the “oscrecv and whenever” mechanism to work.
Probably a simple detail that escapes me.
Here is the minimalistic script I try to run:
————– test.asco.txt ———–


whenever ( $addrclient == $addrclient){
   print "Address client set to: " $addrclient
}
oscrecv oscin_addr 55667 "/init/addr" $addrclient

————————————-

A bare patch to test this score:
– has a print label [receive print]-[print]
– sends a message to load the score
– sends a message to start the follower

I use the simple python script to test:


import argparse
import time

from pythonosc import osc_message_builder
from pythonosc import udp_client

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("--ip", default="127.0.0.1",
                        help="The ip of the OSC server")
    parser.add_argument("--port", type=int, default=55667,
                        help="The port the OSC server is listening on")
    args = parser.parse_args()

    
    client = udp_client.SimpleUDPClient(args.ip, args.port)
    for x in range(10):
        oscroute = "/init/addr"
        print("Sending: ", oscroute + " 127.0.0."+x.__str__())
        client.send_message(oscroute, "127.0.0."+x.__str__())
        time.sleep(1)

with no avail.

When I test with the PD message:
[setvar $addrclient 128.0.0.1<
I get the correct display in the console:
Address client set to: 128.0.0.1

Any insight would be welcome.

Best

Trad

Juillet 18, 2017 à 09:11 #23081

Vous devez être connecté pour répondre à ce sujet.

Log in now