[Csnd] Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance
Date | 2009-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
|
Date | 2009-07-08 18:00 |
From | Stefan 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>
|
Date | 2009-07-08 18:10 |
From | Stefan 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, |
Date | 2009-09-20 14:25 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Attachments | 12tet.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:
<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: |
Date | 2009-09-22 17:49 |
From | joachim 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: > |
Date | 2009-09-23 07:59 |
From | Oeyvind 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 |
Date | 2009-09-23 08:56 |
From | joachim 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 |
Date | 2009-09-24 21:44 |
From | Stefan 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. |
Date | 2009-09-29 08:46 |
From | Stefan Thomas |
Subject | [Csnd] Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: different pitches during a live-midi performance |
Attachments | bartokaufCundGis.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> |
Date | 2009-09-29 09:01 |
From | Oeyvind 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 |
Date | 2009-09-29 09:33 |
From | Stefan 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 statementCould 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 |
Date | 2009-09-29 12:51 |
From | Oeyvind 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 |