Csound Csound-dev Csound-tekno Search About

python question re pysco...

Date2015-04-21 00:58
FromForrest Curo
Subjectpython question re pysco...
AttachmentsNone  None  
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

Date2015-04-21 02:45
FromJacob Joaquin
SubjectRe: python question re pysco...
AttachmentsNone  None  
Importing PythonScoreBin won't work, as that is made specifically for use with the score bin feature. Importing "PythonScore" should work, however, there aren't the methods necessary to get this to work well within pyruni. So it's probably useless at the moment.

I think I'm going to have to give this a try myself, see what's involved, create a class specifically for us with pyruni, and write a brief tutorial on the subject. Give me a few days to get this in order. I'll start right now.




On Mon, Apr 20, 2015 at 4:58 PM, Forrest Curo <treegestalt@gmail.com> wrote:
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




--

Date2015-04-21 04:41
FromJacob Joaquin
SubjectRe: python question re pysco...
AttachmentsNone  None  
I've looked into this and I'm not certain there's much potential with using PySco from within the orchestra. I can get it to load and generate scores, but I'm not sure there's a way to actually to evaluate the generated scores. Unless I'm missing something, the manual states these work with i and k-rate variables.

On Mon, Apr 20, 2015 at 6:45 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Importing PythonScoreBin won't work, as that is made specifically for use with the score bin feature. Importing "PythonScore" should work, however, there aren't the methods necessary to get this to work well within pyruni. So it's probably useless at the moment.

I think I'm going to have to give this a try myself, see what's involved, create a class specifically for us with pyruni, and write a brief tutorial on the subject. Give me a few days to get this in order. I'll start right now.




On Mon, Apr 20, 2015 at 4:58 PM, Forrest Curo <treegestalt@gmail.com> wrote:
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




--



--

Date2015-04-21 06:54
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  

If one wrote an instrument, incorporating python code, to parse those 'generated scores' and then throw their arguments to an 'event' opcode -- This would be seem a bit indirect, but I think we'd accomplish the same thing as if we'd poked those strings directly into the score and then processed them there.

?

Also -- that fifo notion would probably work. One instrument sends the scores to it; the "L" command line option could have the critter read from it. [but not in Windows.]

Sayeth the manual:
-L DEVICE, --score-in=DEVICE

Read line-oriented real-time score events from device DEVICE. The name stdin will permit score events to be typed at your terminal, or piped from another process. Each line-event is terminated by a carriage-return. Events are coded just like those in a standard numeric score, except that an event with p2=0 will be performed immediately, and an event with p2=T will be performed T seconds after arrival. Events can arrive at any time, and in any order. The score carry feature is legal here, as are held notes (p3 negative) and string arguments, but ramps and pp or np references are not.

Note

The -L flag is only valid on *NIX systems which have pipes. It doesn't work on Windows.



On Mon, Apr 20, 2015 at 8:41 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I've looked into this and I'm not certain there's much potential with using PySco from within the orchestra. I can get it to load and generate scores, but I'm not sure there's a way to actually to evaluate the generated scores. Unless I'm missing something, the manual states these work with i and k-rate variables.

On Mon, Apr 20, 2015 at 6:45 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Importing PythonScoreBin won't work, as that is made specifically for use with the score bin feature. Importing "PythonScore" should work, however, there aren't the methods necessary to get this to work well within pyruni. So it's probably useless at the moment.

I think I'm going to have to give this a try myself, see what's involved, create a class specifically for us with pyruni, and write a brief tutorial on the subject. Give me a few days to get this in order. I'll start right now.




On Mon, Apr 20, 2015 at 4:58 PM, Forrest Curo <treegestalt@gmail.com> wrote:
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




--



--

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-04-21 12:12
FromMichael Gogins
SubjectRe: python question re pysco...
AttachmentsNone  None  

You can use the Lua opcodes to do score generation in the orchestra.

Regards,
Mike

On Apr 21, 2015 1:56 AM, "Forrest Curo" <treegestalt@gmail.com> wrote:

If one wrote an instrument, incorporating python code, to parse those 'generated scores' and then throw their arguments to an 'event' opcode -- This would be seem a bit indirect, but I think we'd accomplish the same thing as if we'd poked those strings directly into the score and then processed them there.

?

Also -- that fifo notion would probably work. One instrument sends the scores to it; the "L" command line option could have the critter read from it. [but not in Windows.]

Sayeth the manual:
-L DEVICE, --score-in=DEVICE

Read line-oriented real-time score events from device DEVICE. The name stdin will permit score events to be typed at your terminal, or piped from another process. Each line-event is terminated by a carriage-return. Events are coded just like those in a standard numeric score, except that an event with p2=0 will be performed immediately, and an event with p2=T will be performed T seconds after arrival. Events can arrive at any time, and in any order. The score carry feature is legal here, as are held notes (p3 negative) and string arguments, but ramps and pp or np references are not.

Note

The -L flag is only valid on *NIX systems which have pipes. It doesn't work on Windows.



On Mon, Apr 20, 2015 at 8:41 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I've looked into this and I'm not certain there's much potential with using PySco from within the orchestra. I can get it to load and generate scores, but I'm not sure there's a way to actually to evaluate the generated scores. Unless I'm missing something, the manual states these work with i and k-rate variables.

On Mon, Apr 20, 2015 at 6:45 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Importing PythonScoreBin won't work, as that is made specifically for use with the score bin feature. Importing "PythonScore" should work, however, there aren't the methods necessary to get this to work well within pyruni. So it's probably useless at the moment.

I think I'm going to have to give this a try myself, see what's involved, create a class specifically for us with pyruni, and write a brief tutorial on the subject. Give me a few days to get this in order. I'll start right now.




On Mon, Apr 20, 2015 at 4:58 PM, Forrest Curo <treegestalt@gmail.com> wrote:
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




--



--

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Date2015-04-21 15:22
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  
Okay... All I need is another confusing language I could theoretically do anything whatsoever with, no one to know what it will be -- but I was writing pd extensions in it, and this ought to be easier. Probably there are advantages I'll discover if I try. (Thanks, actually!)

But it's looking like I could do score generation anyplace in any program or language, send the results in text to csound via -L, and have the timing accurate, while playing the real-time midi stuff directly, no 'latency' issues with that either. (?) Whee, I think!

On Tue, Apr 21, 2015 at 4:12 AM, Michael Gogins <michael.gogins@gmail.com> wrote:

You can use the Lua opcodes to do score generation in the orchestra.

Regards,
Mike

On Apr 21, 2015 1:56 AM, "Forrest Curo" <treegestalt@gmail.com> wrote:

If one wrote an instrument, incorporating python code, to parse those 'generated scores' and then throw their arguments to an 'event' opcode -- This would be seem a bit indirect, but I think we'd accomplish the same thing as if we'd poked those strings directly into the score and then processed them there.

?

Also -- that fifo notion would probably work. One instrument sends the scores to it; the "L" command line option could have the critter read from it. [but not in Windows.]

Sayeth the manual:
-L DEVICE, --score-in=DEVICE

Read line-oriented real-time score events from device DEVICE. The name stdin will permit score events to be typed at your terminal, or piped from another process. Each line-event is terminated by a carriage-return. Events are coded just like those in a standard numeric score, except that an event with p2=0 will be performed immediately, and an event with p2=T will be performed T seconds after arrival. Events can arrive at any time, and in any order. The score carry feature is legal here, as are held notes (p3 negative) and string arguments, but ramps and pp or np references are not.

Note

The -L flag is only valid on *NIX systems which have pipes. It doesn't work on Windows.



On Mon, Apr 20, 2015 at 8:41 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
I've looked into this and I'm not certain there's much potential with using PySco from within the orchestra. I can get it to load and generate scores, but I'm not sure there's a way to actually to evaluate the generated scores. Unless I'm missing something, the manual states these work with i and k-rate variables.

On Mon, Apr 20, 2015 at 6:45 PM, Jacob Joaquin <jacobjoaquin@gmail.com> wrote:
Importing PythonScoreBin won't work, as that is made specifically for use with the score bin feature. Importing "PythonScore" should work, however, there aren't the methods necessary to get this to work well within pyruni. So it's probably useless at the moment.

I think I'm going to have to give this a try myself, see what's involved, create a class specifically for us with pyruni, and write a brief tutorial on the subject. Give me a few days to get this in order. I'll start right now.




On Mon, Apr 20, 2015 at 4:58 PM, Forrest Curo <treegestalt@gmail.com> wrote:
In the score section, using:

<CsScore bin="python">

from csd.pysco import PythonScoreBin
.......................

works just as it's supposed to.
---------------------------

in <CsInstruments> [after pyinit, of course]

pyruni {{
import random
random.seed()
from csd.pysco import PythonScoreBin
}}
................
utterly confuses the built-in python interpreter.

What's the  [simple; it must be!] difficulty?

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here




--



--

------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-04-21 16:15
FromMichael Gogins
SubjectRe: python question re pysco...
AttachmentsNone  None  

What operating  system do you use for Csound?

Also, what is it you are trying to do? What kind of music, score, algorithm? Live, not live? Interactive, non-interactive?

Regards,
Mike


Date2015-04-21 16:54
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  
Using linux (Ubuntu) and

wanting to construct something that will record note-patterns and echo them, modified, in real-time.

I've remapped my midi keyboard with an instrument that sends the white keys into consecutive numbers in a seven note/octave scale, from which I can readily transpose a pattern or play it back in major, minor, dorian or jazzier modes, modulate it, etc.

So basically I still need to work out how to pick up timing, velocity and note number during some period of time -- set via some method like: 'black key, count 1 2 3 4... black key', after which I should be able to play with the result all sorts of ways!

On Tue, Apr 21, 2015 at 8:15 AM, Michael Gogins <michael.gogins@gmail.com> wrote:

What operating  system do you use for Csound?

Also, what is it you are trying to do? What kind of music, score, algorithm? Live, not live? Interactive, non-interactive?

Regards,
Mike


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-04-21 17:29
FromMichael Gogins
SubjectRe: python question re pysco...
AttachmentsNone  None  
Thanks. There are numerous ways to do this. Probably the best is to write your program to interact with the user in some language that you like, it doesn't matter which one that is very much. C++, Python, LuaJIT, Haskell, Java, all would work. Then have this program of yours communicate with Csound via the Csound API.

You also could do this with JavaScript on Android or (soon) the desktop. esp. as this will probably have some sort of MIDI interface of its own. But for now, I wouldn't go this way, the technology stack is not yet mature or widely available.

If you are a skilled programmer, do it in C++ using the Qt SDK. If you are not a skilled programmer, it sounds like you have been using Python, so stick with that. Find a MIDI interface module for Python and use that to interact with the user, then generate Csound score events from the MIDI events and send them to Csound via the API csoundReadScore. You could do a pretty fancy GUI in Python as well.

Ask away.

Hope this helps,
Mike




-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Tue, Apr 21, 2015 at 11:54 AM, Forrest Curo <treegestalt@gmail.com> wrote:
Using linux (Ubuntu) and

wanting to construct something that will record note-patterns and echo them, modified, in real-time.

I've remapped my midi keyboard with an instrument that sends the white keys into consecutive numbers in a seven note/octave scale, from which I can readily transpose a pattern or play it back in major, minor, dorian or jazzier modes, modulate it, etc.

So basically I still need to work out how to pick up timing, velocity and note number during some period of time -- set via some method like: 'black key, count 1 2 3 4... black key', after which I should be able to play with the result all sorts of ways!

On Tue, Apr 21, 2015 at 8:15 AM, Michael Gogins <michael.gogins@gmail.com> wrote:

What operating  system do you use for Csound?

Also, what is it you are trying to do? What kind of music, score, algorithm? Live, not live? Interactive, non-interactive?

Regards,
Mike


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-04-22 00:51
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  
I kind of liked Lua except I could never be quite sure I had it aimed in the right direction.

I really hate having a variable turn into a frog when I'm not looking.

Right now I'm slogging through your piece on the subject:
"Getting the moogladder Lua code to run took experimentation to work around idiosyncracies of
LuaJIT's virtual machine. In particular, using Lua's normal for loop construct proved impossible –
every run simply crashed. Fortunately, using the while construct to create for loops is easy, and
works fine. There may be other problems with LuaJIT/FFI that different Lua code would expose..."

I'm even going to have to look up what a 'FFI' is... C was cumbersome, but I'd usually know what it was doing. If only it were simpler to interface it with other languages.

Anyway, it looks like I'll use aconnectgui to send the incoming midi both to csound and an outside program, which won't need to send score events all that quickly, just put the right numbers into p2.

Two musicians can play together based on starting at the same time and keeping to a common tempo

On Tue, Apr 21, 2015 at 9:29 AM, Michael Gogins <michael.gogins@gmail.com> wrote:
Thanks. There are numerous ways to do this. Probably the best is to write your program to interact with the user in some language that you like, it doesn't matter which one that is very much. C++, Python, LuaJIT, Haskell, Java, all would work. Then have this program of yours communicate with Csound via the Csound API.

You also could do this with JavaScript on Android or (soon) the desktop. esp. as this will probably have some sort of MIDI interface of its own. But for now, I wouldn't go this way, the technology stack is not yet mature or widely available.

If you are a skilled programmer, do it in C++ using the Qt SDK. If you are not a skilled programmer, it sounds like you have been using Python, so stick with that. Find a MIDI interface module for Python and use that to interact with the user, then generate Csound score events from the MIDI events and send them to Csound via the API csoundReadScore. You could do a pretty fancy GUI in Python as well.

Ask away.

Hope this helps,
Mike




-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com

On Tue, Apr 21, 2015 at 11:54 AM, Forrest Curo <treegestalt@gmail.com> wrote:
Using linux (Ubuntu) and

wanting to construct something that will record note-patterns and echo them, modified, in real-time.

I've remapped my midi keyboard with an instrument that sends the white keys into consecutive numbers in a seven note/octave scale, from which I can readily transpose a pattern or play it back in major, minor, dorian or jazzier modes, modulate it, etc.

So basically I still need to work out how to pick up timing, velocity and note number during some period of time -- set via some method like: 'black key, count 1 2 3 4... black key', after which I should be able to play with the result all sorts of ways!

On Tue, Apr 21, 2015 at 8:15 AM, Michael Gogins <michael.gogins@gmail.com> wrote:

What operating  system do you use for Csound?

Also, what is it you are trying to do? What kind of music, score, algorithm? Live, not live? Interactive, non-interactive?

Regards,
Mike


------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here



Date2015-04-22 05:46
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  
Jacob Joaquin -- re your comment that PythonScore wouldn't work all that well with pyrun within an orchestra --

It should work to generate a csound score (or any number of same) in python running outside csound; mido would do to receive and time incoming midi notes... and new chunks of score could be sent via '-L' as fast as they were generated, well in advance of when I'd need them.

Whatever latency might be involved in python receiving events ... wouldn't that be a constant delay that could be compensated for in setting start times for score events I intend to delay somewhat anyway?

Date2015-04-25 23:54
FromForrest Curo
SubjectRe: python question re pysco...
AttachmentsNone  None  
I think I do have what I want now...

in the .csd file:
-L testfif
  and in instrument 1 there:
  fprints "ins1", "(%f, %f, %f, %f)\n",itim,iquot,imod,impy
  sends the parameters I want out

to a python program with the lines:
import time
fifo=open("ins1", "r")
while 1:
  line=fifo.readline()
  if line == '':
    time.sleep(.005) # wait 1/200th of a second
  else:
 ...

The .csd receives and plays midi notes from channel 1,
sends the time etc, out through the fifo 'ins1' to the python program,
which can then send new note strings based on that timing
back to csound via the fifo 'testfif'.

No need to call any external binary inside the <CsScore> section!

On Tue, Apr 21, 2015 at 9:46 PM, Forrest Curo <treegestalt@gmail.com> wrote:
Jacob Joaquin -- re your comment that PythonScore wouldn't work all that well with pyrun within an orchestra --

It should work to generate a csound score (or any number of same) in python running outside csound; mido would do to receive and time incoming midi notes... and new chunks of score could be sent via '-L' as fast as they were generated, well in advance of when I'd need them.

Whatever latency might be involved in python receiving events ... wouldn't that be a constant delay that could be compensated for in setting start times for score events I intend to delay somewhat anyway?


Date2015-04-26 19:20
FromDavid Worrall
SubjectRe: python question re pysco...
AttachmentsNone  None  
Hi Forrest,

I have not been following your thread so forgive me if I am off-target.

csound's fprints will write to a FIFO ( a named pipe ) if it exists.
If it doesn't exist a fprints will create an 'ordinary' file.

However (maybe depending on the OS) I think such a write is blocking, so it needs to be read before csound can proceed.

You can create the pipe in python using  subprocess.call(["mkfifo", "ins1"])
or perhaps you need to use  subprocess.Popen()  (see https://docs.python.org/2/library/subprocess.html)
then  subprocess.Popen().communicate()

I'd use multiprocessing.Process() to manage the while 1 loop
and, given that everything in the FIFO is already late, use readlines() not readline().

cheers,

David


On 26.04.2015, at 00:54, Forrest Curo <treegestalt@gmail.com> wrote:

I think I do have what I want now...

in the .csd file:
-L testfif
  and in instrument 1 there:
  fprints "ins1", "(%f, %f, %f, %f)\n",itim,iquot,imod,impy
  sends the parameters I want out

to a python program with the lines:
import time
fifo=open("ins1", "r")
while 1:
  line=fifo.readline()
  if line == '':
    time.sleep(.005) # wait 1/200th of a second
  else:
 ...

The .csd receives and plays midi notes from channel 1,
sends the time etc, out through the fifo 'ins1' to the python program,
which can then send new note strings based on that timing
back to csound via the fifo 'testfif'.

No need to call any external binary inside the <CsScore> section!

On Tue, Apr 21, 2015 at 9:46 PM, Forrest Curo <treegestalt@gmail.com> wrote:
Jacob Joaquin -- re your comment that PythonScore wouldn't work all that well with pyrun within an orchestra --

It should work to generate a csound score (or any number of same) in python running outside csound; mido would do to receive and time incoming midi notes... and new chunks of score could be sent via '-L' as fast as they were generated, well in advance of when I'd need them.

Whatever latency might be involved in python receiving events ... wouldn't that be a constant delay that could be compensated for in setting start times for score events I intend to delay somewhat anyway?

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y_______________________________________________
Csound-users mailing list
Csound-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

______________________________________
Prof. Dr. David Worrall
Emerging Audio Research (EAR)
Audio Department
International Audio Laboratories Erlangen
Fraunhofer-Institut für Integrierte Schaltungen IIS
Am Wolfsmantel 33
91058 Erlangen
Telefon  +49 (0) 91 31 / 7 76-62 44
Fax      +49 (0) 91 31 / 7 76-20 99
E-Mail: david.worrall@iis.fraunhofer.de
www: iis.fraunhofer.de 
---
Adjunct Senior Research Fellow
School of Music, Australian National University