Csound Csound-dev Csound-tekno Search About

[Csnd] Forward score written in the orchestra

Date2019-10-17 14:02
From"Jeanette C."
Subject[Csnd] Forward score written in the orchestra
Hey hey,
is there a way to start a score, written with schedule in the orchestra, at a 
certain point? Consider this:

instr Scorer
   schedule "Tone" 0 1 330
   schedule "Tone" 3 1 440
   schedule "Noise" 5 1
endin

Is there an easy, short way to start this score with the Noise instrument at 5 
seconds?

If I'm barking up the wrong tree, this is the scenario. I am developing a long 
piece, mostly created from shorter notes. I'd like to validate the score/piece 
as it develops. For that purpose I don't need to hear the whole piece, but 
only the last few events (instrument calls).

I use schedule inside the orcestray, so global variables can be passed as 
parameters to instruments, thus making the code more readable and manageable.

Thanks for any hints and best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

When you need someone, you just turn around and I will be there <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-10-17 14:59
FromSteven Yi
SubjectRe: [Csnd] Forward score written in the orchestra
Hi Jeanette,

There is not away I'm aware of directly since the Csound doesn't know
what you'll do at runtime for event generation.  What I've been
recommending is:

1. Use score generating instruments in the orchestra for composing
soundobjects, phrases, parts, sections, etc.
2. Use notes in the score to schedule larger time organizations
(phrases, parts, sections)
3. Keep -+skip_seconds=xxx in CsOptions and modify if you want to
start rendering from a given start time.

Using just score is handy because -+skip_seconds can be advance like
one would expect in a DAW.  But using score generating instrument is
great for organization and algorithmic composition. Also, if you have
a live coding setup, you can edit and trigger parts and sections
easily while things are running to iterate faster than having to
restart the CSD. I actually found live coding for composing (rather
than performance) made working on a few pieces really pleasant and I
could jump between sections or hear just parts by evaluating code for
parts I wanted to hear.

Hope that helps!
Steven




On Thu, Oct 17, 2019 at 9:01 AM Jeanette C.  wrote:
>
> Hey hey,
> is there a way to start a score, written with schedule in the orchestra, at a
> certain point? Consider this:
>
> instr Scorer
>    schedule "Tone" 0 1 330
>    schedule "Tone" 3 1 440
>    schedule "Noise" 5 1
> endin
>
> Is there an easy, short way to start this score with the Noise instrument at 5
> seconds?
>
> If I'm barking up the wrong tree, this is the scenario. I am developing a long
> piece, mostly created from shorter notes. I'd like to validate the score/piece
> as it develops. For that purpose I don't need to hear the whole piece, but
> only the last few events (instrument calls).
>
> I use schedule inside the orcestray, so global variables can be passed as
> parameters to instruments, thus making the code more readable and manageable.
>
> Thanks for any hints and best wishes,
>
> Jeanette
>
> --
>   * Website: http://juliencoder.de - for summer is a state of sound
>   * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>   * SoundCloud: https://soundcloud.com/jeanette_c
>   * Twitter: https://twitter.com/jeanette_c_s
>   * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>   * GitHub: https://github.com/jeanette-c
>
> When you need someone, you just turn around and I will be there <3
> (Britney Spears)
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-10-17 15:13
From"Jeanette C."
SubjectRe: [Csnd] Forward score written in the orchestra
Hi Steven,
thanks for your remarks. For the current organisation of code your manner of 
working is not applicable, but it is something to keep in mind.

Do I remeber correctly that you did live-coding using vim? Searching for 
live-coding and Csound comes up with web-based and highly graphical 
approaches, which are - alas - impossible for me.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

When you need someone, you just turn around and I will be there <3
(Britney Spears)

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-10-17 15:52
FromSteven Yi
SubjectRe: [Csnd] Forward score written in the orchestra
Attachmentsscore_organization.csd  
I put together an example in case others might be interested. The
example just plays some arpeggios that start at different times. For
convenience I set the tempo to 120 to make skip_seconds easy to work
with. You can try rendering this as-is, then modifying -+skip_seconds
value to 2, 4, 6, etc. to jump ahead.

For live coding and Vim I use this plugin:

https://github.com/kunstmusik/csound-repl

Documentation is accessible within vim and available to read at:

https://github.com/kunstmusik/csound-repl/blob/master/doc/csound-repl.txt

Sidenote: Forrest has been contributing some great changes for running
Csound from Visual Studio Code. I imagine adding live coding features
in VS Code won't be too difficult.


On Thu, Oct 17, 2019 at 10:12 AM Jeanette C.  wrote:
>
> Hi Steven,
> thanks for your remarks. For the current organisation of code your manner of
> working is not applicable, but it is something to keep in mind.
>
> Do I remeber correctly that you did live-coding using vim? Searching for
> live-coding and Csound comes up with web-based and highly graphical
> approaches, which are - alas - impossible for me.
>
> Best wishes,
>
> Jeanette
>
> --
>   * Website: http://juliencoder.de - for summer is a state of sound
>   * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>   * SoundCloud: https://soundcloud.com/jeanette_c
>   * Twitter: https://twitter.com/jeanette_c_s
>   * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>   * GitHub: https://github.com/jeanette-c
>
> When you need someone, you just turn around and I will be there <3
> (Britney Spears)
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2019-10-17 23:18
FromPete Goodeve
Subject[Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone  

Date2019-10-17 23:46
FromSteven Yi
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
Not sure, just tested here on OSX and worked fine with csound and --port=10000.  Using vim 8.1.2150.  If I use "nc -ul 10000" I don't get newlines but that doesn't matter really, Csound receives the data and executes it just fine.

If the <leader>eo is called, it evaluates either a single line (if outside of an instr or opcode block), or the whole instr or opcode block if within it. Otherwise, you can use visual mode to select the text you want to evaluate and call <leader>eo. 

If you're trying this out and Csound isn't getting anything, since netcat is receiving packets just fine, it might be that networking code isn't working correctly with your build of Csound. You're on Haiku, yes? Maybe there is a problem with the Haiku build and networking?


On Thu, Oct 17, 2019 at 6:18 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Thu, Oct 17, 2019 at 10:52:14AM -0400, Steven Yi wrote:
>
> For live coding and Vim I use this plugin:
>
> https://github.com/kunstmusik/csound-repl
>
I downloaded this a week or so ago, but I'm afraid I can't make
it work as advertised.  Luis Jure's version of csound.vim seems fine,
but --although it sends to port 10000 -- your code doesn't seem
to send what it should.  (I'm using netcat to receive, rather than
Csound itself, so I can check what's happening.)

If I open a csd file and go to the Instruments section,  then place
the cursor on a global line and hit '\eo', it transmits that line, but
with no terminating newline.  Succeeding transmissions just
concatenate.

Your instructions state (and looking at the code as far as I understand
it it should), if I move the cursor inside an instrument, send that
whole instrument.  This never happens -- just the line as before.

I'm using vim 8.1 (May '18 it seems) and of course it has python enabled.

Any clues?

Thanks,
        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-10-18 00:50
FromPete Goodeve
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone  

Date2019-10-18 03:15
FromSteven Yi
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
Well, "*supposed* to have" is a bit much. It does have it and it works here. I haven't changed the code in a while and ran this with vim on Windows and Linux too.

Are you actually within an instr or opcode block?  (as in, not on the lines that start with instr or endin, or the ones that start with opcode or endop, but the ones in-between?)  The code could certainly be improved to work when on the instr/endin or opcode/endop lines, but otherwise its working as documented.

What do you see shown in netcat?





On Thu, Oct 17, 2019 at 7:50 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Thu, Oct 17, 2019 at 06:46:22PM -0400, Steven Yi wrote:
> Not sure, just tested here on OSX and worked fine with csound and
> --port=10000.  Using vim 8.1.2150.  If I use "nc -ul 10000" I don't get
> newlines but that doesn't matter really, Csound receives the data and
> executes it just fine.
Oh, yeah -- I guess Csound just processes the packet.
>
> If the <leader>eo is called, it evaluates either a single line (if outside
> of an instr or opcode block), or the whole instr or opcode block if within
> it. Otherwise, you can use visual mode to select the text you want to
> evaluate and call <leader>eo.
>
This is what just doesn't work for me.  Wherever I put the cursor
it just sends that line.  I double-checked that it isn't an artefact of nc
by using "csound -v..." and seeing what it actually processed; it's just
the one line.

> If you're trying this out and Csound isn't getting anything, since netcat
> is receiving packets just fine, it might be that networking code isn't
> working correctly with your build of Csound. You're on Haiku, yes? Maybe
> there is a problem with the Haiku build and networking?
>
I'm usually using Haiku, yes, but again to double check I went to Linux (Mint)
and it's exactly the same.  Maybe it's Mac that's weird...? (:-))

I actually have my own Live-Code setup using my own "connect-the-boxes"
software (and nc to Csound), and it works well.  It just doesn't have that
"select the entire instrument" feature that the vim plugin is *supposed* to have!

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-10-18 03:23
FromPete Goodeve
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone  

Date2019-10-18 03:27
FromPete Goodeve
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone  

Date2019-10-18 05:26
FromSteven Yi
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
No worries, thanks for figuring out the issue there. I suppose I never use this with anything besides things I write so it never dawned on me about indents.  I filed an issue here to follow up on changes:


Shouldn't be too hard to change the regex used for finding the keywords and to improve the code to work if on the keyword lines. Will take a look as soon as time permits.


On Thu, Oct 17, 2019 at 10:27 PM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Thu, Oct 17, 2019 at 10:15:41PM -0400, Steven Yi wrote:
> Well, "*supposed* to have" is a bit much. It does have it and it works
> here. I haven't changed the code in a while and ran this with vim on
> Windows and Linux too.
>
Sorry -- of course our mails crossed!  I wasn't trying to be negative.
I guess I answered everything now..

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-10-18 05:46
FromPete Goodeve
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone  

Date2019-10-27 22:22
FromSteven Yi
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
An update: the issue is now fixed in the csound-repl plugin. The issue had to do with using double-quoted strings instead of single-quoted strings for the regex (oof!). I've also modified the search matching such that if you're on a line with instr, endin, opcode, or endop, it will evaluate now the block.

Thanks Pete for alerting me to the issue.

Steven


On Fri, Oct 18, 2019 at 12:46 AM Pete Goodeve <pete.goodeve@computer.org> wrote:
On Fri, Oct 18, 2019 at 12:26:53AM -0400, Steven Yi wrote:
> No worries, thanks for figuring out the issue there. I suppose I never use
> this with anything besides things I write so it never dawned on me about
> indents.  I filed an issue here to follow up on changes:
>
> https://github.com/kunstmusik/csound-repl/issues/2
>
> Shouldn't be too hard to change the regex used for finding the keywords and
> to improve the code to work if on the keyword lines. Will take a look as
> soon as time permits.
>
And darn it, it's still weird!  I did go into the code to take a look,
and your search term is "^/s*endin", which should find any indented
'endin' perfectly well!  Maybe you can figure out better than I what's
happening.

Anyhow, at least I can make it work now.

Thanks again,

        -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2019-10-28 01:42
Frompete.goodeve@COMPUTER.ORG
SubjectRe: [Csnd] Vim live-coding was Re: [Csnd] Forward score written in the orchestra
AttachmentsNone