[Csnd] stdin with -L
Date | 2011-08-15 10:24 |
From | francesco |
Subject | [Csnd] stdin with -L |
Hello all, using -L for reading stdin in terminal (on linux). I am experimenting, and i have try to use a macro definition in score for semplifying typing, i.e. something like this: #define I #i 1 0 10 0.3 6.00#, and instead of type all the line i 1 0 ecc. i could only type I (or $I). But this is not working unknown opcode $ illegal RT scoreline: Is there a way to make this? (i'm really not an expert on linux ...). thanks, ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/stdin-with-L-tp4700392p4700392.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-15 11:14 |
From | Victor Lazzarini |
Subject | Re: [Csnd] stdin with -L |
I don't think this will work because macros are only evaluated by the score preprocessor. Victor On 15 Aug 2011, at 10:24, francesco wrote: > Hello all, > using -L for reading stdin in terminal (on linux). > I am experimenting, and i have try to use a macro definition in > score for > semplifying typing, > i.e. something like this: #define I #i 1 0 10 0.3 6.00#, and instead > of type > all the line i 1 0 ecc. > i could only type I (or $I). But this is not working > unknown opcode $ > illegal RT scoreline: > > Is there a way to make this? (i'm really not an expert on linux ...). > > thanks, > ciao, > francesco. > > > -- > View this message in context: http://csound.1045644.n5.nabble.com/stdin-with-L-tp4700392p4700392.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound" > Dr Victor Lazzarini Senior Lecturer Dept. of Music NUI Maynooth Ireland tel.: +353 1 708 3545 Victor dot Lazzarini AT nuim dot ie Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-15 12:09 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Csnd] stdin with -L |
> I don't think this will work because macros are only evaluated by the > score preprocessor. > > Victor You need to pipe your score statement sthrough a macro expander. Would be "easy" to create one but afaik there is not one extant at present. ==John ff Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-15 15:01 |
From | francesco |
Subject | [Csnd] Re: stdin with -L |
thanks, if i have understand when Csound is running with -L is only possible to send a complete score statement, and no (csound) macro is possible (because macro expansion happen at compile time); no other possibilitie to use some macro definite, for example, in bash or other language? What do You mean with macro expander? I have try to define a string variable in bash, but don't work because is like if i try to use bash in a csound environment, i.e. csound don't know about bash. Can i use pipe (and how)? Apologies for trivial question, Thanks, ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/stdin-with-L-tp4700392p4701104.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-18 09:59 |
From | David Banks |
Subject | [Csnd] Re: stdin with -L |
On 15/08/11 15:01, francesco wrote: > if i have understand when Csound is running with -L is only possible to send > a complete score statement, and no (csound) macro is possible (because macro > expansion happen at compile time); > no other possibilitie to use some macro definite, for example, in bash or > other language? > What do You mean with macro expander? I have try to define a string variable > in bash, but don't work because is like if i try to use bash in a csound > environment, i.e. csound don't know about bash. > Can i use pipe (and how)? Untested, but maybe you can use M4: $ m4 | csound -L changequote([, ]) define(_I, [i 1 0 10 0.3 6.00]) Now if you just enter "_I", you should get the score event. M4 can do a lot more than this but it's pretty arcane. [You might need 'dnl' after each line if csound doesn't ignore blank lines] Cheers, David Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-18 13:56 |
From | francesco |
Subject | [Csnd] Re: stdin with -L |
Thank Mr David, a first attempt seem not working, but i will try to understand m4 (that i did not know). I will then try again. ciao, francesco. -- View this message in context: http://csound.1045644.n5.nabble.com/stdin-with-L-tp4700392p4711977.html Sent from the Csound - General mailing list archive at Nabble.com. Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |
Date | 2011-08-19 18:31 |
From | Tobiah |
Subject | Re: [Csnd] stdin with -L |
On 08/15/2011 02:24 AM, francesco wrote: > Hello all, > using -L for reading stdin in terminal (on linux). > I am experimenting, and i have try to use a macro definition in score for > semplifying typing, > i.e. something like this: #define I #i 1 0 10 0.3 6.00#, and instead of type > all the line i 1 0 ecc. > i could only type I (or $I). But this is not working > unknown opcode $ You will really want to write a simple script in bash or python or perl that takes the input that you do wish to type, and formats it into a valid score line and prints it out. Here is one in bash: desktops:toby:custom(1)> cat foo while echo -n "Enter p5: " ; read foo; do echo "i1 0 2 10000 $foo" done desktops:toby:custom(1)> . foo Enter p5: 344 i1 0 2 10000 344 Enter p5: 400 i1 0 2 10000 400 Enter p5: 410 i1 0 2 10000 410 Enter p5: 500 i1 0 2 10000 500 Tobiah Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" |