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

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



miquel parera(e)k dio:
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.

did you get this to work? i remember that i had problems with the range of numbers i asigned to the nodes. I just checked one of my examples and i used a number 1967 for the synthdef nodes, but then i used 1000 for sample b_allocRead. I paste my example below, there was a thread about this on the list, a couple of years ago maybe? I am using sc, scsynth and scosc modules.


import sc, time, os

sc.start(verbose=1)

time.sleep(3) # wait while sound plays

s = sc.sc.server ###################

s.sendMsg('/d_load', os.path.join(os.getcwd(),'synthdefs','StereoPlayer.scsyndef'));

time.sleep(1)

# no data at buffer index 500 -- silent synth
s.sendMsg("/s_new", "StereoPlayer", 1967)

time.sleep(1)

s.sendMsg('/b_allocRead', 1000, os.path.join(os.getcwd(),'sounds','numeros.wav'), 0, -1);

time.sleep(1)

# but here, of course
s.sendMsg("/n_set", 1967, "bufnum", 1000);
s.sendMsg("/n_set", 1967, "pos", 0.1);


s.sendMsg('/d_load', os.path.join(os.getcwd(),'synthdefs','sine.scsyndef'));

time.sleep(1)

s.sendMsg("/s_new", "sine", 1968);

time.sleep(3)

s.sendMsg("/quit")

_______________________________________________
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/