GithubHelp home page GithubHelp logo

Comments (4)

lisongx avatar lisongx commented on May 24, 2024 1

@telephon
I've figure a kind of a dirty way to achive this

      if (msg[0].asString=="/d_recv", {
        msg[1].size.postln;
        msg[1].postln;
        h = File("~/test.scsynthdef".absolutePath, "wb");
        h.write(msg[1]);
        h.close();
        SynthDescLib.global.read("~/test.scsynthdef".absolutePath);
      });

write to a file and then use SynthDescLib

I'll close the issue then. Thanks so much Julian!

from superdirt.

telephon avatar telephon commented on May 24, 2024

You are welcome!

Your analysis is correct: you need to register the SynthDef in the SynthDescLib (what normally happens when you call add).

A good solution is to use the Utopia network music library (https://github.com/muellmusik/Utopia):

Quarks.install("Utopia");

The documentation is still mostly absent. You could try the following setup (on both computers):

(
~win = Window("We share everything").front;
~win.layout = VLayout.new.add(~listView = ListView.new);

~addrBook = AddrBook.new;

// to get updates, just add a dependant
~addrBook.addDependant({|addrBook, what, who|
	{~listView.items = addrBook.peers.collectAs({|peer|
		peer.name ++ " | " ++ peer.addr.ip ++ " | " ++ if(peer.online, "online", "offline");
	}, Array)}.defer;
});

~addrBook.addMe; // will automatically add you using your user name
//~addrBook.addMe(\myNameOrWhatever); // or specify one

~hail = Hail(~addrBook);
~srelay = SynthDescRelay(~addrBook);
);

If that doesn't work, you could also hack something much simpler. But the above will give you a lot of useful things.

from superdirt.

lisongx avatar lisongx commented on May 24, 2024

@telephon
Thanks so much for the great guide!

Actually we already some system orking here but kind of stuck at sharing synth, we have something like this client running on both of our sc

  OSCdef.newMatching(
    /d_recv,
    {|msg, time, addr, recvPort|
      msg.postln;
      s.listSendMsg(msg);
   })

and we just sync synth by Synth(\test, {}).doSend(~hub), where ~hub is a simple server that forward many osc here..

so for d_recv, we have this Int8Array of this synthdef we don't know how to add to the SynthDescLib

Not sure if I'm explain clear enough.

Will look at the Utopia source maybe that will help

from superdirt.

telephon avatar telephon commented on May 24, 2024

Yes, you can of course send the byte array to the scsynth, but your def is missing on the sclang side. There are many ways to send this info, but the best solution I think is in Utopia.

from superdirt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.