multiple midi outs -Q / Csound API / Python
| Date | 2007-08-18 03:21 |
| From | Tim Mortimer |
| Subject | multiple midi outs -Q / Csound API / Python |
Greetings, I thought i glimpsed a thread on this topic recently, but was unable to find it. I'm wondering if its possible to use Csound API in python to enable targetting simultaneously different -Q flag targets? The garritan Standalone player allows housing simultaneous 8x 8-timbral instances of GPO's Kontakt player, but each player is on a separate -Q channel I wish to target -Q10, -Q11 & -Q12 simultaneously with 3 different Csound.csd files. no audio output is required at this stage. ( -odac99 rtaudio=null ) I'm thinking this is just the ticket for an initial Python hosts CsoundAPI project - if it's possible to do it? Can anyone point me in the right direction, or even show a simple example? Many thanks Tim P.S: My Python "meta scoring language" is pretty much functional to a useable stage (yippee!). So far it targets 90% of the Garritan instruments, but the Csound instrument targetting implementation could be based on a slightly simplified version of the same code with hopefully minimal effort. (& simultaneously forces a solution to many subjective csound related design issues by creating a standard to which many of my orc designs will now need to adhere...) - should also work pretty generically to control other midi instruments also What was abandoned several times & took months of effort in Max has taken me about .... maybe 60 hours total in Python? (including a couple of redesigns from the ground up, & also including the fact that it's my first ever programming project in any language other than csound. Talk about right tools for the job!) Many thanks to all that have offered help & assistance. of which thankfully i seem to be needing less & less.... I am very happy to be reaching what feels like an exciting milestone in my attempts to get serious with "computer music" - at least now if it sounds crap i know it's me, & I can stop blaming the tools... -- View this message in context: http://www.nabble.com/multiple-midi-outs--Q---Csound-API---Python-tf4288950.html#a12209893 Sent from the Csound - General mailing list archive at Nabble.com. |
| Date | 2007-08-19 07:52 |
| From | Tim Mortimer |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
well after recovering from my hangover this afternoon, here's my first
attempt at getting multiple -Q's out using csnd in Python
The code runs, but it still only transmits on -Q10
am I missing something? or do i yet again drag Max out of preliminary
retirement & execute using Davis Pyon's Csound~?
# begin python code
import csnd
csoundwinds = csnd.CppSound()
csoundstrings = csnd.CppSound()
csoundwinds.setPythonMessageCallback()
csoundstrings.setPythonMessageCallback()
csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
# generic orch to translate csound sco
# to midi events for Garritan standalone player
# using csnd to try & target different soundbanks
# on different -Q channels
# at present, the code executes fine
# but the targetting of separate -Q channels
# is not achieved
thisorch = '''
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1
opcode Pch2MIDIi, i,i
ipit xin
ioct = ((int(ipit))-3)*12
iint = (ipit%1)*100
imidi = ioct+iint
imidi = round(imidi)
xout imidi
endop
instr 01
xtratim .001
ipch = p4
ivel = p5
inotnum Pch2MIDIi ipch
print inotnum
noteondur p6, inotnum, ivel, p3
endin
instr 02
kline init p5
;;; ***********************
;;; line needs temposcaling
icc = p4
kline line p5,p6,p7
midiout 176, p8, icc, kline
endin
instr 03 ;;;PITCHBEND
kline init p4
;;; ***********************
;;; line needs temposcaling
kline line p4,p5,p6
midiout 224, p7, 0, kline
endin
'''
csoundwinds.setOrchestra(thisorch)
csoundstrings.setOrchestra(thisorch)
csoundwinds.setScore('''
t 0 60
i 1 0.000 0.472 7.03 51 7
i 2 0.000 0.471 1 51 0.471 0 7
i 1 0.497 6.223 9.10 50 1
i 2 0.497 6.222 1 51 6.222 1 1
i 1 0.498 6.203 7.07 50 4
i 2 0.498 6.202 1 48 6.202 1 4
i 1 0.502 6.223 7.03 48 7
i 2 0.502 6.222 1 50 6.222 0 7
i 1 6.750 1.968 9.10 48 1
i 2 6.750 0.002 1 49 0.002 49 1
i 1 8.748 2.967 9.09 48 1
i 2 8.748 2.966 1 60 2.966 1 1
i 1 6.731 5.000 7.06 50 4
i 2 6.731 4.999 1 48 4.999 0 4
i 1 6.755 4.976 7.03 50 7
i 2 6.755 4.975 1 51 4.975 0 7
i 1 11.745 1.978 9.11 51 1
i 2 11.745 0.002 1 51 0.002 51 1
i 1 13.753 0.959 10.05 50 1
i 2 13.753 0.958 1 58 0.958 1 1
i 1 11.761 2.975 7.06 48 4
i 2 11.761 2.974 1 50 2.974 0 4
i 1 11.761 2.951 7.03 50 7
i 2 11.761 2.950 1 51 2.950 1 7
i 1 14.742 2.248 10.05 50 1
i 2 14.742 0.002 1 48 0.002 48 1
i 1 17.020 2.690 9.09 49 1
i 2 17.020 2.689 1 51 2.689 0 1
i 1 14.766 4.951 7.06 51 4
i 2 14.766 4.950 1 50 4.950 0 4
i 1 14.742 4.970 7.03 50 7
i 2 14.742 4.969 1 49 4.969 0 7
i 1 19.740 1.215 9.09 48 1
i 2 19.740 0.002 1 48 0.002 48 1
i 1 20.985 1.491 9.10 51 1
i 2 20.985 1.490 1 50 1.490 1 1
i 1 19.747 2.710 7.06 49 4
i 2 19.747 2.709 1 48 2.709 0 4
i 1 22.506 1.075 9.10 49 1
i 2 22.506 0.002 1 51 0.002 51 1
i 1 23.611 0.859 10.00 51 1
i 2 23.611 0.858 1 51 0.858 0 1
i 1 22.487 1.983 7.06 51 4
i 2 22.487 1.982 1 51 1.982 0 4
''')
csoundstrings.setScore('''
t 0 60
i 1 0.000 0.002 6.01 100 3
i 1 0.000 0.002 6.01 100 4
i 1 0.000 0.002 6.01 100 5
i 1 0.000 0.002 6.01 100 6
i 1 0.000 0.470 9.02 51 4
i 2 0.000 0.002 1 51 0.002 51 4
i 1 0.000 0.458 6.03 48 6
i 2 0.000 0.457 1 49 0.457 0 6
i 1 0.504 6.209 8.10 49 3
i 2 0.504 6.208 1 51 6.208 0 3
i 1 0.488 6.227 6.03 49 6
i 2 0.488 6.226 1 50 6.226 1 6
i 1 6.743 1.975 8.10 51 3
i 2 6.743 0.050 1 0 0.050 50 3
i 1 8.748 2.971 8.09 50 3
i 2 8.748 2.970 1 59 2.970 0 3
i 1 6.758 4.971 9.02 49 4
i 2 6.758 0.002 1 48 0.002 48 4
i 1 6.745 4.980 6.03 50 6
i 2 6.745 4.979 1 50 4.979 0 6
i 1 11.749 1.965 8.11 51 3
i 2 11.749 0.002 1 49 0.002 49 3
i 1 13.744 0.951 9.05 51 3
i 2 13.744 0.950 1 59 0.950 0 3
i 1 11.759 2.974 9.02 50 4
i 2 11.759 2.973 1 51 2.973 1 4
i 1 11.755 2.973 6.03 51 6
i 2 11.755 2.972 1 48 2.972 0 6
i 1 14.725 2.256 9.05 48 3
i 2 14.725 0.002 1 49 0.002 49 3
i 1 17.011 2.680 8.09 50 3
i 2 17.011 2.679 1 50 2.679 1 3
i 1 14.763 4.915 9.02 50 4
i 2 14.763 0.050 1 1 0.050 51 4
i 2 14.813 4.864 1 51 4.864 0 4
i 1 14.758 4.970 6.03 50 6
i 2 14.758 4.969 1 48 4.969 0 6
i 1 19.771 1.195 8.09 51 3
i 2 19.771 0.040 1 1 0.040 49 3
i 1 20.996 1.472 8.10 50 3
i 2 20.996 1.471 1 51 1.471 0 3
i 1 19.758 2.712 9.02 48 4
i 2 19.758 0.002 1 51 0.002 51 4
i 1 22.498 1.097 8.10 48 3
i 2 22.498 0.050 1 0 0.050 51 3
i 1 23.625 0.845 9.00 49 3
i 2 23.625 0.844 1 51 0.844 1 3
i 1 22.500 1.970 9.02 49 4
i 2 22.500 0.002 1 50 0.002 50 4
''')
csoundwinds.exportForPerformance()
csoundstrings.exportForPerformance()
csoundwinds.perform()
csoundstrings.perform()
--
View this message in context: http://www.nabble.com/multiple-midi-outs--Q---Csound-API---Python-tf4288950.html#a12219867
Sent from the Csound - General mailing list archive at Nabble.com. |
| Date | 2007-08-21 01:28 |
| From | Tim Mortimer |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
Ok, so i went & set it up using Csound~ in Max instead, but I'm still very
keen to know how to set up multiple calls to csnd.CppSound() & to get
multiple MIDI outputs working as a result. Or, OTOH, to know that it's not
possible for some reason
Michael G? Oeyvind? Anyone?
Ignoring my posts does seem to be the fashion of late. Many times i can
understand why, & often i go on to sort out the issue myself.
On this occasion however, i'd appreciate some advice. Particularly as there
is no documentation for the Csnd API (if i'm not mistaken?)
Do i need to have separate threads or something?
Tim Mortimer wrote:
>
> well after recovering from my hangover this afternoon, here's my first
> attempt at getting multiple -Q's out using csnd in Python
>
> The code runs, but it still only transmits on -Q10
>
> am I missing something? or do i yet again drag Max out of preliminary
> retirement & execute using Davis Pyon's Csound~?
>
> # begin python code
>
> import csnd
>
>
> csoundwinds = csnd.CppSound()
> csoundstrings = csnd.CppSound()
>
> csoundwinds.setPythonMessageCallback()
> csoundstrings.setPythonMessageCallback()
>
> csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
> csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
>
> # generic orch to translate csound sco
> # to midi events for Garritan standalone player
> # using csnd to try & target different soundbanks
> # on different -Q channels
> # at present, the code executes fine
> # but the targetting of separate -Q channels
> # is not achieved
>
>
> thisorch = '''
>
> sr = 48000
> ksmps = 64
> nchnls = 2
>
> 0dbfs = 1
>
> opcode Pch2MIDIi, i,i
>
> ipit xin
>
> ioct = ((int(ipit))-3)*12
>
> iint = (ipit%1)*100
>
> imidi = ioct+iint
>
> imidi = round(imidi)
>
> xout imidi
>
> endop
>
> instr 01
>
> xtratim .001
>
> ipch = p4
>
> ivel = p5
>
> inotnum Pch2MIDIi ipch
>
> print inotnum
>
> noteondur p6, inotnum, ivel, p3
>
> endin
>
> instr 02
>
> kline init p5
> ;;; ***********************
> ;;; line needs temposcaling
>
> icc = p4
>
> kline line p5,p6,p7
>
> midiout 176, p8, icc, kline
>
> endin
>
> instr 03 ;;;PITCHBEND
>
> kline init p4
> ;;; ***********************
> ;;; line needs temposcaling
>
> kline line p4,p5,p6
>
> midiout 224, p7, 0, kline
>
> endin
>
> '''
>
> csoundwinds.setOrchestra(thisorch)
> csoundstrings.setOrchestra(thisorch)
>
>
> csoundwinds.setScore('''
>
> t 0 60
>
> i 1 0.000 0.472 7.03 51 7
> i 2 0.000 0.471 1 51 0.471 0 7
> i 1 0.497 6.223 9.10 50 1
> i 2 0.497 6.222 1 51 6.222 1 1
> i 1 0.498 6.203 7.07 50 4
> i 2 0.498 6.202 1 48 6.202 1 4
> i 1 0.502 6.223 7.03 48 7
> i 2 0.502 6.222 1 50 6.222 0 7
> i 1 6.750 1.968 9.10 48 1
> i 2 6.750 0.002 1 49 0.002 49 1
> i 1 8.748 2.967 9.09 48 1
> i 2 8.748 2.966 1 60 2.966 1 1
> i 1 6.731 5.000 7.06 50 4
> i 2 6.731 4.999 1 48 4.999 0 4
> i 1 6.755 4.976 7.03 50 7
> i 2 6.755 4.975 1 51 4.975 0 7
> i 1 11.745 1.978 9.11 51 1
> i 2 11.745 0.002 1 51 0.002 51 1
> i 1 13.753 0.959 10.05 50 1
> i 2 13.753 0.958 1 58 0.958 1 1
> i 1 11.761 2.975 7.06 48 4
> i 2 11.761 2.974 1 50 2.974 0 4
> i 1 11.761 2.951 7.03 50 7
> i 2 11.761 2.950 1 51 2.950 1 7
> i 1 14.742 2.248 10.05 50 1
> i 2 14.742 0.002 1 48 0.002 48 1
> i 1 17.020 2.690 9.09 49 1
> i 2 17.020 2.689 1 51 2.689 0 1
> i 1 14.766 4.951 7.06 51 4
> i 2 14.766 4.950 1 50 4.950 0 4
> i 1 14.742 4.970 7.03 50 7
> i 2 14.742 4.969 1 49 4.969 0 7
> i 1 19.740 1.215 9.09 48 1
> i 2 19.740 0.002 1 48 0.002 48 1
> i 1 20.985 1.491 9.10 51 1
> i 2 20.985 1.490 1 50 1.490 1 1
> i 1 19.747 2.710 7.06 49 4
> i 2 19.747 2.709 1 48 2.709 0 4
> i 1 22.506 1.075 9.10 49 1
> i 2 22.506 0.002 1 51 0.002 51 1
> i 1 23.611 0.859 10.00 51 1
> i 2 23.611 0.858 1 51 0.858 0 1
> i 1 22.487 1.983 7.06 51 4
> i 2 22.487 1.982 1 51 1.982 0 4
>
> ''')
>
> csoundstrings.setScore('''
>
> t 0 60
>
> i 1 0.000 0.002 6.01 100 3
> i 1 0.000 0.002 6.01 100 4
> i 1 0.000 0.002 6.01 100 5
> i 1 0.000 0.002 6.01 100 6
> i 1 0.000 0.470 9.02 51 4
> i 2 0.000 0.002 1 51 0.002 51 4
> i 1 0.000 0.458 6.03 48 6
> i 2 0.000 0.457 1 49 0.457 0 6
> i 1 0.504 6.209 8.10 49 3
> i 2 0.504 6.208 1 51 6.208 0 3
> i 1 0.488 6.227 6.03 49 6
> i 2 0.488 6.226 1 50 6.226 1 6
> i 1 6.743 1.975 8.10 51 3
> i 2 6.743 0.050 1 0 0.050 50 3
> i 1 8.748 2.971 8.09 50 3
> i 2 8.748 2.970 1 59 2.970 0 3
> i 1 6.758 4.971 9.02 49 4
> i 2 6.758 0.002 1 48 0.002 48 4
> i 1 6.745 4.980 6.03 50 6
> i 2 6.745 4.979 1 50 4.979 0 6
> i 1 11.749 1.965 8.11 51 3
> i 2 11.749 0.002 1 49 0.002 49 3
> i 1 13.744 0.951 9.05 51 3
> i 2 13.744 0.950 1 59 0.950 0 3
> i 1 11.759 2.974 9.02 50 4
> i 2 11.759 2.973 1 51 2.973 1 4
> i 1 11.755 2.973 6.03 51 6
> i 2 11.755 2.972 1 48 2.972 0 6
> i 1 14.725 2.256 9.05 48 3
> i 2 14.725 0.002 1 49 0.002 49 3
> i 1 17.011 2.680 8.09 50 3
> i 2 17.011 2.679 1 50 2.679 1 3
> i 1 14.763 4.915 9.02 50 4
> i 2 14.763 0.050 1 1 0.050 51 4
> i 2 14.813 4.864 1 51 4.864 0 4
> i 1 14.758 4.970 6.03 50 6
> i 2 14.758 4.969 1 48 4.969 0 6
> i 1 19.771 1.195 8.09 51 3
> i 2 19.771 0.040 1 1 0.040 49 3
> i 1 20.996 1.472 8.10 50 3
> i 2 20.996 1.471 1 51 1.471 0 3
> i 1 19.758 2.712 9.02 48 4
> i 2 19.758 0.002 1 51 0.002 51 4
> i 1 22.498 1.097 8.10 48 3
> i 2 22.498 0.050 1 0 0.050 51 3
> i 1 23.625 0.845 9.00 49 3
> i 2 23.625 0.844 1 51 0.844 1 3
> i 1 22.500 1.970 9.02 49 4
> i 2 22.500 0.002 1 50 0.002 50 4
>
> ''')
>
>
> csoundwinds.exportForPerformance()
> csoundstrings.exportForPerformance()
>
> csoundwinds.perform()
> csoundstrings.perform()
>
>
>
--
View this message in context: http://www.nabble.com/multiple-midi-outs--Q---Csound-API---Python-tf4288950.html#a12246352
Sent from the Csound - General mailing list archive at Nabble.com. |
| Date | 2007-08-26 05:13 |
| From | Tim Mortimer |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
Hello,
As i still have had no indication or further insight into if it is or is not
possible to do what I am attempting in the code below, I thought I may as
well post again in the hope that someone might actually be able to spare 60
seconds & provide an answer.
To clarify/ restate - i am attempting to use multiple calls to
csnd.CppSound() in Python to enable transmission of midi data to separate -Q
channels simultaneously
If it is not possible, a simple "no that is not possible" will suffice.
I happily accept that some of my more speculative threads may not merit
attention when everyone is busy (like myself) gazing deeply into their own
navels on various projects of their own, or imminent release / development
deadlines / the "real world".
However without pushing the belligerance angle too far, i sincerely believe
this query is deserving of an answer, if only due to it's overwhelmingly
specific focus, & extreme brevity of time investment for anyone capable of
actually giving a response.
with continued gratitude & thanks
Tim
Tim Mortimer wrote:
>
>
> The code runs, but it only transmits on -Q10
>
> am I missing something?
>
> import csnd
>
> csoundwinds = csnd.CppSound()
> csoundstrings = csnd.CppSound()
>
> csoundwinds.setPythonMessageCallback()
> csoundstrings.setPythonMessageCallback()
>
> csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
> csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
>
> # generic orch to translate csound sco
> # to midi events for Garritan standalone player
> # using csnd to try & target different soundbanks
> # on different -Q channels
> # at present, the code executes fine
> # but the targetting of separate -Q channels
> # is not achieved
>
>
> thisorch = '''
>
> sr = 48000
> ksmps = 64
> nchnls = 2
>
> 0dbfs = 1
>
> opcode Pch2MIDIi, i,i
>
> ipit xin
>
> ioct = ((int(ipit))-3)*12
>
> iint = (ipit%1)*100
>
> imidi = ioct+iint
>
> imidi = round(imidi)
>
> xout imidi
>
> endop
>
> instr 01
>
> xtratim .001
>
> ipch = p4
>
> ivel = p5
>
> inotnum Pch2MIDIi ipch
>
> print inotnum
>
> noteondur p6, inotnum, ivel, p3
>
> endin
>
> instr 02
>
> kline init p5
> ;;; ***********************
> ;;; line needs temposcaling
>
> icc = p4
>
> kline line p5,p6,p7
>
> midiout 176, p8, icc, kline
>
> endin
>
> instr 03 ;;;PITCHBEND
>
> kline init p4
> ;;; ***********************
> ;;; line needs temposcaling
>
> kline line p4,p5,p6
>
> midiout 224, p7, 0, kline
>
> endin
>
> '''
>
> csoundwinds.setOrchestra(thisorch)
> csoundstrings.setOrchestra(thisorch)
>
> csoundwinds.setScore('''
>
> t 0 60
>
> i 1 0.000 0.472 7.03 51 7
> i 2 0.000 0.471 1 51 0.471 0 7
> i 1 0.497 6.223 9.10 50 1
> i 2 0.497 6.222 1 51 6.222 1 1
> i 1 0.498 6.203 7.07 50 4
> i 2 0.498 6.202 1 48 6.202 1 4
> i 1 0.502 6.223 7.03 48 7
> i 2 0.502 6.222 1 50 6.222 0 7
> i 1 6.750 1.968 9.10 48 1
> i 2 6.750 0.002 1 49 0.002 49 1
> i 1 8.748 2.967 9.09 48 1
> i 2 8.748 2.966 1 60 2.966 1 1
> i 1 6.731 5.000 7.06 50 4
> i 2 6.731 4.999 1 48 4.999 0 4
> i 1 6.755 4.976 7.03 50 7
> i 2 6.755 4.975 1 51 4.975 0 7
> i 1 11.745 1.978 9.11 51 1
> i 2 11.745 0.002 1 51 0.002 51 1
> i 1 13.753 0.959 10.05 50 1
> i 2 13.753 0.958 1 58 0.958 1 1
> i 1 11.761 2.975 7.06 48 4
> i 2 11.761 2.974 1 50 2.974 0 4
> i 1 11.761 2.951 7.03 50 7
> i 2 11.761 2.950 1 51 2.950 1 7
> i 1 14.742 2.248 10.05 50 1
> i 2 14.742 0.002 1 48 0.002 48 1
> i 1 17.020 2.690 9.09 49 1
> i 2 17.020 2.689 1 51 2.689 0 1
> i 1 14.766 4.951 7.06 51 4
> i 2 14.766 4.950 1 50 4.950 0 4
> i 1 14.742 4.970 7.03 50 7
> i 2 14.742 4.969 1 49 4.969 0 7
> i 1 19.740 1.215 9.09 48 1
> i 2 19.740 0.002 1 48 0.002 48 1
> i 1 20.985 1.491 9.10 51 1
> i 2 20.985 1.490 1 50 1.490 1 1
> i 1 19.747 2.710 7.06 49 4
> i 2 19.747 2.709 1 48 2.709 0 4
> i 1 22.506 1.075 9.10 49 1
> i 2 22.506 0.002 1 51 0.002 51 1
> i 1 23.611 0.859 10.00 51 1
> i 2 23.611 0.858 1 51 0.858 0 1
> i 1 22.487 1.983 7.06 51 4
> i 2 22.487 1.982 1 51 1.982 0 4
>
> ''')
>
> csoundstrings.setScore('''
>
> t 0 60
>
> i 1 0.000 0.002 6.01 100 3
> i 1 0.000 0.002 6.01 100 4
> i 1 0.000 0.002 6.01 100 5
> i 1 0.000 0.002 6.01 100 6
> i 1 0.000 0.470 9.02 51 4
> i 2 0.000 0.002 1 51 0.002 51 4
> i 1 0.000 0.458 6.03 48 6
> i 2 0.000 0.457 1 49 0.457 0 6
> i 1 0.504 6.209 8.10 49 3
> i 2 0.504 6.208 1 51 6.208 0 3
> i 1 0.488 6.227 6.03 49 6
> i 2 0.488 6.226 1 50 6.226 1 6
> i 1 6.743 1.975 8.10 51 3
> i 2 6.743 0.050 1 0 0.050 50 3
> i 1 8.748 2.971 8.09 50 3
> i 2 8.748 2.970 1 59 2.970 0 3
> i 1 6.758 4.971 9.02 49 4
> i 2 6.758 0.002 1 48 0.002 48 4
> i 1 6.745 4.980 6.03 50 6
> i 2 6.745 4.979 1 50 4.979 0 6
> i 1 11.749 1.965 8.11 51 3
> i 2 11.749 0.002 1 49 0.002 49 3
> i 1 13.744 0.951 9.05 51 3
> i 2 13.744 0.950 1 59 0.950 0 3
> i 1 11.759 2.974 9.02 50 4
> i 2 11.759 2.973 1 51 2.973 1 4
> i 1 11.755 2.973 6.03 51 6
> i 2 11.755 2.972 1 48 2.972 0 6
> i 1 14.725 2.256 9.05 48 3
> i 2 14.725 0.002 1 49 0.002 49 3
> i 1 17.011 2.680 8.09 50 3
> i 2 17.011 2.679 1 50 2.679 1 3
> i 1 14.763 4.915 9.02 50 4
> i 2 14.763 0.050 1 1 0.050 51 4
> i 2 14.813 4.864 1 51 4.864 0 4
> i 1 14.758 4.970 6.03 50 6
> i 2 14.758 4.969 1 48 4.969 0 6
> i 1 19.771 1.195 8.09 51 3
> i 2 19.771 0.040 1 1 0.040 49 3
> i 1 20.996 1.472 8.10 50 3
> i 2 20.996 1.471 1 51 1.471 0 3
> i 1 19.758 2.712 9.02 48 4
> i 2 19.758 0.002 1 51 0.002 51 4
> i 1 22.498 1.097 8.10 48 3
> i 2 22.498 0.050 1 0 0.050 51 3
> i 1 23.625 0.845 9.00 49 3
> i 2 23.625 0.844 1 51 0.844 1 3
> i 1 22.500 1.970 9.02 49 4
> i 2 22.500 0.002 1 50 0.002 50 4
>
> ''')
>
>
> csoundwinds.exportForPerformance()
> csoundstrings.exportForPerformance()
>
> csoundwinds.perform()
> csoundstrings.perform()
>
>
>
--
View this message in context: http://www.nabble.com/multiple-midi-outs--Q---Csound-API---Python-tf4288950.html#a12332024
Sent from the Csound - General mailing list archive at Nabble.com. |
| Date | 2007-08-27 02:45 |
| From | Andres Cabrera |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
Hi Tim
Sorry for the silence....
I believe it's not possible for csound to currently use more than one
MIDI device per instance.
You'd need to use multimple instances and intercommunicate them... sorry.
Cheers,
Andrés
Tim Mortimer escribió:
> Hello,
>
> As i still have had no indication or further insight into if it is or is not
> possible to do what I am attempting in the code below, I thought I may as
> well post again in the hope that someone might actually be able to spare 60
> seconds & provide an answer.
>
> To clarify/ restate - i am attempting to use multiple calls to
> csnd.CppSound() in Python to enable transmission of midi data to separate -Q
> channels simultaneously
>
> If it is not possible, a simple "no that is not possible" will suffice.
>
> I happily accept that some of my more speculative threads may not merit
> attention when everyone is busy (like myself) gazing deeply into their own
> navels on various projects of their own, or imminent release / development
> deadlines / the "real world".
>
> However without pushing the belligerance angle too far, i sincerely believe
> this query is deserving of an answer, if only due to it's overwhelmingly
> specific focus, & extreme brevity of time investment for anyone capable of
> actually giving a response.
>
> with continued gratitude & thanks
>
> Tim
>
>
> Tim Mortimer wrote:
>
>> The code runs, but it only transmits on -Q10
>>
>> am I missing something?
>>
>> import csnd
>>
>> csoundwinds = csnd.CppSound()
>> csoundstrings = csnd.CppSound()
>>
>> csoundwinds.setPythonMessageCallback()
>> csoundstrings.setPythonMessageCallback()
>>
>> csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
>> csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
>>
>> # generic orch to translate csound sco
>> # to midi events for Garritan standalone player
>> # using csnd to try & target different soundbanks
>> # on different -Q channels
>> # at present, the code executes fine
>> # but the targetting of separate -Q channels
>> # is not achieved
>>
>>
>> thisorch = '''
>>
>> sr = 48000
>> ksmps = 64
>> nchnls = 2
>>
>> 0dbfs = 1
>>
>> opcode Pch2MIDIi, i,i
>>
>> ipit xin
>>
>> ioct = ((int(ipit))-3)*12
>>
>> iint = (ipit%1)*100
>>
>> imidi = ioct+iint
>>
>> imidi = round(imidi)
>>
>> xout imidi
>>
>> endop
>>
>> instr 01
>>
>> xtratim .001
>>
>> ipch = p4
>>
>> ivel = p5
>>
>> inotnum Pch2MIDIi ipch
>>
>> print inotnum
>>
>> noteondur p6, inotnum, ivel, p3
>>
>> endin
>>
>> instr 02
>>
>> kline init p5
>> ;;; ***********************
>> ;;; line needs temposcaling
>>
>> icc = p4
>>
>> kline line p5,p6,p7
>>
>> midiout 176, p8, icc, kline
>>
>> endin
>>
>> instr 03 ;;;PITCHBEND
>>
>> kline init p4
>> ;;; ***********************
>> ;;; line needs temposcaling
>>
>> kline line p4,p5,p6
>>
>> midiout 224, p7, 0, kline
>>
>> endin
>>
>> '''
>>
>> csoundwinds.setOrchestra(thisorch)
>> csoundstrings.setOrchestra(thisorch)
>>
>> csoundwinds.setScore('''
>>
>> t 0 60
>>
>> i 1 0.000 0.472 7.03 51 7
>> i 2 0.000 0.471 1 51 0.471 0 7
>> i 1 0.497 6.223 9.10 50 1
>> i 2 0.497 6.222 1 51 6.222 1 1
>> i 1 0.498 6.203 7.07 50 4
>> i 2 0.498 6.202 1 48 6.202 1 4
>> i 1 0.502 6.223 7.03 48 7
>> i 2 0.502 6.222 1 50 6.222 0 7
>> i 1 6.750 1.968 9.10 48 1
>> i 2 6.750 0.002 1 49 0.002 49 1
>> i 1 8.748 2.967 9.09 48 1
>> i 2 8.748 2.966 1 60 2.966 1 1
>> i 1 6.731 5.000 7.06 50 4
>> i 2 6.731 4.999 1 48 4.999 0 4
>> i 1 6.755 4.976 7.03 50 7
>> i 2 6.755 4.975 1 51 4.975 0 7
>> i 1 11.745 1.978 9.11 51 1
>> i 2 11.745 0.002 1 51 0.002 51 1
>> i 1 13.753 0.959 10.05 50 1
>> i 2 13.753 0.958 1 58 0.958 1 1
>> i 1 11.761 2.975 7.06 48 4
>> i 2 11.761 2.974 1 50 2.974 0 4
>> i 1 11.761 2.951 7.03 50 7
>> i 2 11.761 2.950 1 51 2.950 1 7
>> i 1 14.742 2.248 10.05 50 1
>> i 2 14.742 0.002 1 48 0.002 48 1
>> i 1 17.020 2.690 9.09 49 1
>> i 2 17.020 2.689 1 51 2.689 0 1
>> i 1 14.766 4.951 7.06 51 4
>> i 2 14.766 4.950 1 50 4.950 0 4
>> i 1 14.742 4.970 7.03 50 7
>> i 2 14.742 4.969 1 49 4.969 0 7
>> i 1 19.740 1.215 9.09 48 1
>> i 2 19.740 0.002 1 48 0.002 48 1
>> i 1 20.985 1.491 9.10 51 1
>> i 2 20.985 1.490 1 50 1.490 1 1
>> i 1 19.747 2.710 7.06 49 4
>> i 2 19.747 2.709 1 48 2.709 0 4
>> i 1 22.506 1.075 9.10 49 1
>> i 2 22.506 0.002 1 51 0.002 51 1
>> i 1 23.611 0.859 10.00 51 1
>> i 2 23.611 0.858 1 51 0.858 0 1
>> i 1 22.487 1.983 7.06 51 4
>> i 2 22.487 1.982 1 51 1.982 0 4
>>
>> ''')
>>
>> csoundstrings.setScore('''
>>
>> t 0 60
>>
>> i 1 0.000 0.002 6.01 100 3
>> i 1 0.000 0.002 6.01 100 4
>> i 1 0.000 0.002 6.01 100 5
>> i 1 0.000 0.002 6.01 100 6
>> i 1 0.000 0.470 9.02 51 4
>> i 2 0.000 0.002 1 51 0.002 51 4
>> i 1 0.000 0.458 6.03 48 6
>> i 2 0.000 0.457 1 49 0.457 0 6
>> i 1 0.504 6.209 8.10 49 3
>> i 2 0.504 6.208 1 51 6.208 0 3
>> i 1 0.488 6.227 6.03 49 6
>> i 2 0.488 6.226 1 50 6.226 1 6
>> i 1 6.743 1.975 8.10 51 3
>> i 2 6.743 0.050 1 0 0.050 50 3
>> i 1 8.748 2.971 8.09 50 3
>> i 2 8.748 2.970 1 59 2.970 0 3
>> i 1 6.758 4.971 9.02 49 4
>> i 2 6.758 0.002 1 48 0.002 48 4
>> i 1 6.745 4.980 6.03 50 6
>> i 2 6.745 4.979 1 50 4.979 0 6
>> i 1 11.749 1.965 8.11 51 3
>> i 2 11.749 0.002 1 49 0.002 49 3
>> i 1 13.744 0.951 9.05 51 3
>> i 2 13.744 0.950 1 59 0.950 0 3
>> i 1 11.759 2.974 9.02 50 4
>> i 2 11.759 2.973 1 51 2.973 1 4
>> i 1 11.755 2.973 6.03 51 6
>> i 2 11.755 2.972 1 48 2.972 0 6
>> i 1 14.725 2.256 9.05 48 3
>> i 2 14.725 0.002 1 49 0.002 49 3
>> i 1 17.011 2.680 8.09 50 3
>> i 2 17.011 2.679 1 50 2.679 1 3
>> i 1 14.763 4.915 9.02 50 4
>> i 2 14.763 0.050 1 1 0.050 51 4
>> i 2 14.813 4.864 1 51 4.864 0 4
>> i 1 14.758 4.970 6.03 50 6
>> i 2 14.758 4.969 1 48 4.969 0 6
>> i 1 19.771 1.195 8.09 51 3
>> i 2 19.771 0.040 1 1 0.040 49 3
>> i 1 20.996 1.472 8.10 50 3
>> i 2 20.996 1.471 1 51 1.471 0 3
>> i 1 19.758 2.712 9.02 48 4
>> i 2 19.758 0.002 1 51 0.002 51 4
>> i 1 22.498 1.097 8.10 48 3
>> i 2 22.498 0.050 1 0 0.050 51 3
>> i 1 23.625 0.845 9.00 49 3
>> i 2 23.625 0.844 1 51 0.844 1 3
>> i 1 22.500 1.970 9.02 49 4
>> i 2 22.500 0.002 1 50 0.002 50 4
>>
>> ''')
>>
>>
>> csoundwinds.exportForPerformance()
>> csoundstrings.exportForPerformance()
>>
>> csoundwinds.perform()
>> csoundstrings.perform()
>>
>>
>>
>>
>
> |
| Date | 2007-08-27 11:57 |
| From | Tim Mortimer |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
Thanks Andres,
I was beginning to think i had mortally offended some or all of you
(particularly the developers, grovel grovel) with some outrageous hubris or
insensitivity or something.... (things i am no doubt capable of, but strive
to avoid i promise...)
In terms of "use multimple instances and intercommunicate them" - i thought
that's what my code was doing?
I've instantiated 2 separate instances of csnd.CppSound() after all -
like this: see?
>> csoundwinds = csnd.CppSound()
>> csoundstrings = csnd.CppSound()
is there more to it than that? some sort of "threading" issue or something?
assumedly then i have achieved the "multiple instances", but not the
"intercommunication"?
or is that only possible by using Csound API nested in C code or something?
yours ignorantly....
Andres Cabrera wrote:
>
> Hi Tim
> Sorry for the silence....
> I believe it's not possible for csound to currently use more than one
> MIDI device per instance.
> You'd need to use multimple instances and intercommunicate them... sorry.
> Cheers,
> Andrés
>
>
> Tim Mortimer escribió:
>> Hello,
>>
>> As i still have had no indication or further insight into if it is or is
>> not
>> possible to do what I am attempting in the code below, I thought I may as
>> well post again in the hope that someone might actually be able to spare
>> 60
>> seconds & provide an answer.
>>
>> To clarify/ restate - i am attempting to use multiple calls to
>> csnd.CppSound() in Python to enable transmission of midi data to separate
>> -Q
>> channels simultaneously
>>
>> If it is not possible, a simple "no that is not possible" will suffice.
>>
>> I happily accept that some of my more speculative threads may not merit
>> attention when everyone is busy (like myself) gazing deeply into their
>> own
>> navels on various projects of their own, or imminent release /
>> development
>> deadlines / the "real world".
>>
>> However without pushing the belligerance angle too far, i sincerely
>> believe
>> this query is deserving of an answer, if only due to it's overwhelmingly
>> specific focus, & extreme brevity of time investment for anyone capable
>> of
>> actually giving a response.
>>
>> with continued gratitude & thanks
>>
>> Tim
>>
>>
>> Tim Mortimer wrote:
>>
>>> The code runs, but it only transmits on -Q10
>>>
>>> am I missing something?
>>>
>>> import csnd
>>>
>>> csoundwinds = csnd.CppSound()
>>> csoundstrings = csnd.CppSound()
>>>
>>> csoundwinds.setPythonMessageCallback()
>>> csoundstrings.setPythonMessageCallback()
>>>
>>> csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
>>> csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
>>>
>>> # generic orch to translate csound sco
>>> # to midi events for Garritan standalone player
>>> # using csnd to try & target different soundbanks
>>> # on different -Q channels
>>> # at present, the code executes fine
>>> # but the targetting of separate -Q channels
>>> # is not achieved
>>>
>>>
>>> thisorch = '''
>>>
>>> sr = 48000
>>> ksmps = 64
>>> nchnls = 2
>>>
>>> 0dbfs = 1
>>>
>>> opcode Pch2MIDIi, i,i
>>>
>>> ipit xin
>>>
>>> ioct = ((int(ipit))-3)*12
>>>
>>> iint = (ipit%1)*100
>>>
>>> imidi = ioct+iint
>>>
>>> imidi = round(imidi)
>>>
>>> xout imidi
>>>
>>> endop
>>>
>>> instr 01
>>>
>>> xtratim .001
>>>
>>> ipch = p4
>>>
>>> ivel = p5
>>>
>>> inotnum Pch2MIDIi ipch
>>>
>>> print inotnum
>>>
>>> noteondur p6, inotnum, ivel, p3
>>>
>>> endin
>>>
>>> instr 02
>>>
>>> kline init p5
>>> ;;; ***********************
>>> ;;; line needs temposcaling
>>>
>>> icc = p4
>>>
>>> kline line p5,p6,p7
>>>
>>> midiout 176, p8, icc, kline
>>>
>>> endin
>>>
>>> instr 03 ;;;PITCHBEND
>>>
>>> kline init p4
>>> ;;; ***********************
>>> ;;; line needs temposcaling
>>>
>>> kline line p4,p5,p6
>>>
>>> midiout 224, p7, 0, kline
>>>
>>> endin
>>>
>>> '''
>>>
>>> csoundwinds.setOrchestra(thisorch)
>>> csoundstrings.setOrchestra(thisorch)
>>>
>>> csoundwinds.setScore('''
>>>
>>> t 0 60
>>>
>>> i 1 0.000 0.472 7.03 51 7
>>> i 2 0.000 0.471 1 51 0.471 0 7
>>> i 1 0.497 6.223 9.10 50 1
>>> i 2 0.497 6.222 1 51 6.222 1 1
>>> i 1 0.498 6.203 7.07 50 4
>>> i 2 0.498 6.202 1 48 6.202 1 4
>>> i 1 0.502 6.223 7.03 48 7
>>> i 2 0.502 6.222 1 50 6.222 0 7
>>> i 1 6.750 1.968 9.10 48 1
>>> i 2 6.750 0.002 1 49 0.002 49 1
>>> i 1 8.748 2.967 9.09 48 1
>>> i 2 8.748 2.966 1 60 2.966 1 1
>>> i 1 6.731 5.000 7.06 50 4
>>> i 2 6.731 4.999 1 48 4.999 0 4
>>> i 1 6.755 4.976 7.03 50 7
>>> i 2 6.755 4.975 1 51 4.975 0 7
>>> i 1 11.745 1.978 9.11 51 1
>>> i 2 11.745 0.002 1 51 0.002 51 1
>>> i 1 13.753 0.959 10.05 50 1
>>> i 2 13.753 0.958 1 58 0.958 1 1
>>> i 1 11.761 2.975 7.06 48 4
>>> i 2 11.761 2.974 1 50 2.974 0 4
>>> i 1 11.761 2.951 7.03 50 7
>>> i 2 11.761 2.950 1 51 2.950 1 7
>>> i 1 14.742 2.248 10.05 50 1
>>> i 2 14.742 0.002 1 48 0.002 48 1
>>> i 1 17.020 2.690 9.09 49 1
>>> i 2 17.020 2.689 1 51 2.689 0 1
>>> i 1 14.766 4.951 7.06 51 4
>>> i 2 14.766 4.950 1 50 4.950 0 4
>>> i 1 14.742 4.970 7.03 50 7
>>> i 2 14.742 4.969 1 49 4.969 0 7
>>> i 1 19.740 1.215 9.09 48 1
>>> i 2 19.740 0.002 1 48 0.002 48 1
>>> i 1 20.985 1.491 9.10 51 1
>>> i 2 20.985 1.490 1 50 1.490 1 1
>>> i 1 19.747 2.710 7.06 49 4
>>> i 2 19.747 2.709 1 48 2.709 0 4
>>> i 1 22.506 1.075 9.10 49 1
>>> i 2 22.506 0.002 1 51 0.002 51 1
>>> i 1 23.611 0.859 10.00 51 1
>>> i 2 23.611 0.858 1 51 0.858 0 1
>>> i 1 22.487 1.983 7.06 51 4
>>> i 2 22.487 1.982 1 51 1.982 0 4
>>>
>>> ''')
>>>
>>> csoundstrings.setScore('''
>>>
>>> t 0 60
>>>
>>> i 1 0.000 0.002 6.01 100 3
>>> i 1 0.000 0.002 6.01 100 4
>>> i 1 0.000 0.002 6.01 100 5
>>> i 1 0.000 0.002 6.01 100 6
>>> i 1 0.000 0.470 9.02 51 4
>>> i 2 0.000 0.002 1 51 0.002 51 4
>>> i 1 0.000 0.458 6.03 48 6
>>> i 2 0.000 0.457 1 49 0.457 0 6
>>> i 1 0.504 6.209 8.10 49 3
>>> i 2 0.504 6.208 1 51 6.208 0 3
>>> i 1 0.488 6.227 6.03 49 6
>>> i 2 0.488 6.226 1 50 6.226 1 6
>>> i 1 6.743 1.975 8.10 51 3
>>> i 2 6.743 0.050 1 0 0.050 50 3
>>> i 1 8.748 2.971 8.09 50 3
>>> i 2 8.748 2.970 1 59 2.970 0 3
>>> i 1 6.758 4.971 9.02 49 4
>>> i 2 6.758 0.002 1 48 0.002 48 4
>>> i 1 6.745 4.980 6.03 50 6
>>> i 2 6.745 4.979 1 50 4.979 0 6
>>> i 1 11.749 1.965 8.11 51 3
>>> i 2 11.749 0.002 1 49 0.002 49 3
>>> i 1 13.744 0.951 9.05 51 3
>>> i 2 13.744 0.950 1 59 0.950 0 3
>>> i 1 11.759 2.974 9.02 50 4
>>> i 2 11.759 2.973 1 51 2.973 1 4
>>> i 1 11.755 2.973 6.03 51 6
>>> i 2 11.755 2.972 1 48 2.972 0 6
>>> i 1 14.725 2.256 9.05 48 3
>>> i 2 14.725 0.002 1 49 0.002 49 3
>>> i 1 17.011 2.680 8.09 50 3
>>> i 2 17.011 2.679 1 50 2.679 1 3
>>> i 1 14.763 4.915 9.02 50 4
>>> i 2 14.763 0.050 1 1 0.050 51 4
>>> i 2 14.813 4.864 1 51 4.864 0 4
>>> i 1 14.758 4.970 6.03 50 6
>>> i 2 14.758 4.969 1 48 4.969 0 6
>>> i 1 19.771 1.195 8.09 51 3
>>> i 2 19.771 0.040 1 1 0.040 49 3
>>> i 1 20.996 1.472 8.10 50 3
>>> i 2 20.996 1.471 1 51 1.471 0 3
>>> i 1 19.758 2.712 9.02 48 4
>>> i 2 19.758 0.002 1 51 0.002 51 4
>>> i 1 22.498 1.097 8.10 48 3
>>> i 2 22.498 0.050 1 0 0.050 51 3
>>> i 1 23.625 0.845 9.00 49 3
>>> i 2 23.625 0.844 1 51 0.844 1 3
>>> i 1 22.500 1.970 9.02 49 4
>>> i 2 22.500 0.002 1 50 0.002 50 4
>>>
>>> ''')
>>>
>>>
>>> csoundwinds.exportForPerformance()
>>> csoundstrings.exportForPerformance()
>>>
>>> csoundwinds.perform()
>>> csoundstrings.perform()
>>>
>>>
>>>
>>>
>>
>>
> --
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>
>
--
View this message in context: http://www.nabble.com/multiple-midi-outs--Q---Csound-API---Python-tf4288950.html#a12344924
Sent from the Csound - General mailing list archive at Nabble.com. |
| Date | 2007-08-27 20:25 |
| From | Andres Cabrera |
| Subject | Re: multiple midi outs -Q / Csound API / Python |
Hi,
Tim Mortimer escribió:
> Thanks Andres,
>
> I was beginning to think i had mortally offended some or all of you
> (particularly the developers, grovel grovel) with some outrageous hubris or
> insensitivity or something.... (things i am no doubt capable of, but strive
> to avoid i promise...)
>
> In terms of "use multimple instances and intercommunicate them" - i thought
> that's what my code was doing?
>
> I've instantiated 2 separate instances of csnd.CppSound() after all -
>
> like this: see?
>
>
>>> csoundwinds = csnd.CppSound()
>>> csoundstrings = csnd.CppSound()
>>>
>
> is there more to it than that? some sort of "threading" issue or something?
>
> assumedly then i have achieved the "multiple instances", but not the
> "intercommunication"?
>
Yes, you are missing the intercommunication part.... You can use
software buses for this:
file:///home/andres/src/manual/html/SoftwareBus.html
file:///home/andres/src/manual/html/chnset.html
You would also need something like jack (or another instance of csound)
so you can mix both outputs of csound to the same sound card.
Cheers,
Andrés
> or is that only possible by using Csound API nested in C code or something?
>
> yours ignorantly....
>
>
>
> Andres Cabrera wrote:
>
>> Hi Tim
>> Sorry for the silence....
>> I believe it's not possible for csound to currently use more than one
>> MIDI device per instance.
>> You'd need to use multimple instances and intercommunicate them... sorry.
>> Cheers,
>> Andrés
>>
>>
>> Tim Mortimer escribió:
>>
>>> Hello,
>>>
>>> As i still have had no indication or further insight into if it is or is
>>> not
>>> possible to do what I am attempting in the code below, I thought I may as
>>> well post again in the hope that someone might actually be able to spare
>>> 60
>>> seconds & provide an answer.
>>>
>>> To clarify/ restate - i am attempting to use multiple calls to
>>> csnd.CppSound() in Python to enable transmission of midi data to separate
>>> -Q
>>> channels simultaneously
>>>
>>> If it is not possible, a simple "no that is not possible" will suffice.
>>>
>>> I happily accept that some of my more speculative threads may not merit
>>> attention when everyone is busy (like myself) gazing deeply into their
>>> own
>>> navels on various projects of their own, or imminent release /
>>> development
>>> deadlines / the "real world".
>>>
>>> However without pushing the belligerance angle too far, i sincerely
>>> believe
>>> this query is deserving of an answer, if only due to it's overwhelmingly
>>> specific focus, & extreme brevity of time investment for anyone capable
>>> of
>>> actually giving a response.
>>>
>>> with continued gratitude & thanks
>>>
>>> Tim
>>>
>>>
>>> Tim Mortimer wrote:
>>>
>>>
>>>> The code runs, but it only transmits on -Q10
>>>>
>>>> am I missing something?
>>>>
>>>> import csnd
>>>>
>>>> csoundwinds = csnd.CppSound()
>>>> csoundstrings = csnd.CppSound()
>>>>
>>>> csoundwinds.setPythonMessageCallback()
>>>> csoundstrings.setPythonMessageCallback()
>>>>
>>>> csoundwinds.setCommand('csound -+rtaudio=null -Q10 test.orc test.sco')
>>>> csoundstrings.setCommand('csound -+rtaudio=null -Q11 test.orc test.sco')
>>>>
>>>> # generic orch to translate csound sco
>>>> # to midi events for Garritan standalone player
>>>> # using csnd to try & target different soundbanks
>>>> # on different -Q channels
>>>> # at present, the code executes fine
>>>> # but the targetting of separate -Q channels
>>>> # is not achieved
>>>>
>>>>
>>>> thisorch = '''
>>>>
>>>> sr = 48000
>>>> ksmps = 64
>>>> nchnls = 2
>>>>
>>>> 0dbfs = 1
>>>>
>>>> opcode Pch2MIDIi, i,i
>>>>
>>>> ipit xin
>>>>
>>>> ioct = ((int(ipit))-3)*12
>>>>
>>>> iint = (ipit%1)*100
>>>>
>>>> imidi = ioct+iint
>>>>
>>>> imidi = round(imidi)
>>>>
>>>> xout imidi
>>>>
>>>> endop
>>>>
>>>> instr 01
>>>>
>>>> xtratim .001
>>>>
>>>> ipch = p4
>>>>
>>>> ivel = p5
>>>>
>>>> inotnum Pch2MIDIi ipch
>>>>
>>>> print inotnum
>>>>
>>>> noteondur p6, inotnum, ivel, p3
>>>>
>>>> endin
>>>>
>>>> instr 02
>>>>
>>>> kline init p5
>>>> ;;; ***********************
>>>> ;;; line needs temposcaling
>>>>
>>>> icc = p4
>>>>
>>>> kline line p5,p6,p7
>>>>
>>>> midiout 176, p8, icc, kline
>>>>
>>>> endin
>>>>
>>>> instr 03 ;;;PITCHBEND
>>>>
>>>> kline init p4
>>>> ;;; ***********************
>>>> ;;; line needs temposcaling
>>>>
>>>> kline line p4,p5,p6
>>>>
>>>> midiout 224, p7, 0, kline
>>>>
>>>> endin
>>>>
>>>> '''
>>>>
>>>> csoundwinds.setOrchestra(thisorch)
>>>> csoundstrings.setOrchestra(thisorch)
>>>>
>>>> csoundwinds.setScore('''
>>>>
>>>> t 0 60
>>>>
>>>> i 1 0.000 0.472 7.03 51 7
>>>> i 2 0.000 0.471 1 51 0.471 0 7
>>>> i 1 0.497 6.223 9.10 50 1
>>>> i 2 0.497 6.222 1 51 6.222 1 1
>>>> i 1 0.498 6.203 7.07 50 4
>>>> i 2 0.498 6.202 1 48 6.202 1 4
>>>> i 1 0.502 6.223 7.03 48 7
>>>> i 2 0.502 6.222 1 50 6.222 0 7
>>>> i 1 6.750 1.968 9.10 48 1
>>>> i 2 6.750 0.002 1 49 0.002 49 1
>>>> i 1 8.748 2.967 9.09 48 1
>>>> i 2 8.748 2.966 1 60 2.966 1 1
>>>> i 1 6.731 5.000 7.06 50 4
>>>> i 2 6.731 4.999 1 48 4.999 0 4
>>>> i 1 6.755 4.976 7.03 50 7
>>>> i 2 6.755 4.975 1 51 4.975 0 7
>>>> i 1 11.745 1.978 9.11 51 1
>>>> i 2 11.745 0.002 1 51 0.002 51 1
>>>> i 1 13.753 0.959 10.05 50 1
>>>> i 2 13.753 0.958 1 58 0.958 1 1
>>>> i 1 11.761 2.975 7.06 48 4
>>>> i 2 11.761 2.974 1 50 2.974 0 4
>>>> i 1 11.761 2.951 7.03 50 7
>>>> i 2 11.761 2.950 1 51 2.950 1 7
>>>> i 1 14.742 2.248 10.05 50 1
>>>> i 2 14.742 0.002 1 48 0.002 48 1
>>>> i 1 17.020 2.690 9.09 49 1
>>>> i 2 17.020 2.689 1 51 2.689 0 1
>>>> i 1 14.766 4.951 7.06 51 4
>>>> i 2 14.766 4.950 1 50 4.950 0 4
>>>> i 1 14.742 4.970 7.03 50 7
>>>> i 2 14.742 4.969 1 49 4.969 0 7
>>>> i 1 19.740 1.215 9.09 48 1
>>>> i 2 19.740 0.002 1 48 0.002 48 1
>>>> i 1 20.985 1.491 9.10 51 1
>>>> i 2 20.985 1.490 1 50 1.490 1 1
>>>> i 1 19.747 2.710 7.06 49 4
>>>> i 2 19.747 2.709 1 48 2.709 0 4
>>>> i 1 22.506 1.075 9.10 49 1
>>>> i 2 22.506 0.002 1 51 0.002 51 1
>>>> i 1 23.611 0.859 10.00 51 1
>>>> i 2 23.611 0.858 1 51 0.858 0 1
>>>> i 1 22.487 1.983 7.06 51 4
>>>> i 2 22.487 1.982 1 51 1.982 0 4
>>>>
>>>> ''')
>>>>
>>>> csoundstrings.setScore('''
>>>>
>>>> t 0 60
>>>>
>>>> i 1 0.000 0.002 6.01 100 3
>>>> i 1 0.000 0.002 6.01 100 4
>>>> i 1 0.000 0.002 6.01 100 5
>>>> i 1 0.000 0.002 6.01 100 6
>>>> i 1 0.000 0.470 9.02 51 4
>>>> i 2 0.000 0.002 1 51 0.002 51 4
>>>> i 1 0.000 0.458 6.03 48 6
>>>> i 2 0.000 0.457 1 49 0.457 0 6
>>>> i 1 0.504 6.209 8.10 49 3
>>>> i 2 0.504 6.208 1 51 6.208 0 3
>>>> i 1 0.488 6.227 6.03 49 6
>>>> i 2 0.488 6.226 1 50 6.226 1 6
>>>> i 1 6.743 1.975 8.10 51 3
>>>> i 2 6.743 0.050 1 0 0.050 50 3
>>>> i 1 8.748 2.971 8.09 50 3
>>>> i 2 8.748 2.970 1 59 2.970 0 3
>>>> i 1 6.758 4.971 9.02 49 4
>>>> i 2 6.758 0.002 1 48 0.002 48 4
>>>> i 1 6.745 4.980 6.03 50 6
>>>> i 2 6.745 4.979 1 50 4.979 0 6
>>>> i 1 11.749 1.965 8.11 51 3
>>>> i 2 11.749 0.002 1 49 0.002 49 3
>>>> i 1 13.744 0.951 9.05 51 3
>>>> i 2 13.744 0.950 1 59 0.950 0 3
>>>> i 1 11.759 2.974 9.02 50 4
>>>> i 2 11.759 2.973 1 51 2.973 1 4
>>>> i 1 11.755 2.973 6.03 51 6
>>>> i 2 11.755 2.972 1 48 2.972 0 6
>>>> i 1 14.725 2.256 9.05 48 3
>>>> i 2 14.725 0.002 1 49 0.002 49 3
>>>> i 1 17.011 2.680 8.09 50 3
>>>> i 2 17.011 2.679 1 50 2.679 1 3
>>>> i 1 14.763 4.915 9.02 50 4
>>>> i 2 14.763 0.050 1 1 0.050 51 4
>>>> i 2 14.813 4.864 1 51 4.864 0 4
>>>> i 1 14.758 4.970 6.03 50 6
>>>> i 2 14.758 4.969 1 48 4.969 0 6
>>>> i 1 19.771 1.195 8.09 51 3
>>>> i 2 19.771 0.040 1 1 0.040 49 3
>>>> i 1 20.996 1.472 8.10 50 3
>>>> i 2 20.996 1.471 1 51 1.471 0 3
>>>> i 1 19.758 2.712 9.02 48 4
>>>> i 2 19.758 0.002 1 51 0.002 51 4
>>>> i 1 22.498 1.097 8.10 48 3
>>>> i 2 22.498 0.050 1 0 0.050 51 3
>>>> i 1 23.625 0.845 9.00 49 3
>>>> i 2 23.625 0.844 1 51 0.844 1 3
>>>> i 1 22.500 1.970 9.02 49 4
>>>> i 2 22.500 0.002 1 50 0.002 50 4
>>>>
>>>> ''')
>>>>
>>>>
>>>> csoundwinds.exportForPerformance()
>>>> csoundstrings.exportForPerformance()
>>>>
>>>> csoundwinds.perform()
>>>> csoundstrings.perform()
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> Send bugs reports to this list.
>> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk
>>
>>
>>
>
> |