Keeping Csound open in Python without grabbing an audio device?
Date | 2015-04-28 12:41 |
From | Chuckk Hubbard |
Subject | Keeping Csound open in Python without grabbing an audio device? |
Attachments | None None |
Hello. I'm once again trying to
make Csound work somehow calling Python callables from within the Python
csnd6 module. I'm using Python 2.7.8 and Csound 6.04 with doubles on
Windows 7.If I use portaudio and name an output being used by Cubase, I get: *** PortAudio: error: -9985: Device unavailable closing device Failed to initialise real time audio output Fatal Python error: (pygame parachute) Segmentation Fault This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. ...................................... Can anyone offer any suggestions? Here is the script I'm trying:#!/usr/bin/env python import csnd6 import pygame.midi as md player = csnd6.CppSound() md.init() player.mout = md.Output(6) def midisendon(n, b, v, c): inn = int(n) fb = float(b) iv = int(v) ic = int(c) player.mout.note_on(inn, iv, ic) def midisendoff(n, b, v, c): inn = int(n) fb = float(b) iv = int(v) ic = int(c) player.mout.note_off(inn, iv, ic) orc = ''' sr = 44100 ksmps = 16 nchnls = 2 pyinit instr MIDIon inn = p4 ivel = p5 ichn = p6 pycalli "midisendon", inn, 0, ivel, ichn endin instr MIDIoff inn = p4 ivel = p5 ichn = p6 pycalli "midisendoff", inn, 0, ivel, ichn endin ''' sco = ''' f0 10 i "MIDIon" 0 .2 69 110 2 i "MIDIoff" 2 .2 60 0 2 ''' player.SetOption("-m0d") # Using SetOption() to configure Csound player.SetOption("-+rtaudio=portaudio") player.SetOption("-odac0") player.CompileOrc(orc) player.ReadScore(sco) player.Start() while (player.PerformKsmps() == 0): pass player.Perform() #player.Stop() del player.mout |
Date | 2015-04-29 21:55 |
From | Oeyvind Brandtsegg |
Subject | Re: Keeping Csound open in Python without grabbing an audio device? |
Hi Chuckk, Perhaps you could try using ASIO4ALL to allow several programs to share the audio device? Jack could also be an alternative. Or you could use Rearoute (Reaper) or another virtual sound card as your "dummy" device. There might be some sourcery that I am unaware of, but I *think* you will need an audio device connected to allow correct timing for Csound running in realtime. Oeyvind 2015-04-28 13:41 GMT+02:00 Chuckk Hubbard |
Date | 2015-05-04 13:08 |
From | Chuckk Hubbard |
Subject | Re: Keeping Csound open in Python without grabbing an audio device? |
Attachments | None None |
OK, thanks, Oeyvind. I downloaded and tried a virtual cable program and it's working for the time being as a dummy output. I'm curious about ASIO4ALL. I haven't yet seen it showing up as a Csound output, though I have it installed. I'll take a look now. -Chuckk On Wed, Apr 29, 2015 at 11:55 PM, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote: Hi Chuckk, |