Csound Csound-dev Csound-tekno Search About

[Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Date2009-07-08 15:12
From"Art Hunkins"
Subject[Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Hi Stefan,
 
Sorry - again my mistake. The line should be:
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1))
With the .9 value, the note is so low you can't hear it.
 
This line looks at the value of ipedal ( = up or down), and adds .1 of the icps value to it if it's up, or subtracts .1 of its value if the pedal is down (ipedal > 0).
 
I should think you could adjust the fractional value to equal 15 cents; probably the fractions need to be different. Probably someone else on the list can give you an appropriate formula.  
 
Otherwise you'll probably need to arrange your pitch conversion differently. (This could be more difficult because you're doing the conversion via table lookup. Using a direct formula might turn out to be more flexible in this case: e.g., do your fractions or cents with MIDI note numbers, then convert to icps via formula.)
 
Art Hunkins
----- Original Message -----
Sent: Wednesday, July 08, 2009 2:12 AM
Subject: [Csnd] Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear community,
my csd-file works now! I can hear sound, when I play, and the controller number 64 has an audible effect:
if I don't use it, the pitches of note number 61, 63, 66 are higher,
but, if I press it down, I can't hear these notes. I guess I have to define, what has to happen, if the left pedal is down.
There is one more thing, I don't understand:
What exactly does the line
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
do?
What do I have to do, if I want to change the pitch of a given note about e.g. 15 cents?
Thanks again for Your patience,
Stefan

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Without declaring massign, instr1 receives all the channel 1 data; instr2 all of the channel 2 data.
 
In this scenario, you'll need to set channel 2 either on the foot controller itself, or set controller 64 (or whichever) to channel 2 on your keyboard. (The keyboard otherwise outputs on channel 1.)
 
If this is not possible, or doesn't work, next try:
 
Put:
gkpedal ctrl7 1, 64, 0, 1
as the first line of instr 1.
Restore your
massign 0, 1
Remove instr 2 and its note
 
If these don't work, I'd advise going to the alternate method I suggested previously. (I'll also do some actual experimentation of my own at that point.)
 
Art Hunkins 
----- Original Message -----
Sent: Tuesday, July 07, 2009 3:35 AM
Subject: [Csnd] Re: Re: Re: different pitches during a live-midi performance

Dear Art,
many thanks, again, for Your fast answer.
There is one more  thing, I don't understand:
How can I put the foot-controller to channel two?
Or is this already done with
gkpedal ctrl7 2, 64, 0, 1

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Iain is correct (he always is, and you can totally count on his advice regarding realtime). My bad. *Controller* 64 is the foot controller/switch for MIDI.
 
Suggestions:
 
Delete line 14 *as well as 13*.
 
In instrument 2, substitute:
gkpedal ctrl7 2, 64, 0, 1
 
Then play your keyboard on channel 1, but put the foot controller on channel 2. (Alternately, put the foot controller on any channel except #1; number the instrument the same as the channel and give the controller the same number also (e.g., gkpedal ctrl7 10 for channel 10).) This should send all keyboard data to instr 1, pedal data to instr 2.
 
Frankly, I've always had trouble getting insnum to trigger notes, and never use it. If the above doesn't work, I'd try another approach: use an always-on instrument 1 that handles *all* midi input; when noteon's are received, it schedules events (through event or schedkwhen) for instrument 2. Working at k-rate, it also handles pedal-data (as in your i2).
 
All of my live performance works use this principle; you can look at many .csd's at my website, arthunkins.com, if you'd like.
 
Let us know how you get on.
 
Art Hunkins
----- Original Message -----
Sent: Monday, July 06, 2009 3:14 PM
Subject: [Csnd] RE: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Hi Stefan

massign 64, 2

You are assigning MIDI note events on channel 64 to instr 2; but MIDI channels only go from 1-16 (or 0-15).

Bye,
Iain


Date: Mon, 6 Jul 2009 20:01:16 +0200
From: kontrapunktstefan@googlemail.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your anwer.
I guess I changed something in my file, but I dont know what.
Now I get the following error message:
INIT ERROR in instr 0: ? [illegal channel number? [m
?[m massign 64, 2
When I erase the line number 14 in the file, I can hear a sound, but I can't, off course, change any pitch. What I don't understand is:
Is it right, that 64 should be a number of controller, not of a channel?
If so, how can I tell csound this?
Here is, again, the whole file, without german comments.
Thank You very much,
Stefan

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M1 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
ipch = 8.02
iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2
pgmassign  0, 1              ; also all program changes
instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                          ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 && imnn != 63 && imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
skip:

 iamp    ampmidi        10000
; now defining the envelopes

inach = 0.1
;the volume at the end
iend = 0.0000000001

;the time, the partial needs until it reaches its peak
iein = 0.0030
; the different decay times for each partial
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;the volume at the beginning
ianfang = 0.001
;the volume of the reverberation
iweiterkling = 0.00000000000001
;the individual peaks
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;and now: the individual envelopes
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;the frequencies for the partials
ifundamental = icps
ipartialB =icps*2; partial 2
ipartialC = icps*3 ;partial 3
ipartialD = icps*4 ; partial 4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; the score
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/5 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Please tell us which lines are #30 and #31, and what the specific error messages are.
 
If any German commentary is involved, please translate for me; ich verstehe deutsch nicht so gut.
 
I do see one error:
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
(This may be the problem - or one of them.)
 
Art Hunkins
----- Original Message -----
Sent: Sunday, July 05, 2009 12:06 PM
Subject: [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks very much!
I tried out what You suggested to me, but I get always error messages in line 30 and 31.
I don't know what I'm doing wrong, I have to admit, that I don't have enough experiences with the syntax.
It would be great, if You could gove me a hint, one more time!
Thanks,
Stefan
Here is, again, the file ( a little smaller now):

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M2 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2 ;
pgmassign  0, 1              ; also all program changes

instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 and imnn != 63 and imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1)
skip:
 
  iamp    ampmidi        10000
; Hüllkurven definieren
;nachklingzeit
inach = 0.1
;Ende der Lautstartekurve
iend = 0.0000000001 ; für alle die gleiche Endlautstärke

; die  Einschwingzeit für jeden Teilton
iein = 0.0030
;die unterschiedlichen ausschwingzeiten
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;die anfangslautstaerke
ianfang = 0.001
;wie laut klingt der Ton am Ende, nach dem loslassen der Note
iweiterkling = 0.00000000000001
;die unterschiedlichen Maxima der Hüllkurven
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;die Individuellen Hüllkurven für jeden einzelnen Teilton
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;die Frequenzverhältnisse
ifundamental = icps
ipartialB =icps*2; teilton2
ipartialC = icps*3 ;teilton 3
ipartialD = icps*4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/3 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Here's what I'd try:
 
In header:
gkpedal init 0
 
and after your massign:
massign 64, 2
(or whatever controller # your foot pedal is, assign its data to instr 2. The massigns may be tricky.)
You should be able to use any type of foot pedal your MIDI keyboard will accept.
 
Make a completely new instrument that receives MIDI data only on controller 64 (or whichever # you choose):
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
 
The above instrument is always receiving foot controller data.
 
In the score, add:
i2 0 3600
 
In your instr1, add (at beginning):
ipedal = i(gkpedal)
 
and later (after icps computed):
if imnn != 60 and imnn != 62 and notnum ...... igoto skip ; this is a list of *all your black MIDI key numbers*!
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1)
skip:
 
In the above, ".1" is the percentage of the frequency you wish to add or subtract from your "basic pitch" (12tet).
 
You may want to make some other kind of pitch adjustment. For example you might put the low version (freq) of the black key pitch in your table, then multiply it by some factor if the pedal were up (gkpedal == 0):
icps = (ipedal > 0? icps + (icps * .1): icps)
Or perhaps you want different groups of "igoto" branches, where for example all F#'s modify in one way, all G#'s in another.
 
Let me know how it works out for you.
 
Art Hunkins
----- Original Message -----
Sent: Friday, July 03, 2009 3:22 AM
Subject: [Csnd] Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your answer. I have attached a small example to this mail.
I use there a scale with 17 pitches per octave but (as You all know)I do have only 12 pitches per octave on the keyboard.
I would like to allocate the black key two pitches and I would like to change this with the pressure of the una-corda-pedal (the left pedal). While pressing the left pedal down, I would like to get a lower pitch, in the other case, the higher pitch.
But I have no idea, how to do it with csound. So, I really need Your help!
At least I hope, that my idea of negotiating the limitation of 12 pitches per octave in this way will be interesting for other musicians to.
Thanks
Stefan
:

2009/7/2 Art Hunkins <abhunkin@uncg.edu>
Yes, certainly. But tell us more what you have in mind.
 
I assume your keyboard would be a MIDI controller, correct?
 
An obvious choice would be a MIDI foot controller input through the keyboard, or a MIDI footswitch in conjunction with a foot controller or a portamento pedal.
 
If you need specific pitches from the pedal(s) - even from a standalone portamento pedal, Csound could "round" the pedal to the nearest pitch, or indeed add a rounded percentage to the current keyboard pitch.
 
There are many possibilities.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 02, 2009 11:57 AM
Subject: [Csnd] different pitches during a live-midi performance

Dear community,
I want to know, if it could be possible, to get different pitches for e.g. fis and ges during a live-midi performance.
What I desire, is to influence the pitch by a controller, e.g. the left piano-pedal.
I'm not speaking of pitch-bending, I really mean an exact, clearly regognizable pitch, when You press a key with od without this controller.
Is it possible?





Insert movie times and more without leaving Hotmail®. See how.



Date2009-07-08 18:00
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Dear Art,
thanks, it seems to work now. I didn't try it with chords now, but with one voice it works great.
And I found something, which helps me, to concvert cents to fractions and vice versa:
http://www.sengpielaudio.com/calculator-centsratio.htm
And, off course, scala is a great tool too.


2009/7/8 Art Hunkins <abhunkin@uncg.edu>
Hi Stefan,
 
Sorry - again my mistake. The line should be:
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1))
With the .9 value, the note is so low you can't hear it.
 
This line looks at the value of ipedal ( = up or down), and adds .1 of the icps value to it if it's up, or subtracts .1 of its value if the pedal is down (ipedal > 0).
 
I should think you could adjust the fractional value to equal 15 cents; probably the fractions need to be different. Probably someone else on the list can give you an appropriate formula.  
 
Otherwise you'll probably need to arrange your pitch conversion differently. (This could be more difficult because you're doing the conversion via table lookup. Using a direct formula might turn out to be more flexible in this case: e.g., do your fractions or cents with MIDI note numbers, then convert to icps via formula.)
 
Art Hunkins
----- Original Message -----
Sent: Wednesday, July 08, 2009 2:12 AM
Subject: [Csnd] Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear community,
my csd-file works now! I can hear sound, when I play, and the controller number 64 has an audible effect:
if I don't use it, the pitches of note number 61, 63, 66 are higher,
but, if I press it down, I can't hear these notes. I guess I have to define, what has to happen, if the left pedal is down.
There is one more thing, I don't understand:
What exactly does the line
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
do?
What do I have to do, if I want to change the pitch of a given note about e.g. 15 cents?
Thanks again for Your patience,
Stefan

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Without declaring massign, instr1 receives all the channel 1 data; instr2 all of the channel 2 data.
 
In this scenario, you'll need to set channel 2 either on the foot controller itself, or set controller 64 (or whichever) to channel 2 on your keyboard. (The keyboard otherwise outputs on channel 1.)
 
If this is not possible, or doesn't work, next try:
 
Put:
gkpedal ctrl7 1, 64, 0, 1
as the first line of instr 1.
Restore your
massign 0, 1
Remove instr 2 and its note
 
If these don't work, I'd advise going to the alternate method I suggested previously. (I'll also do some actual experimentation of my own at that point.)
 
Art Hunkins 
----- Original Message -----
Sent: Tuesday, July 07, 2009 3:35 AM
Subject: [Csnd] Re: Re: Re: different pitches during a live-midi performance

Dear Art,
many thanks, again, for Your fast answer.
There is one more  thing, I don't understand:
How can I put the foot-controller to channel two?
Or is this already done with
gkpedal ctrl7 2, 64, 0, 1

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Iain is correct (he always is, and you can totally count on his advice regarding realtime). My bad. *Controller* 64 is the foot controller/switch for MIDI.
 
Suggestions:
 
Delete line 14 *as well as 13*.
 
In instrument 2, substitute:
gkpedal ctrl7 2, 64, 0, 1
 
Then play your keyboard on channel 1, but put the foot controller on channel 2. (Alternately, put the foot controller on any channel except #1; number the instrument the same as the channel and give the controller the same number also (e.g., gkpedal ctrl7 10 for channel 10).) This should send all keyboard data to instr 1, pedal data to instr 2.
 
Frankly, I've always had trouble getting insnum to trigger notes, and never use it. If the above doesn't work, I'd try another approach: use an always-on instrument 1 that handles *all* midi input; when noteon's are received, it schedules events (through event or schedkwhen) for instrument 2. Working at k-rate, it also handles pedal-data (as in your i2).
 
All of my live performance works use this principle; you can look at many .csd's at my website, arthunkins.com, if you'd like.
 
Let us know how you get on.
 
Art Hunkins
----- Original Message -----
From: Iain McCurdy
Sent: Monday, July 06, 2009 3:14 PM
Subject: [Csnd] RE: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Hi Stefan

massign 64, 2

You are assigning MIDI note events on channel 64 to instr 2; but MIDI channels only go from 1-16 (or 0-15).

Bye,
Iain


Date: Mon, 6 Jul 2009 20:01:16 +0200
From: kontrapunktstefan@googlemail.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your anwer.
I guess I changed something in my file, but I dont know what.
Now I get the following error message:
INIT ERROR in instr 0: ? [illegal channel number? [m
?[m massign 64, 2
When I erase the line number 14 in the file, I can hear a sound, but I can't, off course, change any pitch. What I don't understand is:
Is it right, that 64 should be a number of controller, not of a channel?
If so, how can I tell csound this?
Here is, again, the whole file, without german comments.
Thank You very much,
Stefan

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M1 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
ipch = 8.02
iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2
pgmassign  0, 1              ; also all program changes
instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                          ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 && imnn != 63 && imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
skip:

 iamp    ampmidi        10000
; now defining the envelopes

inach = 0.1
;the volume at the end
iend = 0.0000000001

;the time, the partial needs until it reaches its peak
iein = 0.0030
; the different decay times for each partial
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;the volume at the beginning
ianfang = 0.001
;the volume of the reverberation
iweiterkling = 0.00000000000001
;the individual peaks
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;and now: the individual envelopes
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;the frequencies for the partials
ifundamental = icps
ipartialB =icps*2; partial 2
ipartialC = icps*3 ;partial 3
ipartialD = icps*4 ; partial 4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; the score
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/5 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Please tell us which lines are #30 and #31, and what the specific error messages are.
 
If any German commentary is involved, please translate for me; ich verstehe deutsch nicht so gut.
 
I do see one error:
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
(This may be the problem - or one of them.)
 
Art Hunkins
----- Original Message -----
Sent: Sunday, July 05, 2009 12:06 PM
Subject: [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks very much!
I tried out what You suggested to me, but I get always error messages in line 30 and 31.
I don't know what I'm doing wrong, I have to admit, that I don't have enough experiences with the syntax.
It would be great, if You could gove me a hint, one more time!
Thanks,
Stefan
Here is, again, the file ( a little smaller now):

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M2 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2 ;
pgmassign  0, 1              ; also all program changes

instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 and imnn != 63 and imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1)
skip:
 
  iamp    ampmidi        10000
; Hüllkurven definieren
;nachklingzeit
inach = 0.1
;Ende der Lautstartekurve
iend = 0.0000000001 ; für alle die gleiche Endlautstärke

; die  Einschwingzeit für jeden Teilton
iein = 0.0030
;die unterschiedlichen ausschwingzeiten
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;die anfangslautstaerke
ianfang = 0.001
;wie laut klingt der Ton am Ende, nach dem loslassen der Note
iweiterkling = 0.00000000000001
;die unterschiedlichen Maxima der Hüllkurven
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;die Individuellen Hüllkurven für jeden einzelnen Teilton
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;die Frequenzverhältnisse
ifundamental = icps
ipartialB =icps*2; teilton2
ipartialC = icps*3 ;teilton 3
ipartialD = icps*4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/3 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Here's what I'd try:
 
In header:
gkpedal init 0
 
and after your massign:
massign 64, 2
(or whatever controller # your foot pedal is, assign its data to instr 2. The massigns may be tricky.)
You should be able to use any type of foot pedal your MIDI keyboard will accept.
 
Make a completely new instrument that receives MIDI data only on controller 64 (or whichever # you choose):
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
 
The above instrument is always receiving foot controller data.
 
In the score, add:
i2 0 3600
 
In your instr1, add (at beginning):
ipedal = i(gkpedal)
 
and later (after icps computed):
if imnn != 60 and imnn != 62 and notnum ...... igoto skip ; this is a list of *all your black MIDI key numbers*!
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1)
skip:
 
In the above, ".1" is the percentage of the frequency you wish to add or subtract from your "basic pitch" (12tet).
 
You may want to make some other kind of pitch adjustment. For example you might put the low version (freq) of the black key pitch in your table, then multiply it by some factor if the pedal were up (gkpedal == 0):
icps = (ipedal > 0? icps + (icps * .1): icps)
Or perhaps you want different groups of "igoto" branches, where for example all F#'s modify in one way, all G#'s in another.
 
Let me know how it works out for you.
 
Art Hunkins
----- Original Message -----
Sent: Friday, July 03, 2009 3:22 AM
Subject: [Csnd] Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your answer. I have attached a small example to this mail.
I use there a scale with 17 pitches per octave but (as You all know)I do have only 12 pitches per octave on the keyboard.
I would like to allocate the black key two pitches and I would like to change this with the pressure of the una-corda-pedal (the left pedal). While pressing the left pedal down, I would like to get a lower pitch, in the other case, the higher pitch.
But I have no idea, how to do it with csound. So, I really need Your help!
At least I hope, that my idea of negotiating the limitation of 12 pitches per octave in this way will be interesting for other musicians to.
Thanks
Stefan
:

2009/7/2 Art Hunkins <abhunkin@uncg.edu>
Yes, certainly. But tell us more what you have in mind.
 
I assume your keyboard would be a MIDI controller, correct?
 
An obvious choice would be a MIDI foot controller input through the keyboard, or a MIDI footswitch in conjunction with a foot controller or a portamento pedal.
 
If you need specific pitches from the pedal(s) - even from a standalone portamento pedal, Csound could "round" the pedal to the nearest pitch, or indeed add a rounded percentage to the current keyboard pitch.
 
There are many possibilities.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 02, 2009 11:57 AM
Subject: [Csnd] different pitches during a live-midi performance

Dear community,
I want to know, if it could be possible, to get different pitches for e.g. fis and ges during a live-midi performance.
What I desire, is to influence the pitch by a controller, e.g. the left piano-pedal.
I'm not speaking of pitch-bending, I really mean an exact, clearly regognizable pitch, when You press a key with od without this controller.
Is it possible?





Insert movie times and more without leaving Hotmail®. See how.




Date2009-07-08 18:10
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Sorry, I forgot:
With Scala I mean the software Scala:
http://www.huygens-fokker.org/scala/
It also can convert fractions to cents and vice versa, it's a must-have for everyone making microtonal music, I think.

2009/7/8 Stefan Thomas <kontrapunktstefan@googlemail.com>
Dear Art,
thanks, it seems to work now. I didn't try it with chords now, but with one voice it works great.
And I found something, which helps me, to concvert cents to fractions and vice versa:
http://www.sengpielaudio.com/calculator-centsratio.htm
And, off course, scala is a great tool too.


2009/7/8 Art Hunkins <abhunkin@uncg.edu>

Hi Stefan,
 
Sorry - again my mistake. The line should be:
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1))
With the .9 value, the note is so low you can't hear it.
 
This line looks at the value of ipedal ( = up or down), and adds .1 of the icps value to it if it's up, or subtracts .1 of its value if the pedal is down (ipedal > 0).
 
I should think you could adjust the fractional value to equal 15 cents; probably the fractions need to be different. Probably someone else on the list can give you an appropriate formula.  
 
Otherwise you'll probably need to arrange your pitch conversion differently. (This could be more difficult because you're doing the conversion via table lookup. Using a direct formula might turn out to be more flexible in this case: e.g., do your fractions or cents with MIDI note numbers, then convert to icps via formula.)
 
Art Hunkins
----- Original Message -----
Sent: Wednesday, July 08, 2009 2:12 AM
Subject: [Csnd] Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear community,
my csd-file works now! I can hear sound, when I play, and the controller number 64 has an audible effect:
if I don't use it, the pitches of note number 61, 63, 66 are higher,
but, if I press it down, I can't hear these notes. I guess I have to define, what has to happen, if the left pedal is down.
There is one more thing, I don't understand:
What exactly does the line
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
do?
What do I have to do, if I want to change the pitch of a given note about e.g. 15 cents?
Thanks again for Your patience,
Stefan

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Without declaring massign, instr1 receives all the channel 1 data; instr2 all of the channel 2 data.
 
In this scenario, you'll need to set channel 2 either on the foot controller itself, or set controller 64 (or whichever) to channel 2 on your keyboard. (The keyboard otherwise outputs on channel 1.)
 
If this is not possible, or doesn't work, next try:
 
Put:
gkpedal ctrl7 1, 64, 0, 1
as the first line of instr 1.
Restore your
massign 0, 1
Remove instr 2 and its note
 
If these don't work, I'd advise going to the alternate method I suggested previously. (I'll also do some actual experimentation of my own at that point.)
 
Art Hunkins 
----- Original Message -----
Sent: Tuesday, July 07, 2009 3:35 AM
Subject: [Csnd] Re: Re: Re: different pitches during a live-midi performance

Dear Art,
many thanks, again, for Your fast answer.
There is one more  thing, I don't understand:
How can I put the foot-controller to channel two?
Or is this already done with
gkpedal ctrl7 2, 64, 0, 1

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Iain is correct (he always is, and you can totally count on his advice regarding realtime). My bad. *Controller* 64 is the foot controller/switch for MIDI.
 
Suggestions:
 
Delete line 14 *as well as 13*.
 
In instrument 2, substitute:
gkpedal ctrl7 2, 64, 0, 1
 
Then play your keyboard on channel 1, but put the foot controller on channel 2. (Alternately, put the foot controller on any channel except #1; number the instrument the same as the channel and give the controller the same number also (e.g., gkpedal ctrl7 10 for channel 10).) This should send all keyboard data to instr 1, pedal data to instr 2.
 
Frankly, I've always had trouble getting insnum to trigger notes, and never use it. If the above doesn't work, I'd try another approach: use an always-on instrument 1 that handles *all* midi input; when noteon's are received, it schedules events (through event or schedkwhen) for instrument 2. Working at k-rate, it also handles pedal-data (as in your i2).
 
All of my live performance works use this principle; you can look at many .csd's at my website, arthunkins.com, if you'd like.
 
Let us know how you get on.
 
Art Hunkins
----- Original Message -----
From: Iain McCurdy
Sent: Monday, July 06, 2009 3:14 PM
Subject: [Csnd] RE: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Hi Stefan

massign 64, 2

You are assigning MIDI note events on channel 64 to instr 2; but MIDI channels only go from 1-16 (or 0-15).

Bye,
Iain


Date: Mon, 6 Jul 2009 20:01:16 +0200
From: kontrapunktstefan@googlemail.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your anwer.
I guess I changed something in my file, but I dont know what.
Now I get the following error message:
INIT ERROR in instr 0: ? [illegal channel number? [m
?[m massign 64, 2
When I erase the line number 14 in the file, I can hear a sound, but I can't, off course, change any pitch. What I don't understand is:
Is it right, that 64 should be a number of controller, not of a channel?
If so, how can I tell csound this?
Here is, again, the whole file, without german comments.
Thank You very much,
Stefan

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M1 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
ipch = 8.02
iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2
pgmassign  0, 1              ; also all program changes
instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                          ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 && imnn != 63 && imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
skip:

 iamp    ampmidi        10000
; now defining the envelopes

inach = 0.1
;the volume at the end
iend = 0.0000000001

;the time, the partial needs until it reaches its peak
iein = 0.0030
; the different decay times for each partial
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;the volume at the beginning
ianfang = 0.001
;the volume of the reverberation
iweiterkling = 0.00000000000001
;the individual peaks
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;and now: the individual envelopes
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;the frequencies for the partials
ifundamental = icps
ipartialB =icps*2; partial 2
ipartialC = icps*3 ;partial 3
ipartialD = icps*4 ; partial 4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; the score
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/5 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Please tell us which lines are #30 and #31, and what the specific error messages are.
 
If any German commentary is involved, please translate for me; ich verstehe deutsch nicht so gut.
 
I do see one error:
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
(This may be the problem - or one of them.)
 
Art Hunkins
----- Original Message -----
Sent: Sunday, July 05, 2009 12:06 PM
Subject: [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks very much!
I tried out what You suggested to me, but I get always error messages in line 30 and 31.
I don't know what I'm doing wrong, I have to admit, that I don't have enough experiences with the syntax.
It would be great, if You could gove me a hint, one more time!
Thanks,
Stefan
Here is, again, the file ( a little smaller now):

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M2 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2 ;
pgmassign  0, 1              ; also all program changes

instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 and imnn != 63 and imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1)
skip:
 
  iamp    ampmidi        10000
; Hüllkurven definieren
;nachklingzeit
inach = 0.1
;Ende der Lautstartekurve
iend = 0.0000000001 ; für alle die gleiche Endlautstärke

; die  Einschwingzeit für jeden Teilton
iein = 0.0030
;die unterschiedlichen ausschwingzeiten
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;die anfangslautstaerke
ianfang = 0.001
;wie laut klingt der Ton am Ende, nach dem loslassen der Note
iweiterkling = 0.00000000000001
;die unterschiedlichen Maxima der Hüllkurven
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;die Individuellen Hüllkurven für jeden einzelnen Teilton
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;die Frequenzverhältnisse
ifundamental = icps
ipartialB =icps*2; teilton2
ipartialC = icps*3 ;teilton 3
ipartialD = icps*4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/3 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Here's what I'd try:
 
In header:
gkpedal init 0
 
and after your massign:
massign 64, 2
(or whatever controller # your foot pedal is, assign its data to instr 2. The massigns may be tricky.)
You should be able to use any type of foot pedal your MIDI keyboard will accept.
 
Make a completely new instrument that receives MIDI data only on controller 64 (or whichever # you choose):
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
 
The above instrument is always receiving foot controller data.
 
In the score, add:
i2 0 3600
 
In your instr1, add (at beginning):
ipedal = i(gkpedal)
 
and later (after icps computed):
if imnn != 60 and imnn != 62 and notnum ...... igoto skip ; this is a list of *all your black MIDI key numbers*!
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1)
skip:
 
In the above, ".1" is the percentage of the frequency you wish to add or subtract from your "basic pitch" (12tet).
 
You may want to make some other kind of pitch adjustment. For example you might put the low version (freq) of the black key pitch in your table, then multiply it by some factor if the pedal were up (gkpedal == 0):
icps = (ipedal > 0? icps + (icps * .1): icps)
Or perhaps you want different groups of "igoto" branches, where for example all F#'s modify in one way, all G#'s in another.
 
Let me know how it works out for you.
 
Art Hunkins
----- Original Message -----
Sent: Friday, July 03, 2009 3:22 AM
Subject: [Csnd] Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your answer. I have attached a small example to this mail.
I use there a scale with 17 pitches per octave but (as You all know)I do have only 12 pitches per octave on the keyboard.
I would like to allocate the black key two pitches and I would like to change this with the pressure of the una-corda-pedal (the left pedal). While pressing the left pedal down, I would like to get a lower pitch, in the other case, the higher pitch.
But I have no idea, how to do it with csound. So, I really need Your help!
At least I hope, that my idea of negotiating the limitation of 12 pitches per octave in this way will be interesting for other musicians to.
Thanks
Stefan
:

2009/7/2 Art Hunkins <abhunkin@uncg.edu>
Yes, certainly. But tell us more what you have in mind.
 
I assume your keyboard would be a MIDI controller, correct?
 
An obvious choice would be a MIDI foot controller input through the keyboard, or a MIDI footswitch in conjunction with a foot controller or a portamento pedal.
 
If you need specific pitches from the pedal(s) - even from a standalone portamento pedal, Csound could "round" the pedal to the nearest pitch, or indeed add a rounded percentage to the current keyboard pitch.
 
There are many possibilities.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 02, 2009 11:57 AM
Subject: [Csnd] different pitches during a live-midi performance

Dear community,
I want to know, if it could be possible, to get different pitches for e.g. fis and ges during a live-midi performance.
What I desire, is to influence the pitch by a controller, e.g. the left piano-pedal.
I'm not speaking of pitch-bending, I really mean an exact, clearly regognizable pitch, when You press a key with od without this controller.
Is it possible?





Insert movie times and more without leaving Hotmail®. See how.





Date2009-09-20 14:25
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Attachments12tet.cps  
Dear community,
I had now some time left for to occupy myself with the idea of changing the pitch with the help of of a midi controller.
Concerning this topic, I have two more questions:
  1. I want to change a group of notes, with one controller-switch. Is it maybee possible by acessing another tuning-table?
  2. I don't understand, why the notes number 56,  68 and 80 are lower, when the left pedal is not down.
 Here is my as short as possible short csd-file I use for my experiments:
<CsoundSynthesizer>
<CsOptions>
-odevaudio -M0 -b400 -m0d
</CsOptions>
<CsInstruments>

sr     = 48000
kr     = 2400
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12

 

massign    0, 1              ; assign all midi events to instr 1,
pgmassign  0, 1              ; also all program changes
instr 1
gkpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
ipedal = i(gkpedal)
 
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 56 && imnn != 68 && imnn !=80    igoto skip
icps = (ipedal > 0? icps*1: icps*0.9760317607762247); if the left pedal is down, g sharp becomes 42 lower
skip:
  iamp    ampmidi        10000
     

a1   oscil iamp, icps,  1
      outs a1, a1
      endin 
 

 
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "12tet.cps"   

i1   0    45


</CsScore>



2009/7/8 Stefan Thomas <kontrapunktstefan@googlemail.com>
Sorry, I forgot:
With Scala I mean the software Scala:
http://www.huygens-fokker.org/scala/
It also can convert fractions to cents and vice versa, it's a must-have for everyone making microtonal music, I think.

2009/7/8 Stefan Thomas <kontrapunktstefan@googlemail.com>

Dear Art,
thanks, it seems to work now. I didn't try it with chords now, but with one voice it works great.
And I found something, which helps me, to concvert cents to fractions and vice versa:
http://www.sengpielaudio.com/calculator-centsratio.htm
And, off course, scala is a great tool too.


2009/7/8 Art Hunkins <abhunkin@uncg.edu>

Hi Stefan,
 
Sorry - again my mistake. The line should be:
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1))
With the .9 value, the note is so low you can't hear it.
 
This line looks at the value of ipedal ( = up or down), and adds .1 of the icps value to it if it's up, or subtracts .1 of its value if the pedal is down (ipedal > 0).
 
I should think you could adjust the fractional value to equal 15 cents; probably the fractions need to be different. Probably someone else on the list can give you an appropriate formula.  
 
Otherwise you'll probably need to arrange your pitch conversion differently. (This could be more difficult because you're doing the conversion via table lookup. Using a direct formula might turn out to be more flexible in this case: e.g., do your fractions or cents with MIDI note numbers, then convert to icps via formula.)
 
Art Hunkins
----- Original Message -----
Sent: Wednesday, July 08, 2009 2:12 AM
Subject: [Csnd] Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear community,
my csd-file works now! I can hear sound, when I play, and the controller number 64 has an audible effect:
if I don't use it, the pitches of note number 61, 63, 66 are higher,
but, if I press it down, I can't hear these notes. I guess I have to define, what has to happen, if the left pedal is down.
There is one more thing, I don't understand:
What exactly does the line
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
do?
What do I have to do, if I want to change the pitch of a given note about e.g. 15 cents?
Thanks again for Your patience,
Stefan

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Without declaring massign, instr1 receives all the channel 1 data; instr2 all of the channel 2 data.
 
In this scenario, you'll need to set channel 2 either on the foot controller itself, or set controller 64 (or whichever) to channel 2 on your keyboard. (The keyboard otherwise outputs on channel 1.)
 
If this is not possible, or doesn't work, next try:
 
Put:
gkpedal ctrl7 1, 64, 0, 1
as the first line of instr 1.
Restore your
massign 0, 1
Remove instr 2 and its note
 
If these don't work, I'd advise going to the alternate method I suggested previously. (I'll also do some actual experimentation of my own at that point.)
 
Art Hunkins 
----- Original Message -----
Sent: Tuesday, July 07, 2009 3:35 AM
Subject: [Csnd] Re: Re: Re: different pitches during a live-midi performance

Dear Art,
many thanks, again, for Your fast answer.
There is one more  thing, I don't understand:
How can I put the foot-controller to channel two?
Or is this already done with
gkpedal ctrl7 2, 64, 0, 1

2009/7/7 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Iain is correct (he always is, and you can totally count on his advice regarding realtime). My bad. *Controller* 64 is the foot controller/switch for MIDI.
 
Suggestions:
 
Delete line 14 *as well as 13*.
 
In instrument 2, substitute:
gkpedal ctrl7 2, 64, 0, 1
 
Then play your keyboard on channel 1, but put the foot controller on channel 2. (Alternately, put the foot controller on any channel except #1; number the instrument the same as the channel and give the controller the same number also (e.g., gkpedal ctrl7 10 for channel 10).) This should send all keyboard data to instr 1, pedal data to instr 2.
 
Frankly, I've always had trouble getting insnum to trigger notes, and never use it. If the above doesn't work, I'd try another approach: use an always-on instrument 1 that handles *all* midi input; when noteon's are received, it schedules events (through event or schedkwhen) for instrument 2. Working at k-rate, it also handles pedal-data (as in your i2).
 
All of my live performance works use this principle; you can look at many .csd's at my website, arthunkins.com, if you'd like.
 
Let us know how you get on.
 
Art Hunkins
----- Original Message -----
From: Iain McCurdy
Sent: Monday, July 06, 2009 3:14 PM
Subject: [Csnd] RE: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Hi Stefan

massign 64, 2

You are assigning MIDI note events on channel 64 to instr 2; but MIDI channels only go from 1-16 (or 0-15).

Bye,
Iain


Date: Mon, 6 Jul 2009 20:01:16 +0200
From: kontrapunktstefan@googlemail.com
To: csound@lists.bath.ac.uk
Subject: [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your anwer.
I guess I changed something in my file, but I dont know what.
Now I get the following error message:
INIT ERROR in instr 0: ? [illegal channel number? [m
?[m massign 64, 2
When I erase the line number 14 in the file, I can hear a sound, but I can't, off course, change any pitch. What I don't understand is:
Is it right, that 64 should be a number of controller, not of a channel?
If so, how can I tell csound this?
Here is, again, the whole file, without german comments.
Thank You very much,
Stefan

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M1 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
ipch = 8.02
iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2
pgmassign  0, 1              ; also all program changes
instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                          ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 && imnn != 63 && imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
skip:

 iamp    ampmidi        10000
; now defining the envelopes

inach = 0.1
;the volume at the end
iend = 0.0000000001

;the time, the partial needs until it reaches its peak
iein = 0.0030
; the different decay times for each partial
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;the volume at the beginning
ianfang = 0.001
;the volume of the reverberation
iweiterkling = 0.00000000000001
;the individual peaks
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;and now: the individual envelopes
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;the frequencies for the partials
ifundamental = icps
ipartialB =icps*2; partial 2
ipartialC = icps*3 ;partial 3
ipartialD = icps*4 ; partial 4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; the score
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/5 Art Hunkins <abhunkin@uncg.edu>
Stefan,
 
Please tell us which lines are #30 and #31, and what the specific error messages are.
 
If any German commentary is involved, please translate for me; ich verstehe deutsch nicht so gut.
 
I do see one error:
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
(This may be the problem - or one of them.)
 
Art Hunkins
----- Original Message -----
Sent: Sunday, July 05, 2009 12:06 PM
Subject: [Csnd] Re: Re: Re: Re: different pitches during a live-midi performance

Dear Art,
thanks very much!
I tried out what You suggested to me, but I get always error messages in line 30 and 31.
I don't know what I'm doing wrong, I have to admit, that I don't have enough experiences with the syntax.
It would be great, if You could gove me a hint, one more time!
Thanks,
Stefan
Here is, again, the file ( a little smaller now):

<CsoundSynthesizer>
<CsOptions>
 -odevaudio -M2 -b400
</CsOptions>
<CsInstruments>
sr     = 44100
kr     = 2205
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12
massign    0, 1              ; assign all midi events to instr 1,
massign 64, 2 ;
pgmassign  0, 1              ; also all program changes

instr 1
ipedal = i(gkpedal)
 ituningtable = 10         ; the number of the f-table

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
if imnn != 61 and imnn != 63 and imnn !=66    igoto skip
icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1)
skip:
 
  iamp    ampmidi        10000
; Hüllkurven definieren
;nachklingzeit
inach = 0.1
;Ende der Lautstartekurve
iend = 0.0000000001 ; für alle die gleiche Endlautstärke

; die  Einschwingzeit für jeden Teilton
iein = 0.0030
;die unterschiedlichen ausschwingzeiten
iabkling1 = 4.5*2
iabkling2 = 7.22*2
iabkling3 = 9.26*2
iabkling4 = 9.42*2
;die anfangslautstaerke
ianfang = 0.001
;wie laut klingt der Ton am Ende, nach dem loslassen der Note
iweiterkling = 0.00000000000001
;die unterschiedlichen Maxima der Hüllkurven
ilautfaktor = 0.8
imax1 = 1
imax2 = ilautfaktor
imax3=  ilautfaktor^2
imax4 = ilautfaktor^3

;die Individuellen Hüllkurven für jeden einzelnen Teilton
kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,  inach, iweiterkling
kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,  inach, iweiterkling
kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,  inach, iweiterkling
kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,  inach, iweiterkling
;die Frequenzverhältnisse
ifundamental = icps
ipartialB =icps*2; teilton2
ipartialC = icps*3 ;teilton 3
ipartialD = icps*4

a1    oscil   kenv1*iamp, ifundamental,    1
a2    oscil   kenv2*iamp, ipartialB,     1
a3    oscil   kenv3*iamp, ipartialC,     1
a4    oscil   kenv4*iamp, ipartialD,     1

aton = a1+a2+a3+a4
;velocity controlled tone control
icutoff_oct  veloc  6, 14
;lowpass filter our audio signal
alautfilter tone aton, cpsoct(icutoff_oct)
;k1 linenr 0.01, 0.03, 0.1, 0.01
outs alautfilter, alautfilter
endin
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "17tet.cps"

i1   0    3600
i2 0 3600
</CsScore>
</CsoundSynthesizer>


2009/7/3 Art Hunkins <abhunkin@uncg.edu>
Hello, Stefan,
 
Here's what I'd try:
 
In header:
gkpedal init 0
 
and after your massign:
massign 64, 2
(or whatever controller # your foot pedal is, assign its data to instr 2. The massigns may be tricky.)
You should be able to use any type of foot pedal your MIDI keyboard will accept.
 
Make a completely new instrument that receives MIDI data only on controller 64 (or whichever # you choose):
instr 2
gkpedal ctrl7 1, 64, 0, 1
endin
 
The above instrument is always receiving foot controller data.
 
In the score, add:
i2 0 3600
 
In your instr1, add (at beginning):
ipedal = i(gkpedal)
 
and later (after icps computed):
if imnn != 60 and imnn != 62 and notnum ...... igoto skip ; this is a list of *all your black MIDI key numbers*!
icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1)
skip:
 
In the above, ".1" is the percentage of the frequency you wish to add or subtract from your "basic pitch" (12tet).
 
You may want to make some other kind of pitch adjustment. For example you might put the low version (freq) of the black key pitch in your table, then multiply it by some factor if the pedal were up (gkpedal == 0):
icps = (ipedal > 0? icps + (icps * .1): icps)
Or perhaps you want different groups of "igoto" branches, where for example all F#'s modify in one way, all G#'s in another.
 
Let me know how it works out for you.
 
Art Hunkins
----- Original Message -----
Sent: Friday, July 03, 2009 3:22 AM
Subject: [Csnd] Re: Re: different pitches during a live-midi performance

Dear Art,
thanks for Your answer. I have attached a small example to this mail.
I use there a scale with 17 pitches per octave but (as You all know)I do have only 12 pitches per octave on the keyboard.
I would like to allocate the black key two pitches and I would like to change this with the pressure of the una-corda-pedal (the left pedal). While pressing the left pedal down, I would like to get a lower pitch, in the other case, the higher pitch.
But I have no idea, how to do it with csound. So, I really need Your help!
At least I hope, that my idea of negotiating the limitation of 12 pitches per octave in this way will be interesting for other musicians to.
Thanks
Stefan
:

2009/7/2 Art Hunkins <abhunkin@uncg.edu>
Yes, certainly. But tell us more what you have in mind.
 
I assume your keyboard would be a MIDI controller, correct?
 
An obvious choice would be a MIDI foot controller input through the keyboard, or a MIDI footswitch in conjunction with a foot controller or a portamento pedal.
 
If you need specific pitches from the pedal(s) - even from a standalone portamento pedal, Csound could "round" the pedal to the nearest pitch, or indeed add a rounded percentage to the current keyboard pitch.
 
There are many possibilities.
 
Art Hunkins
----- Original Message -----
Sent: Thursday, July 02, 2009 11:57 AM
Subject: [Csnd] different pitches during a live-midi performance

Dear community,
I want to know, if it could be possible, to get different pitches for e.g. fis and ges during a live-midi performance.
What I desire, is to influence the pitch by a controller, e.g. the left piano-pedal.
I'm not speaking of pitch-bending, I really mean an exact, clearly regognizable pitch, when You press a key with od without this controller.
Is it possible?





Insert movie times and more without leaving Hotmail®. See how.






Date2009-09-22 17:49
Fromjoachim heintz
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Hi Stefan -

I see the following problems in your code:

1. The condition
> if imnn != 56 && imnn != 68 && imnn !=80    igoto skip
will never become true. Probably you mean:
if imnn != 56 || imnn != 68 || imnn !=80    igoto skip
("or" instead of "and")

2. With the lines
> gkpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
> ipedal = i(gkpedal)
you want to get "1" for "left pedal pressed" and "0" for "not  
pressed". But this implies that gkpedal sends continually "1", and not  
just once. Does it? Please insert the line
print ipedal
and watch the output.

Some tips:
- If you have problems, I won't use the -m0 flag, because it  
suppresses some messages.
- I can't see any need for the statements
> gkpedal init 0
>  ipch = 8.02
>   iequal = 12
- Instead of icps*0.9760317607762247 you can write icps*cent(-42)

This was all related to your second question. Regarding the first, I  
am sure it's possible, and there are many ways of doing it. One simple  
way I can imagine, is, to switch between different function tables;  
something like
if ipedal == 0 then
ift = 1
else
ift = 2
endif
and then later
icps    table  indx, ift
This depends on what you exactly want to do (how many function tables  
you need, what your controller has as output, and so on). If you like,  
tell us.

Hope that helps. Best regards -

	joachim


Am 20.09.2009 um 15:25 schrieb Stefan Thomas:

> Dear community,
> I had now some time left for to occupy myself with the idea of  
> changing the pitch with the help of of a midi controller.
> Concerning this topic, I have two more questions:
> 	• I want to change a group of notes, with one controller-switch. Is  
> it maybee possible by acessing another tuning-table?
> 	• I don't understand, why the notes number 56,  68 and 80 are  
> lower, when the left pedal is not down.
>  Here is my as short as possible short csd-file I use for my  
> experiments:
> 
> 
> -odevaudio -M0 -b400 -m0d
> 
> 
>
> sr     = 48000
> kr     = 2400
> ksmps  = 20
> nchnls = 2
> gkpedal init 0
>  ipch = 8.02
>   iequal = 12
>
>
>
> massign    0, 1              ; assign all midi events to instr 1,
> pgmassign  0, 1              ; also all program changes
> instr 1
> gkpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
> ipedal = i(gkpedal)
>
>  ituningtable = 10         ; the number of the f-table
>
>  imnn    notnum
>  indx    =  imnn * 2 + 1   ; values in table alternate between
>                            ; Midi note nums and frequencies
>  icps    table  indx, ituningtable
> if imnn != 56 && imnn != 68 && imnn !=80    igoto skip
> icps = (ipedal > 0? icps*1: icps*0.9760317607762247); if the left  
> pedal is down, g sharp becomes 42 lower
> skip:
>   iamp    ampmidi        10000
>
>
> a1   oscil iamp, icps,  1
>       outs a1, a1
>       endin
>
>
>
> 
> ; die Partiturereignisse werden definiert
> 
> f1  0   8193  10   1
> f 10  0 256 -23 "12tet.cps"
>
> i1   0    45
>
>
> 
>
>
>
> 2009/7/8 Stefan Thomas 
> Sorry, I forgot:
> With Scala I mean the software Scala:
> http://www.huygens-fokker.org/scala/
> It also can convert fractions to cents and vice versa, it's a must- 
> have for everyone making microtonal music, I think.
>
> 2009/7/8 Stefan Thomas 
>
> Dear Art,
> thanks, it seems to work now. I didn't try it with chords now, but  
> with one voice it works great.
> And I found something, which helps me, to concvert cents to  
> fractions and vice versa:
> http://www.sengpielaudio.com/calculator-centsratio.htm
> And, off course, scala is a great tool too.
>
>
> 2009/7/8 Art Hunkins 
>
> Hi Stefan,
>
> Sorry - again my mistake. The line should be:
> icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1))
> With the .9 value, the note is so low you can't hear it.
>
> This line looks at the value of ipedal ( = up or down), and adds .1  
> of the icps value to it if it's up, or subtracts .1 of its value if  
> the pedal is down (ipedal > 0).
>
> I should think you could adjust the fractional value to equal 15  
> cents; probably the fractions need to be different. Probably someone  
> else on the list can give you an appropriate formula.
>
> Otherwise you'll probably need to arrange your pitch conversion  
> differently. (This could be more difficult because you're doing the  
> conversion via table lookup. Using a direct formula might turn out  
> to be more flexible in this case: e.g., do your fractions or cents  
> with MIDI note numbers, then convert to icps via formula.)
>
> Art Hunkins
> ----- Original Message -----
> From: Stefan Thomas
> To: csound@lists.bath.ac.uk
> Sent: Wednesday, July 08, 2009 2:12 AM
> Subject: [Csnd] Re: Re: Re: Re: Re: different pitches during a live- 
> midi performance
>
> Dear community,
> my csd-file works now! I can hear sound, when I play, and the  
> controller number 64 has an audible effect:
> if I don't use it, the pitches of note number 61, 63, 66 are higher,
> but, if I press it down, I can't hear these notes. I guess I have to  
> define, what has to happen, if the left pedal is down.
> There is one more thing, I don't understand:
> What exactly does the line
> icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
> do?
> What do I have to do, if I want to change the pitch of a given note  
> about e.g. 15 cents?
> Thanks again for Your patience,
> Stefan
>
> 2009/7/7 Art Hunkins 
> Stefan,
>
> Without declaring massign, instr1 receives all the channel 1 data;  
> instr2 all of the channel 2 data.
>
> In this scenario, you'll need to set channel 2 either on the foot  
> controller itself, or set controller 64 (or whichever) to channel 2  
> on your keyboard. (The keyboard otherwise outputs on channel 1.)
>
> If this is not possible, or doesn't work, next try:
>
> Put:
> gkpedal ctrl7 1, 64, 0, 1
> as the first line of instr 1.
> Restore your
> massign 0, 1
> Remove instr 2 and its note
>
> If these don't work, I'd advise going to the alternate method I  
> suggested previously. (I'll also do some actual experimentation of  
> my own at that point.)
>
> Art Hunkins
> ----- Original Message -----
> From: Stefan Thomas
> To: csound@lists.bath.ac.uk
> Sent: Tuesday, July 07, 2009 3:35 AM
> Subject: [Csnd] Re: Re: Re: different pitches during a live-midi  
> performance
>
> Dear Art,
> many thanks, again, for Your fast answer.
> There is one more  thing, I don't understand:
> How can I put the foot-controller to channel two?
> Or is this already done with
> gkpedal ctrl7 2, 64, 0, 1
>
> 2009/7/7 Art Hunkins 
> Hello, Stefan,
>
> Iain is correct (he always is, and you can totally count on his  
> advice regarding realtime). My bad. *Controller* 64 is the foot  
> controller/switch for MIDI.
>
> Suggestions:
>
> Delete line 14 *as well as 13*.
>
> In instrument 2, substitute:
> gkpedal ctrl7 2, 64, 0, 1
>
> Then play your keyboard on channel 1, but put the foot controller on  
> channel 2. (Alternately, put the foot controller on any channel  
> except #1; number the instrument the same as the channel and give  
> the controller the same number also (e.g., gkpedal ctrl7 10 for  
> channel 10).) This should send all keyboard data to instr 1, pedal  
> data to instr 2.
>
> Frankly, I've always had trouble getting insnum to trigger notes,  
> and never use it. If the above doesn't work, I'd try another  
> approach: use an always-on instrument 1 that handles *all* midi  
> input; when noteon's are received, it schedules events (through  
> event or schedkwhen) for instrument 2. Working at k-rate, it also  
> handles pedal-data (as in your i2).
>
> All of my live performance works use this principle; you can look at  
> many .csd's at my website, arthunkins.com, if you'd like.
>
> Let us know how you get on.
>
> Art Hunkins
> ----- Original Message -----
> From: Iain McCurdy
> To: csound@lists.bath.ac.uk
> Sent: Monday, July 06, 2009 3:14 PM
> Subject: [Csnd] RE: Re: Re: Re: Re: Re: Re: different pitches during  
> a live-midi performance
>
> Hi Stefan
>
> massign 64, 2
>
> You are assigning MIDI note events on channel 64 to instr 2; but  
> MIDI channels only go from 1-16 (or 0-15).
>
> Bye,
> Iain
>
> Date: Mon, 6 Jul 2009 20:01:16 +0200
> From: kontrapunktstefan@googlemail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Re: Re: Re: Re: Re: Re: different pitches during a  
> live-midi performance
>
> Dear Art,
> thanks for Your anwer.
> I guess I changed something in my file, but I dont know what.
> Now I get the following error message:
> INIT ERROR in instr 0: ? [illegal channel number? [m
> ?[m massign 64, 2
> When I erase the line number 14 in the file, I can hear a sound, but  
> I can't, off course, change any pitch. What I don't understand is:
> Is it right, that 64 should be a number of controller, not of a  
> channel?
> If so, how can I tell csound this?
> Here is, again, the whole file, without german comments.
> Thank You very much,
> Stefan
>
> 
> 
>  -odevaudio -M1 -b400
> 
> 
> sr     = 44100
> kr     = 2205
> ksmps  = 20
> nchnls = 2
> gkpedal init 0
> ipch = 8.02
> iequal = 12
> massign    0, 1              ; assign all midi events to instr 1,
> massign 64, 2
> pgmassign  0, 1              ; also all program changes
> instr 1
> ipedal = i(gkpedal)
>  ituningtable = 10         ; the number of the f-table
>
>  imnn    notnum
>  indx    =  imnn * 2 + 1   ; values in table alternate between
>                           ; Midi note nums and frequencies
>  icps    table  indx, ituningtable
> if imnn != 61 && imnn != 63 && imnn !=66    igoto skip
> icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
> skip:
>
>  iamp    ampmidi        10000
> ; now defining the envelopes
>
> inach = 0.1
> ;the volume at the end
> iend = 0.0000000001
>
> ;the time, the partial needs until it reaches its peak
> iein = 0.0030
> ; the different decay times for each partial
> iabkling1 = 4.5*2
> iabkling2 = 7.22*2
> iabkling3 = 9.26*2
> iabkling4 = 9.42*2
> ;the volume at the beginning
> ianfang = 0.001
> ;the volume of the reverberation
> iweiterkling = 0.00000000000001
> ;the individual peaks
> ilautfaktor = 0.8
> imax1 = 1
> imax2 = ilautfaktor
> imax3=  ilautfaktor^2
> imax4 = ilautfaktor^3
>
> ;and now: the individual envelopes
> kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,   
> inach, iweiterkling
> kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,   
> inach, iweiterkling
> kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,   
> inach, iweiterkling
> kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,   
> inach, iweiterkling
> ;the frequencies for the partials
> ifundamental = icps
> ipartialB =icps*2; partial 2
> ipartialC = icps*3 ;partial 3
> ipartialD = icps*4 ; partial 4
>
> a1    oscil   kenv1*iamp, ifundamental,    1
> a2    oscil   kenv2*iamp, ipartialB,     1
> a3    oscil   kenv3*iamp, ipartialC,     1
> a4    oscil   kenv4*iamp, ipartialD,     1
>
> aton = a1+a2+a3+a4
> ;velocity controlled tone control
> icutoff_oct  veloc  6, 14
> ;lowpass filter our audio signal
> alautfilter tone aton, cpsoct(icutoff_oct)
> ;k1 linenr 0.01, 0.03, 0.1, 0.01
> outs alautfilter, alautfilter
> endin
> instr 2
> gkpedal ctrl7 1, 64, 0, 1
> endin
> 
> ; the score
> 
> f1  0   8193  10   1
> f 10  0 256 -23 "17tet.cps"
>
> i1   0    3600
> i2 0 3600
> 
> 
>
>
> 2009/7/5 Art Hunkins 
> Stefan,
>
> Please tell us which lines are #30 and #31, and what the specific  
> error messages are.
>
> If any German commentary is involved, please translate for me; ich  
> verstehe deutsch nicht so gut.
>
> I do see one error:
> icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1))
> (This may be the problem - or one of them.)
>
> Art Hunkins
> ----- Original Message -----
> From: Stefan Thomas
> To: csound@lists.bath.ac.uk
> Sent: Sunday, July 05, 2009 12:06 PM
> Subject: [Csnd] Re: Re: Re: Re: different pitches during a live-midi  
> performance
>
> Dear Art,
> thanks very much!
> I tried out what You suggested to me, but I get always error  
> messages in line 30 and 31.
> I don't know what I'm doing wrong, I have to admit, that I don't  
> have enough experiences with the syntax.
> It would be great, if You could gove me a hint, one more time!
> Thanks,
> Stefan
> Here is, again, the file ( a little smaller now):
>
> 
> 
>  -odevaudio -M2 -b400
> 
> 
> sr     = 44100
> kr     = 2205
> ksmps  = 20
> nchnls = 2
> gkpedal init 0
>  ipch = 8.02
>   iequal = 12
> massign    0, 1              ; assign all midi events to instr 1,
> massign 64, 2 ;
> pgmassign  0, 1              ; also all program changes
>
> instr 1
> ipedal = i(gkpedal)
>  ituningtable = 10         ; the number of the f-table
>
>  imnn    notnum
>  indx    =  imnn * 2 + 1   ; values in table alternate between
>                            ; Midi note nums and frequencies
>  icps    table  indx, ituningtable
> if imnn != 61 and imnn != 63 and imnn !=66    igoto skip
> icps = (ipedal > 0? icps - (icps * .9): icps + (icps * .1)
> skip:
>
>   iamp    ampmidi        10000
> ; Hüllkurven definieren
> ;nachklingzeit
> inach = 0.1
> ;Ende der Lautstartekurve
> iend = 0.0000000001 ; für alle die gleiche Endlautstärke
>
> ; die  Einschwingzeit für jeden Teilton
> iein = 0.0030
> ;die unterschiedlichen ausschwingzeiten
> iabkling1 = 4.5*2
> iabkling2 = 7.22*2
> iabkling3 = 9.26*2
> iabkling4 = 9.42*2
> ;die anfangslautstaerke
> ianfang = 0.001
> ;wie laut klingt der Ton am Ende, nach dem loslassen der Note
> iweiterkling = 0.00000000000001
> ;die unterschiedlichen Maxima der Hüllkurven
> ilautfaktor = 0.8
> imax1 = 1
> imax2 = ilautfaktor
> imax3=  ilautfaktor^2
> imax4 = ilautfaktor^3
>
> ;die Individuellen Hüllkurven für jeden einzelnen Teilton
> kenv1 expsegr ianfang, iein, imax1,     iabkling1,      iend,   
> inach, iweiterkling
> kenv2 expsegr ianfang, iein, imax2,     iabkling2,      iend,   
> inach, iweiterkling
> kenv3 expsegr ianfang, iein, imax3,     iabkling3,      iend,   
> inach, iweiterkling
> kenv4 expsegr ianfang, iein, imax4,     iabkling4,      iend,   
> inach, iweiterkling
> ;die Frequenzverhältnisse
> ifundamental = icps
> ipartialB =icps*2; teilton2
> ipartialC = icps*3 ;teilton 3
> ipartialD = icps*4
>
> a1    oscil   kenv1*iamp, ifundamental,    1
> a2    oscil   kenv2*iamp, ipartialB,     1
> a3    oscil   kenv3*iamp, ipartialC,     1
> a4    oscil   kenv4*iamp, ipartialD,     1
>
> aton = a1+a2+a3+a4
> ;velocity controlled tone control
> icutoff_oct  veloc  6, 14
> ;lowpass filter our audio signal
> alautfilter tone aton, cpsoct(icutoff_oct)
> ;k1 linenr 0.01, 0.03, 0.1, 0.01
> outs alautfilter, alautfilter
> endin
> instr 2
> gkpedal ctrl7 1, 64, 0, 1
> endin
> 
> ; die Partiturereignisse werden definiert
> 
> f1  0   8193  10   1
> f 10  0 256 -23 "17tet.cps"
>
> i1   0    3600
> i2 0 3600
> 
> 
>
>
> 2009/7/3 Art Hunkins 
> Hello, Stefan,
>
> Here's what I'd try:
>
> In header:
> gkpedal init 0
>
> and after your massign:
> massign 64, 2
> (or whatever controller # your foot pedal is, assign its data to  
> instr 2. The massigns may be tricky.)
> You should be able to use any type of foot pedal your MIDI keyboard  
> will accept.
>
> Make a completely new instrument that receives MIDI data only on  
> controller 64 (or whichever # you choose):
> instr 2
> gkpedal ctrl7 1, 64, 0, 1
> endin
>
> The above instrument is always receiving foot controller data.
>
> In the score, add:
> i2 0 3600
>
> In your instr1, add (at beginning):
> ipedal = i(gkpedal)
>
> and later (after icps computed):
> if imnn != 60 and imnn != 62 and notnum ...... igoto skip ; this is  
> a list of *all your black MIDI key numbers*!
> icps = (ipedal > 0? icps - (icps * .1): icps + (icps * .1)
> skip:
>
> In the above, ".1" is the percentage of the frequency you wish to  
> add or subtract from your "basic pitch" (12tet).
>
> You may want to make some other kind of pitch adjustment. For  
> example you might put the low version (freq) of the black key pitch  
> in your table, then multiply it by some factor if the pedal were up  
> (gkpedal == 0):
> icps = (ipedal > 0? icps + (icps * .1): icps)
> Or perhaps you want different groups of "igoto" branches, where for  
> example all F#'s modify in one way, all G#'s in another.
>
> Let me know how it works out for you.
>
> Art Hunkins
> ----- Original Message -----
> From: Stefan Thomas
> To: csound@lists.bath.ac.uk
> Sent: Friday, July 03, 2009 3:22 AM
> Subject: [Csnd] Re: Re: different pitches during a live-midi  
> performance
>
> Dear Art,
> thanks for Your answer. I have attached a small example to this mail.
> I use there a scale with 17 pitches per octave but (as You all  
> know)I do have only 12 pitches per octave on the keyboard.
> I would like to allocate the black key two pitches and I would like  
> to change this with the pressure of the una-corda-pedal (the left  
> pedal). While pressing the left pedal down, I would like to get a  
> lower pitch, in the other case, the higher pitch.
> But I have no idea, how to do it with csound. So, I really need Your  
> help!
> At least I hope, that my idea of negotiating the limitation of 12  
> pitches per octave in this way will be interesting for other  
> musicians to.
> Thanks
> Stefan
> :
>
> 2009/7/2 Art Hunkins 
> Yes, certainly. But tell us more what you have in mind.
>
> I assume your keyboard would be a MIDI controller, correct?
>
> An obvious choice would be a MIDI foot controller input through the  
> keyboard, or a MIDI footswitch in conjunction with a foot controller  
> or a portamento pedal.
>
> If you need specific pitches from the pedal(s) - even from a  
> standalone portamento pedal, Csound could "round" the pedal to the  
> nearest pitch, or indeed add a rounded percentage to the current  
> keyboard pitch.
>
> There are many possibilities.
>
> Art Hunkins
> ----- Original Message -----
> From: Stefan Thomas
> To: csound@lists.bath.ac.uk
> Sent: Thursday, July 02, 2009 11:57 AM
> Subject: [Csnd] different pitches during a live-midi performance
>
> Dear community,
> I want to know, if it could be possible, to get different pitches  
> for e.g. fis and ges during a live-midi performance.
> What I desire, is to influence the pitch by a controller, e.g. the  
> left piano-pedal.
> I'm not speaking of pitch-bending, I really mean an exact, clearly  
> regognizable pitch, when You press a key with od without this  
> controller.
> Is it possible?
>
>
>
>
> Insert movie times and more without leaving Hotmail®. See how.
>
>
>
>
>
> <12tet.cps>



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

Date2009-09-23 07:59
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Hello

2009/9/22 joachim heintz :
> 1. The condition
>>
>> if imnn != 56 && imnn != 68 && imnn !=80    igoto skip
>
> will never become true. Probably you mean:
> if imnn != 56 || imnn != 68 || imnn !=80    igoto skip
> ("or" instead of "and")
>

..hm, maybe I'm missing something obvious but to me it looks like the
statement will be true in all cases where the imnn variable is not any
of the numbers 56, 68, 80

all best
Oeyvind


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

Date2009-09-23 08:56
Fromjoachim heintz
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Totally correct. I was wrong. So this is not a part of Stefans problem.
Thanks for the correction, Oeyvind -

	joachim


Am 23.09.2009 um 08:59 schrieb Oeyvind Brandtsegg:

> Hello
>
> 2009/9/22 joachim heintz :
>> 1. The condition
>>>
>>> if imnn != 56 && imnn != 68 && imnn !=80    igoto skip
>>
>> will never become true. Probably you mean:
>> if imnn != 56 || imnn != 68 || imnn !=80    igoto skip
>> ("or" instead of "and")
>>
>
> ..hm, maybe I'm missing something obvious but to me it looks like the
> statement will be true in all cases where the imnn variable is not any
> of the numbers 56, 68, 80
>
> all best
> Oeyvind
>
>
> 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-09-24 21:44
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Thank You all,
I found now a solution that works fine:
<CsoundSynthesizer>
<CsOptions>
-odevaudio -M0 -b400 -m0d
</CsOptions>
<CsInstruments>

sr     = 48000
kr     = 2400
ksmps  = 20
nchnls = 2
gkpedal init 0
 ipch = 8.02
  iequal = 12

 

massign    0, 1              ; assign all midi events to instr 1,
pgmassign  0, 1              ; also all program changes
instr 1
gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
ileftpedal = i(gkleftpedal)

if (ileftpedal>0) then
ituningtable = 11 ;choose tuningtable number 11, if the left pedal is down
;elseif ; here could be the function of another controller defined

else
ituningtable = 10   
endif

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between  Midi note nums and frequencies
 icps    table  indx, ituningtable
  iamp    ampmidi        10000
     

a1   oscil iamp, icps,  1
      outs a1, a1
      endin 
 

 
</CsInstruments>
; die Partiturereignisse werden definiert
<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "12tet.cps"   
f 11  0 256 -23 "24tet.cps"   

i1   0    45


</CsScore>



2009/9/23 joachim heintz <jh@joachimheintz.de>
Totally correct. I was wrong. So this is not a part of Stefans problem.
Thanks for the correction, Oeyvind -

       joachim


Am 23.09.2009 um 08:59 schrieb Oeyvind Brandtsegg:


Hello

2009/9/22 joachim heintz <jh@joachimheintz.de>:
1. The condition

if imnn != 56 && imnn != 68 && imnn !=80    igoto skip

will never become true. Probably you mean:
if imnn != 56 || imnn != 68 || imnn !=80    igoto skip
("or" instead of "and")


..hm, maybe I'm missing something obvious but to me it looks like the
statement will be true in all cases where the imnn variable is not any
of the numbers 56, 68, 80

all best
Oeyvind


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-09-29 08:46
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
AttachmentsbartokaufCundGis.cps  bartokaufCundGis.cps  bartokaufGisundDisis.cps  
Dear community,
unfortunately I have still problems with my idea of changing the pitch with the pressure of the left or the sostenuto-pedal.
When I use the left pedal, I'd never had problems with changing the pitch, but the when I using the middle-pedal, it works only sometimes, and most of the time the desired change of pitch doesn't appear.
I'm quite aware of the fact, that it could be a mechanical problem with the midi pedal, but, before I buy I new one, I want to kindly ask You, if You could have a look on the code. Maybee the problem is here, but I can't see.
Here the file:

<CsoundSynthesizer>
<CsOptions>
-odevaudio -M0 -b400 -m0d
</CsOptions>
<CsInstruments>

sr     = 48000
kr     = 2400
ksmps  = 20
nchnls = 2
gkleftpedal init 0
gkmiddlepedal init 0
 ipch = 8.02
  iequal = 12

massign    0, 1              ; assign all midi events to instr 1,
pgmassign  0, 1              ; also all program changes



;;;;;;; defining the 1st instrument ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
instr 1
gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
ileftpedal = i(gkleftpedal)
gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal
imiddlepedal = i(gkmiddlepedal)

if (ileftpedal>0) then
ituningtable = 11 ;choose tuningtable number 11, if the left pedal is down
elseif (imiddlepedal>0) then
ituningtable = 12
else
ituningtable = 10 ; when the left and the mittle pedal are not used, use tuningtable numer 10
endif

 imnn    notnum
 indx    =  imnn * 2 + 1   ; values in table alternate between
                           ; Midi note nums and frequencies
 icps    table  indx, ituningtable
  iamp    ampmidi        10000
     
icar = 1
imod = 1;
kndx = iamp/2000 ; the louder, the more index it will have

; making the overall amplitude envelope
kampenv mxadsr 100/iamp, 0.0402, 0.785, 0.102, 0.001
;the envelope for the fmindex
;        att,  decay,    isl, ausklingzeit
;kindexenv madsr 3000/iamp, 3, 0.2, 0.111, 0
kindexenv madsr 4000/iamp, 3, 0.2, 0.111, 0
; and now the whole sound
a1   foscil iamp*kampenv, icps, icar, imod, kndx*kindexenv, 1
;making a softer amplitude envelope with linenr 
;klinen linenr 1, 0.2, 0, 0.01
      ;outs      klinen*a1, klinen*a1
      outs a1, a1
      endin 
</CsInstruments>

<CsScore>
f1  0   8193  10   1
f 10  0 256 -23 "bartokaufCundGis.cps"
f 11  0 256 -23 "bartokaufCundFes.cps"   
f 12  0 256 -23 "bartokaufGisundDisis.cps"   

i1   0  60 ;play one minute 


</CsScore>





Date2009-09-29 09:01
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
It seems there might be an "override" if both pedals are down, the
middle pedal signal will be ignored, as you use if ..elseif. Maybe
this is not a problem in practice.
You could also try putting the ctrl7 opcodes in a separate instrument
(always on), maybe this is safer than turning the midi input on and
off with the instrument. Then you could also put a prinktk2 statement
in the always-on-midi-input instrument to see if the signal from the
middle pedal is consistent.

best
Oeyvind

2009/9/29 Stefan Thomas :
> Dear community,
> unfortunately I have still problems with my idea of changing the pitch with
> the pressure of the left or the sostenuto-pedal.
> When I use the left pedal, I'd never had problems with changing the pitch,
> but the when I using the middle-pedal, it works only sometimes, and most of
> the time the desired change of pitch doesn't appear.
> I'm quite aware of the fact, that it could be a mechanical problem with the
> midi pedal, but, before I buy I new one, I want to kindly ask You, if You
> could have a look on the code. Maybee the problem is here, but I can't see.
> Here the file:
>
> 
> 
> -odevaudio -M0 -b400 -m0d
> 
> 
>
> sr     = 48000
> kr     = 2400
> ksmps  = 20
> nchnls = 2
> gkleftpedal init 0
> gkmiddlepedal init 0
>  ipch = 8.02
>   iequal = 12
>
> massign    0, 1              ; assign all midi events to instr 1,
> pgmassign  0, 1              ; also all program changes
>
>
>
> ;;;;;;; defining the 1st instrument ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> instr 1
> gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
> ileftpedal = i(gkleftpedal)
> gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal
> imiddlepedal = i(gkmiddlepedal)
>
> if (ileftpedal>0) then
> ituningtable = 11 ;choose tuningtable number 11, if the left pedal is down
> elseif (imiddlepedal>0) then
> ituningtable = 12
> else
> ituningtable = 10 ; when the left and the mittle pedal are not used, use
> tuningtable numer 10
> endif
>
>  imnn    notnum
>  indx    =  imnn * 2 + 1   ; values in table alternate between
>                            ; Midi note nums and frequencies
>  icps    table  indx, ituningtable
>   iamp    ampmidi        10000
>
> icar = 1
> imod = 1;
> kndx = iamp/2000 ; the louder, the more index it will have
>
> ; making the overall amplitude envelope
> kampenv mxadsr 100/iamp, 0.0402, 0.785, 0.102, 0.001
> ;the envelope for the fmindex
> ;        att,  decay,    isl, ausklingzeit
> ;kindexenv madsr 3000/iamp, 3, 0.2, 0.111, 0
> kindexenv madsr 4000/iamp, 3, 0.2, 0.111, 0
> ; and now the whole sound
> a1   foscil iamp*kampenv, icps, icar, imod, kndx*kindexenv, 1
> ;making a softer amplitude envelope with linenr
> ;klinen linenr 1, 0.2, 0, 0.01
>       ;outs      klinen*a1, klinen*a1
>       outs a1, a1
>       endin
> 
>
> 
> f1  0   8193  10   1
> f 10  0 256 -23 "bartokaufCundGis.cps"
> f 11  0 256 -23 "bartokaufCundFes.cps"
> f 12  0 256 -23 "bartokaufGisundDisis.cps"
>
> i1   0  60 ;play one minute
>
>
> 
>
>
>
>
>


Date2009-09-29 09:33
FromStefan Thomas
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Dear Oeyvind,
thanks for Your fast reply!
You told me
Then you could also put a prinktk2 statement
in the always-on-midi-input instrument to see if the signal from the
middle pedal is consistent.
Could You be please so kind and give me an short code-example, how I can do this?
The other things, I guess, I've understand. I will try co create a second instrument, consisting only of the three pedals

2009/9/29 Oeyvind Brandtsegg <obrandts@gmail.com>
It seems there might be an "override" if both pedals are down, the
middle pedal signal will be ignored, as you use if ..elseif. Maybe
this is not a problem in practice.
You could also try putting the ctrl7 opcodes in a separate instrument
(always on), maybe this is safer than turning the midi input on and
off with the instrument. Then you could also put a prinktk2 statement
in the always-on-midi-input instrument to see if the signal from the
middle pedal is consistent.

best
Oeyvind

2009/9/29 Stefan Thomas <kontrapunktstefan@googlemail.com>:
> Dear community,
> unfortunately I have still problems with my idea of changing the pitch with
> the pressure of the left or the sostenuto-pedal.
> When I use the left pedal, I'd never had problems with changing the pitch,
> but the when I using the middle-pedal, it works only sometimes, and most of
> the time the desired change of pitch doesn't appear.
> I'm quite aware of the fact, that it could be a mechanical problem with the
> midi pedal, but, before I buy I new one, I want to kindly ask You, if You
> could have a look on the code. Maybee the problem is here, but I can't see.
> Here the file:
>
> <CsoundSynthesizer>
> <CsOptions>
> -odevaudio -M0 -b400 -m0d
> </CsOptions>
> <CsInstruments>
>
> sr     = 48000
> kr     = 2400
> ksmps  = 20
> nchnls = 2
> gkleftpedal init 0
> gkmiddlepedal init 0
>  ipch = 8.02
>   iequal = 12
>
> massign    0, 1              ; assign all midi events to instr 1,
> pgmassign  0, 1              ; also all program changes
>
>
>
> ;;;;;;; defining the 1st instrument ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> instr 1
> gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
> ileftpedal = i(gkleftpedal)
> gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal
> imiddlepedal = i(gkmiddlepedal)
>
> if (ileftpedal>0) then
> ituningtable = 11 ;choose tuningtable number 11, if the left pedal is down
> elseif (imiddlepedal>0) then
> ituningtable = 12
> else
> ituningtable = 10 ; when the left and the mittle pedal are not used, use
> tuningtable numer 10
> endif
>
>  imnn    notnum
>  indx    =  imnn * 2 + 1   ; values in table alternate between
>                            ; Midi note nums and frequencies
>  icps    table  indx, ituningtable
>   iamp    ampmidi        10000
>
> icar = 1
> imod = 1;
> kndx = iamp/2000 ; the louder, the more index it will have
>
> ; making the overall amplitude envelope
> kampenv mxadsr 100/iamp, 0.0402, 0.785, 0.102, 0.001
> ;the envelope for the fmindex
> ;        att,  decay,    isl, ausklingzeit
> ;kindexenv madsr 3000/iamp, 3, 0.2, 0.111, 0
> kindexenv madsr 4000/iamp, 3, 0.2, 0.111, 0
> ; and now the whole sound
> a1   foscil iamp*kampenv, icps, icar, imod, kndx*kindexenv, 1
> ;making a softer amplitude envelope with linenr
> ;klinen linenr 1, 0.2, 0, 0.01
>       ;outs      klinen*a1, klinen*a1
>       outs a1, a1
>       endin
> </CsInstruments>
>
> <CsScore>
> f1  0   8193  10   1
> f 10  0 256 -23 "bartokaufCundGis.cps"
> f 11  0 256 -23 "bartokaufCundFes.cps"
> f 12  0 256 -23 "bartokaufGisundDisis.cps"
>
> i1   0  60 ;play one minute
>
>
> </CsScore>
>
>
>
>
>


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


Date2009-09-29 12:51
FromOeyvind Brandtsegg
Subject[Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Yes,
the following instrument should be "always on",
like this in the score:
i1 0 9999 ; play for 9999 seconds

instr 1
gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal
printk2 gkleftpedal, 0
printk2 gkmiddlepedal , 10
; the number 10 in the line above,
; makes 10 spaces  at the start of the printed line,
; so it's easier to differentiate between the two prints
endin

Hope this helps
best
Oeyvind



2009/9/29 Stefan Thomas :
> Dear Oeyvind,
> thanks for Your fast reply!
> You told me
>>
>> Then you could also put a prinktk2 statement
>> in the always-on-midi-input instrument to see if the signal from the
>> middle pedal is consistent.
>
> Could You be please so kind and give me an short code-example, how I can do
> this?
> The other things, I guess, I've understand. I will try co create a second
> instrument, consisting only of the three pedals
>
> 2009/9/29 Oeyvind Brandtsegg 
>>
>> It seems there might be an "override" if both pedals are down, the
>> middle pedal signal will be ignored, as you use if ..elseif. Maybe
>> this is not a problem in practice.
>> You could also try putting the ctrl7 opcodes in a separate instrument
>> (always on), maybe this is safer than turning the midi input on and
>> off with the instrument. Then you could also put a prinktk2 statement
>> in the always-on-midi-input instrument to see if the signal from the
>> middle pedal is consistent.
>>
>> best
>> Oeyvind
>>
>> 2009/9/29 Stefan Thomas :
>> > Dear community,
>> > unfortunately I have still problems with my idea of changing the pitch
>> > with
>> > the pressure of the left or the sostenuto-pedal.
>> > When I use the left pedal, I'd never had problems with changing the
>> > pitch,
>> > but the when I using the middle-pedal, it works only sometimes, and most
>> > of
>> > the time the desired change of pitch doesn't appear.
>> > I'm quite aware of the fact, that it could be a mechanical problem with
>> > the
>> > midi pedal, but, before I buy I new one, I want to kindly ask You, if
>> > You
>> > could have a look on the code. Maybee the problem is here, but I can't
>> > see.
>> > Here the file:
>> >
>> > 
>> > 
>> > -odevaudio -M0 -b400 -m0d
>> > 
>> > 
>> >
>> > sr     = 48000
>> > kr     = 2400
>> > ksmps  = 20
>> > nchnls = 2
>> > gkleftpedal init 0
>> > gkmiddlepedal init 0
>> >  ipch = 8.02
>> >   iequal = 12
>> >
>> > massign    0, 1              ; assign all midi events to instr 1,
>> > pgmassign  0, 1              ; also all program changes
>> >
>> >
>> >
>> > ;;;;;;; defining the 1st instrument ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>> > instr 1
>> > gkleftpedal ctrl7 1, 67, 0, 1 ; controller 67 is the left pedal
>> > ileftpedal = i(gkleftpedal)
>> > gkmiddlepedal ctrl7 1, 66, 0, 1 ; controller 66 is the middle pedal
>> > imiddlepedal = i(gkmiddlepedal)
>> >
>> > if (ileftpedal>0) then
>> > ituningtable = 11 ;choose tuningtable number 11, if the left pedal is
>> > down
>> > elseif (imiddlepedal>0) then
>> > ituningtable = 12
>> > else
>> > ituningtable = 10 ; when the left and the mittle pedal are not used, use
>> > tuningtable numer 10
>> > endif
>> >
>> >  imnn    notnum
>> >  indx    =  imnn * 2 + 1   ; values in table alternate between
>> >                            ; Midi note nums and frequencies
>> >  icps    table  indx, ituningtable
>> >   iamp    ampmidi        10000
>> >
>> > icar = 1
>> > imod = 1;
>> > kndx = iamp/2000 ; the louder, the more index it will have
>> >
>> > ; making the overall amplitude envelope
>> > kampenv mxadsr 100/iamp, 0.0402, 0.785, 0.102, 0.001
>> > ;the envelope for the fmindex
>> > ;        att,  decay,    isl, ausklingzeit
>> > ;kindexenv madsr 3000/iamp, 3, 0.2, 0.111, 0
>> > kindexenv madsr 4000/iamp, 3, 0.2, 0.111, 0
>> > ; and now the whole sound
>> > a1   foscil iamp*kampenv, icps, icar, imod, kndx*kindexenv, 1
>> > ;making a softer amplitude envelope with linenr
>> > ;klinen linenr 1, 0.2, 0, 0.01
>> >       ;outs      klinen*a1, klinen*a1
>> >       outs a1, a1
>> >       endin
>> > 
>> >
>> > 
>> > f1  0   8193  10   1
>> > f 10  0 256 -23 "bartokaufCundGis.cps"
>> > f 11  0 256 -23 "bartokaufCundFes.cps"
>> > f 12  0 256 -23 "bartokaufGisundDisis.cps"
>> >
>> > i1   0  60 ;play one minute
>> >
>> >
>> > 
>> >
>> >
>> >
>> >
>> >
>>
>>
>> Send bugs reports to this list.
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>> csound"
>