[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] python->OSC->scsynth



altern2 was right, thanks,  there were problems with the jackd start and connections.
With this code I have fixed:
 
[code]
 
import osc

import subprocess

import time

import os, sys

import random

path = os.path.dirname(sys.argv[0])

pathname = os.path.abspath(path)

subprocess.Popen("sudo jackd -R -dalsa -dhw:0 -r44100 -p256 -S", shell=True)

time.sleep(2)

subprocess.Popen("sudo scsynth -u 57110", shell=True)

time.sleep(5)

subprocess.Popen("sudo jack_connect SuperCollider:out_1 system:playback_1", shell=True)

subprocess.Popen("sudo jack_connect SuperCollider:out_2 system:playback_2", shell=True)

time.sleep(2)

osc.init()

osc.sendMsg("/d_load", ["sinecdote.scsyndef"], "127.0.0.1", 57110)

osc.sendMsg("/s_new", ["sinecdote", "1000"], "127.0.0.1", 57110)

time.sleep(1)

for i in range(10):

time.sleep(1)

rate = random.uniform(100.0, 400.0)

print i,":",rate

osc.sendMsg("/n_set", ["1000", "freq", "%s" %(rate)], "127.0.0.1", 57110)

time.sleep(5)

osc.sendMsg("/quit", [], "127.0.0.1", 57110)

subprocess.Popen("sudo killall jackd", shell=True)

[\end code]

 
but I get the following message:
 
FAILURE /s_new duplicate node ID
 
i tried to refer synthdef in the supercollider directory and in the code directory but no as effect.


2009/5/2, altern <altern2@xxxxxxxxx>:
make sure the scsynth process gets started properly and the paths you are passing are fine. Also make sure that scsynth gets properly connected via jack to the sound output. In my machines i need to manually connect scsynth to the output in qjackctl

i would try to use the sc library
http://www.ixi-software.net/content/download/sc/sc-0.2.zip
it wraps a couple of libraries (scosc, scsynth) developed by a guy in alaska that deal with the osc communication to scsynth in a more specific way that the SimpleSC library you are using, which is a general OSC library. It allows to receive back from supercollider messages, this should help you debugging, because you get more clues on whats is going on in the server.

you can use the sc module or directly the scosc and scsynth modules. SC wraps the other libraries so it depends on your needs.

miquel parera(e)k dio:

Hello;
 I try to make a simple test for control scsynth from supercollider, but i hear nothing:
 [code]
 [Supercollider SynthDef:]
 
(

SynthDef("sinecdote", { arg freq= 440;

Out.ar(0, SinOsc.ar(freq))

}).store

)

[Python code:]

import osc

import subprocess

import time

import os, sys

import random

path = os.path.dirname(sys.argv[0])

pathname = os.path.abspath(path)

subprocess.Popen("scsynth -u 57110", shell=True)

time.sleep(1)

osc.init()

osc.sendMsg("/d_load", ["%s/synthdefs/sinecdote.scsyndef" %(pathname)], "127.0.0.1", 57110)

osc.sendMsg("/s_new", ["sinecdote","1000"], "127.0.0.1", 57110)

osc.sendMsg("/n_run", ["1000", "1"], "127.0.0.1", 57110)

time.sleep(1)

for i in range(10):

    time.sleep(1)

    rate = random.uniform(100.0, 400.0)

    print i,":",rate

    osc.sendMsg("/n_set", ["1000", "freq", "%s" %(rate)], "127.0.0.1", 57110)

time.sleep(5)

osc.sendMsg("/quit", [], "127.0.0.1", 57110)

[\end code]

I work in a linux machine with sudo permissions, where is the problem?

Thanks...

 
 
 


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/