Csound Csound-dev Csound-tekno Search About

[Csnd] Setting chani/chano software bus from within the score

Date2009-10-26 19:21
Fromthunk
Subject[Csnd] Setting chani/chano software bus from within the score
Hi list,

I'm looking for a way to write to the chani/chano software bus from within
the score. I'm writing a csound sequencer in Lisp, and using that bus to
send in automation data. I've had a lot of success so far, but now I'm
working on exporting csd's of compositions, and I need a way to represent
the chani automation data within the score.

Any suggestions would be greatly appreciated.

Thanks in advance,
Luke

Date2009-10-27 20:00
FromThunk Out
Subject[Csnd] Re: Setting chani/chano software bus from within the score
Ok, I think I understand my problem a little better now.

I've avoided using the named software bus so far because I was having a tough time figuring out how to use the Lisp CFFI to the API to write directly to that bus. But I think I can avoid having to do that with something like:

instr 100
  chnset p4, p5
endin

And then send automation data from the host into csound as i100 statements with csoundInputMessage (rather than csoundScoreEvent, because the pfields will contain the channel name string). That way, when I go to generate a csd from a composition, all the automation data is already in statement form. Does that make sense, or am I misunderstanding something? Or has anyone had any success directly setting the bus from Lisp?

Thanks,
Luke


Date2009-10-27 20:20
Fromvictor
Subject[Csnd] Re: Re: Setting chani/chano software bus from within the score
I would have thought there was a simpler way of doing this. Did you ever think of storing
the automation data in the CSD as hex-encoded files? I have never done this, but I know
it's possible (there are a couple of utilities to do it).
 
Victor
----- Original Message -----
From: Thunk Out
Sent: Tuesday, October 27, 2009 8:00 PM
Subject: [Csnd] Re: Setting chani/chano software bus from within the score

Ok, I think I understand my problem a little better now.

I've avoided using the named software bus so far because I was having a tough time figuring out how to use the Lisp CFFI to the API to write directly to that bus. But I think I can avoid having to do that with something like:

instr 100
  chnset p4, p5
endin

And then send automation data from the host into csound as i100 statements with csoundInputMessage (rather than csoundScoreEvent, because the pfields will contain the channel name string). That way, when I go to generate a csd from a composition, all the automation data is already in statement form. Does that make sense, or am I misunderstanding something? Or has anyone had any success directly setting the bus from Lisp?

Thanks,
Luke


Date2009-10-27 20:55
Fromvictor
Subject[Csnd] Re: Re: Re: Setting chani/chano software bus from within the score
Some more details about this, from the manual:
 
1. you encode files with the 'csb64enc' utility
2. A CSD file can then be built with 'makecsd', files will be
included in the CSD.
 
when you run csound, files are decoded to the local directory and
deleted after performance. That's it; I have not tested this, but it should work.
 
Victor
 
 
----- Original Message -----
From: victor
Sent: Tuesday, October 27, 2009 8:20 PM
Subject: [Csnd] Re: Re: Setting chani/chano software bus from within the score

I would have thought there was a simpler way of doing this. Did you ever think of storing
the automation data in the CSD as hex-encoded files? I have never done this, but I know
it's possible (there are a couple of utilities to do it).
 
Victor
----- Original Message -----
From: Thunk Out
Sent: Tuesday, October 27, 2009 8:00 PM
Subject: [Csnd] Re: Setting chani/chano software bus from within the score

Ok, I think I understand my problem a little better now.

I've avoided using the named software bus so far because I was having a tough time figuring out how to use the Lisp CFFI to the API to write directly to that bus. But I think I can avoid having to do that with something like:

instr 100
  chnset p4, p5
endin

And then send automation data from the host into csound as i100 statements with csoundInputMessage (rather than csoundScoreEvent, because the pfields will contain the channel name string). That way, when I go to generate a csd from a composition, all the automation data is already in statement form. Does that make sense, or am I misunderstanding something? Or has anyone had any success directly setting the bus from Lisp?

Thanks,
Luke


Date2009-10-27 22:04
FromThunk Out
Subject[Csnd] Re: Re: Re: Re: Setting chani/chano software bus from within the score
Thanks for your response, Victor.

I hadn't considered the posibility of including binary data right in the csd. That'll certainly come in handy at some point to include samples in a stand-alone csd. As far as the automation data, though, in this case it isn't MIDI, it's Lisp objects, so I think my best bet is probably to store it as i statements. Unless I'm misunderstanding you somehow, which could very well be the case since I'm still relatively new to this :)

Luke

On Tue, Oct 27, 2009 at 4:55 PM, victor <Victor.Lazzarini@nuim.ie> wrote:
Some more details about this, from the manual:
 
1. you encode files with the 'csb64enc' utility
2. A CSD file can then be built with 'makecsd', files will be
included in the CSD.
 
when you run csound, files are decoded to the local directory and
deleted after performance. That's it; I have not tested this, but it should work.
 
Victor
 
 
----- Original Message -----
From: victor
Sent: Tuesday, October 27, 2009 8:20 PM
Subject: [Csnd] Re: Re: Setting chani/chano software bus from within the score

I would have thought there was a simpler way of doing this. Did you ever think of storing
the automation data in the CSD as hex-encoded files? I have never done this, but I know
it's possible (there are a couple of utilities to do it).
 
Victor
----- Original Message -----
From: Thunk Out
Sent: Tuesday, October 27, 2009 8:00 PM
Subject: [Csnd] Re: Setting chani/chano software bus from within the score

Ok, I think I understand my problem a little better now.

I've avoided using the named software bus so far because I was having a tough time figuring out how to use the Lisp CFFI to the API to write directly to that bus. But I think I can avoid having to do that with something like:

instr 100
  chnset p4, p5
endin

And then send automation data from the host into csound as i100 statements with csoundInputMessage (rather than csoundScoreEvent, because the pfields will contain the channel name string). That way, when I go to generate a csd from a composition, all the automation data is already in statement form. Does that make sense, or am I misunderstanding something? Or has anyone had any success directly setting the bus from Lisp?

Thanks,
Luke



Date2009-10-27 22:54
Fromvictor
Subject[Csnd] Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score
But if it's a Lisp script, why do you want to store it as i-statement and not in a lisp source file?
I think I don't understand exactly what you want to do.
 
Victor
----- Original Message -----
From: Thunk Out
Sent: Tuesday, October 27, 2009 10:04 PM
Subject: [Csnd] Re: Re: Re: Re: Setting chani/chano software bus from within the score

Thanks for your response, Victor.

I hadn't considered the posibility of including binary data right in the csd. That'll certainly come in handy at some point to include samples in a stand-alone csd. As far as the automation data, though, in this case it isn't MIDI, it's Lisp objects, so I think my best bet is probably to store it as i statements. Unless I'm misunderstanding you somehow, which could very well be the case since I'm still relatively new to this :)

Luke

On Tue, Oct 27, 2009 at 4:55 PM, victor <Victor.Lazzarini@nuim.ie> wrote:
Some more details about this, from the manual:
 
1. you encode files with the 'csb64enc' utility
2. A CSD file can then be built with 'makecsd', files will be
included in the CSD.
 
when you run csound, files are decoded to the local directory and
deleted after performance. That's it; I have not tested this, but it should work.
 
Victor
 
 
----- Original Message -----
From: victor
Sent: Tuesday, October 27, 2009 8:20 PM
Subject: [Csnd] Re: Re: Setting chani/chano software bus from within the score

I would have thought there was a simpler way of doing this. Did you ever think of storing
the automation data in the CSD as hex-encoded files? I have never done this, but I know
it's possible (there are a couple of utilities to do it).
 
Victor
----- Original Message -----
From: Thunk Out
Sent: Tuesday, October 27, 2009 8:00 PM
Subject: [Csnd] Re: Setting chani/chano software bus from within the score

Ok, I think I understand my problem a little better now.

I've avoided using the named software bus so far because I was having a tough time figuring out how to use the Lisp CFFI to the API to write directly to that bus. But I think I can avoid having to do that with something like:

instr 100
  chnset p4, p5
endin

And then send automation data from the host into csound as i100 statements with csoundInputMessage (rather than csoundScoreEvent, because the pfields will contain the channel name string). That way, when I go to generate a csd from a composition, all the automation data is already in statement form. Does that make sense, or am I misunderstanding something? Or has anyone had any success directly setting the bus from Lisp?

Thanks,
Luke



Date2009-10-28 00:56
FromThunk Out
Subject[Csnd] Re: Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score
Sorry, I didn't do a very good job of explaining the situation. I've written what could I guess be called a csound sequencer/Lisp composition environment, which I'll be releasing under a free software license soon. It allows you to compose music graphically in a windowing and keybinding environment modeled after emacs. It also includes a domain-specific language for writing csound code in Lisp. It stores project files in its own format. It runs csound in realtime and schedules notes for playback by calling csoundScoreEvent. Mixer and effect automation events are currently sent to the csound instance over the numbered software bus by calling csoundChaniKSet, and read with the chani opcode.

What I'm trying to add now is the ability to export a csd of the composition that can be run through csound completely independently of my software, sort of as a last resort backup measure and an easy way to render audio files. Now, generating the score code for the notes is simple, since they're already being sent to the csound instance as events via csoundScoreEvent [1]. But mixer and effect automation events are a problem because they're currently being sent to the instance over the software bus, and don't have an obvious representation in the csd like notes do.

What I'm looking for is the simplest way to represent software bus events in a csd file. I was hoping there was an opcode that could send data to chani, which I would then wrap in an instrument and call from the score, but I don't think there is such an opcode. So I'm currently planning on converting from the numbered to the named software bus and writing to it from the score via a chnset instrument.

Does that make sense, or am I missing something obvious?

Thanks again for your help,
Luke

[1] Notes are implemented as a series of tied i stmts, allowing every parameter of every note to be automated independently by animating a pfield's value over successive frames of the note.

Date2009-10-28 04:17
FromSteven Yi
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score
Hi Luke,

Just thought I'd mention in my software blue that it does automation
by score or by named channels, depending if using the API and
rendering in realtime or creating a CSD.  For CSD, blue generates
instrument that write values to global k-signals that instruments
read.  It may look ugly if you look at the CSD but it's efficient.
Also, there is no need for tied notes, as the signal is global so will
maintain state when not being modified.  This allows to generate notes
to automate signal only when necessary.  This is an example of a
generated parameter automation instrument in blue:

	instr 29	;Param: Volume
if (p4 == p5) then
gk_blue_auto20 init p4
turnoff
else
gk_blue_auto20 line p4, p3, p5
endif
	endin

This instrument allows instantaneous change or linear change over
duration of the note.

Not sure if this is useful for your work but thought I'd mention it.

steven

On Tue, Oct 27, 2009 at 8:56 PM, Thunk Out  wrote:
> Sorry, I didn't do a very good job of explaining the situation. I've written
> what could I guess be called a csound sequencer/Lisp composition
> environment, which I'll be releasing under a free software license soon. It
> allows you to compose music graphically in a windowing and keybinding
> environment modeled after emacs. It also includes a domain-specific language
> for writing csound code in Lisp. It stores project files in its own format.
> It runs csound in realtime and schedules notes for playback by calling
> csoundScoreEvent. Mixer and effect automation events are currently sent to
> the csound instance over the numbered software bus by calling
> csoundChaniKSet, and read with the chani opcode.
> What I'm trying to add now is the ability to export a csd of the composition
> that can be run through csound completely independently of my software, sort
> of as a last resort backup measure and an easy way to render audio files.
> Now, generating the score code for the notes is simple, since they're
> already being sent to the csound instance as events via csoundScoreEvent
> [1]. But mixer and effect automation events are a problem because they're
> currently being sent to the instance over the software bus, and don't have
> an obvious representation in the csd like notes do.
> What I'm looking for is the simplest way to represent software bus events in
> a csd file. I was hoping there was an opcode that could send data to chani,
> which I would then wrap in an instrument and call from the score, but I
> don't think there is such an opcode. So I'm currently planning on converting
> from the numbered to the named software bus and writing to it from the score
> via a chnset instrument.
> Does that make sense, or am I missing something obvious?
> Thanks again for your help,
> Luke
> [1] Notes are implemented as a series of tied i stmts, allowing every
> parameter of every note to be automated independently by animating a
> pfield's value over successive frames of the note.


Send bugs reports to this list.
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2009-10-28 04:45
FromThunk Out
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score
Thanks Steven, that is very helpful. I think I'm going to do the mixer automation exactly as you described. It was silly of me not to look at how Blue accomplished this first.

Luke


Date2009-10-28 11:46
FromMichael Gogins
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score

Also the opcode you described could be written.

Mlg

On Oct 28, 2009 12:46 AM, "Thunk Out" <thunkout@gmail.com> wrote:

Thanks Steven, that is very helpful. I think I'm going to do the mixer automation exactly as you described. It was silly of me not to look at how Blue accomplished this first.

Luke


Date2009-10-28 13:47
FromThunk Out
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Setting chani/chano software bus from within the score
That's true, too. I'd need to brush up on my C to attempt it. The nice thing about chani/chano is they're dead simple to use from the API.

Luke