Csound Csound-dev Csound-tekno Search About

[Csnd] printing messages

Date2009-12-18 17:01
Fromfrancibal
Subject[Csnd] printing messages
Hi dear All,
i would like to know how can i print in csound console a real time control
value with a name, i.e. like printk2 that print a value only when it change,
but with a name or string before value.
I have try with named instrument, but in console it print only instr number.
I would have something like "Pan [value]" when i change this value by an
external midi controller.

Thanks,
ciao,

fran.

Date2009-12-18 21:57
FromOeyvind Brandtsegg
Subject[Csnd] Re: printing messages
something like:

Stest sprintfk "Pan %d", kPan
puts Stest, kPan

not tested
Oeyvind


2009/12/18 francibal :
>
> Hi dear All,
> i would like to know how can i print in csound console a real time control
> value with a name, i.e. like printk2 that print a value only when it change,
> but with a name or string before value.
> I have try with named instrument, but in console it print only instr number.
> I would have something like "Pan [value]" when i change this value by an
> external midi controller.
>
> Thanks,
> ciao,
>
> fran.
>
> --
> View this message in context: http://old.nabble.com/printing-messages-tp26846400p26846400.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
>
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


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

Date2009-12-19 10:05
FromDavid Akbari
Subject[Csnd] Re: Re: printing messages
Hi Fran,

It sure has been a while since I've had a chance to use Csound, but
this is my interpretation of your example as you describe it.

This instrument takes CC 10 (GM Pan) on MIDI channel 1 as the
continuous controller for pan position. This is a simple pan and not a
constant power or equal weighted pan. At first I wanted to make just a
bare bones example, but when I actually got out my MIDI controller it
ended up being something more musical, which Dr. B always encouraged
us to make in our examples :)

The key concept is using the "changed" opcode as the input to
"trigger" so it only prints when you are moving the controller (and on
initialization). I hope the inclusion of "massign" and "ctrlinit"
doesn't throw you, those aren't technically necessary but many of my
professors from Berklee would frown if I didn't include reasonable
defaults in any instruments :)

Tested on Linux. You may need to alter CsOptions to suit other OSes. I
wish you the best of luck in your sound explorations with Csound.
Hopefully it helps aid the learning process about what goes into the
sounds behind the music in ways commercial software cannot do as
easily. I

Of course there are ways to improve this. You might consider some
reasonable enveloping strategy, and to implement a more pleasing pan
algorithm like the constant power technique described in the text by
Dr. Curtis Roads or The Csound Book by Dr. Boulanger and colleagues.
You might find other ways to improve this to suit your individual
needs, and I hope you do.


Good luck and happy Csounding,

David Akbari




-m0 -odac -iadc -d -b128 -B256 -Mhw:2,0 -+rtaudio=alsa -+rtmidi=alsa



sr	=	44100
ksmps	=	128
nchnls	=	2
massign 1, 1
ctrlinit 1, 10, 64

/*---	---*/

		instr	1

iamp ampmidi 12000
icps cpsmidi

kpanval ctrl7	1, 10, 0, 127
kpan	= kpanval/127

kchang changed kpanval
ktrig trigger kchang, 0, 0

aosc1	vco2	iamp/2, icps-0.02, 10
aosc2	vco2	iamp/2, icps+0.02, 10
aosc	sum	aosc1, aosc2
alpf	butlp	aosc, 3200

	printf "Pan [%f]\n", ktrig, kpan

aoutL = alpf * (1-kpan)
aoutR = alpf * kpan

	outs	aoutL, aoutR

		endin

/*---	---*/


f0 3600





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

Date2009-12-21 10:17
Fromfrancibal
Subject[Csnd] printing messages
Hi Mr. Oeyvind,
thanks, Your example work very well (on windows). Exactly what i need.

Hi Mr. David,
thanks for Your answer and for Your explanation, i'm working on Your
example, and that is study (i.e. a way to understand).
And thanks for Your words. It's always nice to feel how many passion there
is about csound and
music out there!

ciao from an italian hermit

fran.



David Akbari wrote:
> 
> Hi Fran,
> 
> It sure has been a while since I've had a chance to use Csound, but
> this is my interpretation of your example as you describe it.
> 
> This instrument takes CC 10 (GM Pan) on MIDI channel 1 as the
> continuous controller for pan position. This is a simple pan and not a
> constant power or equal weighted pan. At first I wanted to make just a
> bare bones example, but when I actually got out my MIDI controller it
> ended up being something more musical, which Dr. B always encouraged
> us to make in our examples :)
> 
> The key concept is using the "changed" opcode as the input to
> "trigger" so it only prints when you are moving the controller (and on
> initialization). I hope the inclusion of "massign" and "ctrlinit"
> doesn't throw you, those aren't technically necessary but many of my
> professors from Berklee would frown if I didn't include reasonable
> defaults in any instruments :)
> 
> Tested on Linux. You may need to alter CsOptions to suit other OSes. I
> wish you the best of luck in your sound explorations with Csound.
> Hopefully it helps aid the learning process about what goes into the
> sounds behind the music in ways commercial software cannot do as
> easily. I
> 
> Of course there are ways to improve this. You might consider some
> reasonable enveloping strategy, and to implement a more pleasing pan
> algorithm like the constant power technique described in the text by
> Dr. Curtis Roads or The Csound Book by Dr. Boulanger and colleagues.
> You might find other ways to improve this to suit your individual
> needs, and I hope you do.
> 
> 
> Good luck and happy Csounding,
> 
> David Akbari
> 
> 
> 
> 
> -m0 -odac -iadc -d -b128 -B256 -Mhw:2,0 -+rtaudio=alsa -+rtmidi=alsa
> 
> 
> 
> sr	=	44100
> ksmps	=	128
> nchnls	=	2
> massign 1, 1
> ctrlinit 1, 10, 64
> 
> /*---	---*/
> 
> 		instr	1
> 
> iamp ampmidi 12000
> icps cpsmidi
> 
> kpanval ctrl7	1, 10, 0, 127
> kpan	= kpanval/127
> 
> kchang changed kpanval
> ktrig trigger kchang, 0, 0
> 
> aosc1	vco2	iamp/2, icps-0.02, 10
> aosc2	vco2	iamp/2, icps+0.02, 10
> aosc	sum	aosc1, aosc2
> alpf	butlp	aosc, 3200
> 
> 	printf "Pan [%f]\n", ktrig, kpan
> 
> aoutL = alpf * (1-kpan)
> aoutR = alpf * kpan
> 
> 	outs	aoutL, aoutR
> 
> 		endin
> 
> /*---	---*/
> 
> 
> f0 3600
> 
> 
> 
> 
> 
> Send bugs reports to this list.
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
> 
>