Re: [Csnd] samples playback PWGL/Csound
Date | 2014-02-04 14:09 |
From | k_o_m_p |
Subject | Re: [Csnd] samples playback PWGL/Csound |
Joachim, thank you! This should work well. My problem at this point is that I'm not really sure how to select the sample and transposition if you have just a limited numbers of samples available - or if you use midi input with quarter tone intonation like 60.5 for example. Any ideas? Luis http://luisantunespena.eu joachim heintz |
Date | 2014-02-04 17:37 |
From | joachim heintz |
Subject | Re: [Csnd] samples playback PWGL/Csound |
i think it only depends on how you would like to select. for instance: "each key selects one sample, and the transposition depends on the velocity" or: "keys 57-59 denote sample 'bla.wav': 57 with a transposition of -50 cent, 58 with no transposition, 59 with +50 cent" or whatever. if you like, write here what you would like to have, and i am happy to suggest a way which hopefully leads to this. best - joachim Am 04.02.2014 15:09, schrieb k_o_m_p: > Joachim, thank you! This should work well. My problem at this point is that I'm not really sure how to select the sample and transposition if you have just a limited numbers of samples available - or if you use midi input with quarter tone intonation like 60.5 for example. > Any ideas? > Luis > > http://luisantunespena.eu > > joachim heintz |
Date | 2014-02-04 23:51 |
From | Luis Antunes Pena |
Subject | Re: [Csnd] samples playback PWGL/Csound |
Attachments | samplertest.csd |
Thanks Joachim. Attached is a csound
file with an example of what I am looking for. In this example
there is only 4 samples but they will be a lot more than that. The
problem is how to calculate ifile and itrans.
Am 04.02.14 18:37, schrieb joachim heintz: i think it only depends on how you would like to select. for instance: --
Severinswall 54 D-50678 Köln http://luisantunespena.eu +49 (0)221 29020757 +49 (0)176 968 09 867 (mobile) |
Date | 2014-02-05 09:53 |
From | joachim heintz |
Subject | Re: [Csnd] samples playback PWGL/Csound |
hi luis - so what you want to use the midi keyboard for transposing a sample? and you are looking for a simple way of selecting this sample? best - joachim Am 05.02.2014 00:51, schrieb Luis Antunes Pena: > Thanks Joachim. Attached is a csound file with an example of what I am > looking for. In this example there is only 4 samples but they will be a > lot more than that. The problem is how to calculate ifile and itrans. > > > Am 04.02.14 18:37, schrieb joachim heintz: >> i think it only depends on how you would like to select. for instance: >> "each key selects one sample, and the transposition depends on the >> velocity" >> or: >> "keys 57-59 denote sample 'bla.wav': 57 with a transposition of -50 >> cent, 58 with no transposition, 59 with +50 cent" >> or whatever. >> >> if you like, write here what you would like to have, and i am happy to >> suggest a way which hopefully leads to this. >> >> best - >> >> joachim >> >> >> Am 04.02.2014 15:09, schrieb k_o_m_p: >>> Joachim, thank you! This should work well. My problem at this point >>> is that I'm not really sure how to select the sample and >>> transposition if you have just a limited numbers of samples available >>> - or if you use midi input with quarter tone intonation like 60.5 for >>> example. >>> Any ideas? >>> Luis >>> >>> http://luisantunespena.eu >>> >>> joachim heintz |
Date | 2014-02-05 09:55 |
From | joachim heintz |
Subject | Re: [Csnd] samples playback PWGL/Csound |
i meant "what you want to do is to use ..." ... Am 05.02.2014 10:53, schrieb joachim heintz: > hi luis - > > so what you want to use the midi keyboard for transposing a sample? > and you are looking for a simple way of selecting this sample? > > best - > > joachim > > > Am 05.02.2014 00:51, schrieb Luis Antunes Pena: >> Thanks Joachim. Attached is a csound file with an example of what I am >> looking for. In this example there is only 4 samples but they will be a >> lot more than that. The problem is how to calculate ifile and itrans. >> >> >> Am 04.02.14 18:37, schrieb joachim heintz: >>> i think it only depends on how you would like to select. for instance: >>> "each key selects one sample, and the transposition depends on the >>> velocity" >>> or: >>> "keys 57-59 denote sample 'bla.wav': 57 with a transposition of -50 >>> cent, 58 with no transposition, 59 with +50 cent" >>> or whatever. >>> >>> if you like, write here what you would like to have, and i am happy to >>> suggest a way which hopefully leads to this. >>> >>> best - >>> >>> joachim >>> >>> >>> Am 04.02.2014 15:09, schrieb k_o_m_p: >>>> Joachim, thank you! This should work well. My problem at this point >>>> is that I'm not really sure how to select the sample and >>>> transposition if you have just a limited numbers of samples available >>>> - or if you use midi input with quarter tone intonation like 60.5 for >>>> example. >>>> Any ideas? >>>> Luis >>>> >>>> http://luisantunespena.eu >>>> >>>> joachim heintz |
Date | 2014-02-05 10:07 |
From | Luis Antunes Pena |
Subject | Re: [Csnd] samples playback PWGL/Csound |
I'm not using a keyboard. I use PWGL to
generate score events like those that are in the file I sent.
I need a way to play all possible pitches having only a few samples. The csound orc should be able to process events like these: ; midi-pitch i1 0 1 74.5 i1 1 1 75 i1 2 1 75.5 even if I have olny a sample with the picth 75. Sorry for the misunderstanding. Am 05.02.14 10:55, schrieb joachim heintz: i meant "what you want to do is to use ..." ... |
Date | 2014-02-05 11:39 |
From | jpff |
Subject | Re: [Csnd] samples playback PWGL/Csound |
If I ubderstand correctly You just need to adjust the pitch of the sample by 0.5 of a semitone ie multiply the pitch by 2^(1/24), with can be done easily with diskin2 or oscil3 On Wed, 5 Feb 2014, Luis Antunes Pena wrote: > I'm not using a keyboard. I use PWGL to generate score events like those that > are in the file I sent. > I need a way to play all possible pitches having only a few samples. The > csound orc should be able to process events like these: > > ; midi-pitch > i1 0 1 74.5 > i1 1 1 75 > i1 2 1 75.5 > > even if I have olny a sample with the picth 75. Sorry for the > misunderstanding. > > > Am 05.02.14 10:55, schrieb joachim heintz: > i meant "what you want to do is to use ..." ... > > > Am 05.02.2014 10:53, schrieb joachim heintz: > hi luis - > > so what you want to use the midi keyboard for > transposing a sample? > and you are looking for a simple way of selecting this > sample? > > best - > > joachim > > > Am 05.02.2014 00:51, schrieb Luis Antunes Pena: > Thanks Joachim. Attached is a csound file > with an example of what I am > looking for. In this example there is only > 4 samples but they will be a > lot more than that. The problem is how to > calculate ifile and itrans. > > > Am 04.02.14 18:37, schrieb joachim heintz: > i think it only depends on how > you would like to select. for > instance: > "each key selects one sample, > and the transposition depends > on the > velocity" > or: > "keys 57-59 denote sample > 'bla.wav': 57 with a > transposition of -50 > cent, 58 with no > transposition, 59 with +50 > cent" > or whatever. > > if you like, write here what > you would like to have, and i > am happy to > suggest a way which hopefully > leads to this. > > best - > > joachim > > > Am 04.02.2014 15:09, schrieb > k_o_m_p: > Joachim, thank > you! This should > work well. My > problem at this > point > is that I'm not > really sure how to > select the sample > and > transposition if > you have just a > limited numbers of > samples available > - or if you use > midi input with > quarter tone > intonation like > 60.5 for > example. > Any ideas? > Luis > > http://luisantunespena.eu > > joachim heintz > |
Date | 2014-02-05 19:23 |
From | joachim heintz |
Subject | Re: [Csnd] samples playback PWGL/Csound |
hi luis - still not quite sure if i understand you well, but i have these suggestions: 1) you want to denote: midi-note = sample number fractional part = deviation in semitones for instance: 74.5 = sample 74, one quartertone higher. code could be something like this: strset 74, "sampleX.wav" instr 1 iMidi = p4 iFile = int(iMidi) iCent = frac(iMidi) * 100 aSamp diskin iFile, cent(iCent) out aSamp endin 2) you want to connect say the notes 55-58 with sample X, 59-62 with sample Y etc. code could be something like: strset 1, "sampleX.wav" strset 2, "sampleY.wav" instr 1 iMidi = int(p4) if iMidi < 59 then iFile = 1 elseif iMidi < 63 then iFile = 2 endif aSamp diskin iFile, 1 out aSamp endin hope this helps, best - joachim Am 05.02.2014 11:07, schrieb Luis Antunes Pena: > I'm not using a keyboard. I use PWGL to generate score events like those > that are in the file I sent. > I need a way to play all possible pitches having only a few samples. The > csound orc should be able to process events like these: > > ; midi-pitch > i1 0 1 74.5 > i1 1 1 75 > i1 2 1 75.5 > > even if I have olny a sample with the picth 75. Sorry for the > misunderstanding. > > > Am 05.02.14 10:55, schrieb joachim heintz: >> i meant "what you want to do is to use ..." ... >> >> >> Am 05.02.2014 10:53, schrieb joachim heintz: >>> hi luis - >>> >>> so what you want to use the midi keyboard for transposing a sample? >>> and you are looking for a simple way of selecting this sample? >>> >>> best - >>> >>> joachim >>> >>> >>> Am 05.02.2014 00:51, schrieb Luis Antunes Pena: >>>> Thanks Joachim. Attached is a csound file with an example of what I am >>>> looking for. In this example there is only 4 samples but they will be a >>>> lot more than that. The problem is how to calculate ifile and itrans. >>>> >>>> >>>> Am 04.02.14 18:37, schrieb joachim heintz: >>>>> i think it only depends on how you would like to select. for instance: >>>>> "each key selects one sample, and the transposition depends on the >>>>> velocity" >>>>> or: >>>>> "keys 57-59 denote sample 'bla.wav': 57 with a transposition of -50 >>>>> cent, 58 with no transposition, 59 with +50 cent" >>>>> or whatever. >>>>> >>>>> if you like, write here what you would like to have, and i am happy to >>>>> suggest a way which hopefully leads to this. >>>>> >>>>> best - >>>>> >>>>> joachim >>>>> >>>>> >>>>> Am 04.02.2014 15:09, schrieb k_o_m_p: >>>>>> Joachim, thank you! This should work well. My problem at this point >>>>>> is that I'm not really sure how to select the sample and >>>>>> transposition if you have just a limited numbers of samples available >>>>>> - or if you use midi input with quarter tone intonation like 60.5 for >>>>>> example. >>>>>> Any ideas? >>>>>> Luis >>>>>> >>>>>> http://luisantunespena.eu >>>>>> >>>>>> joachim heintz |
Date | 2014-02-05 20:00 |
From | Luis Antunes Pena |
Subject | Re: [Csnd] samples playback PWGL/Csound |
That's correct. But the problem is that
I don't know which sample is the nearst.
Am 05.02.14 12:39, schrieb jpff: If I ubderstand correctly You just need to adjust the pitch of the sample by 0.5 of a semitone ie multiply the pitch by 2^(1/24), with can be done easily with diskin2 or oscil3 |
Date | 2014-02-09 16:06 |
From | Luis Antunes Pena |
Subject | Re: [Csnd] samples playback PWGL/Csound |
Joachim and Tarmo,
here's the solution I found working with arrays. iarr is the list of available samples. The LOOP loop_lt indx, 1, icount, loop is there to find out wich is the nearst sample. Thanks for your help. Luis <CsoundSynthesizer> <CsOptions> -odac -d -m0 </CsOptions> <CsInstruments>
nchnls = 2 ksmps = 16 0dbfs = 1
;#include "/Volumes/snd/arbeit/komp/2014-Cottbus/csnd/include/samples.txt"
strset 21876, "/Volumes/snd/arbeit/sounds/String-I-E5-f.AIF" strset 21879, "/Volumes/snd/arbeit/sounds/String-I-G5-f.AIF" strset 21882, "/Volumes/snd/arbeit/sounds/String-I-A#5-f.AIF" strset 21885, "/Volumes/snd/arbeit/sounds/String-I-C#6-f.AIF" ;...
instr 21 indx init 0 ;index for loop iarrmin init 99
;orchesra instruments samples available ;violin iarr[] fillarray 55, 58 ,61 ,62 ,64 ,65 ,67 ,68, 69 ,70 ,71 ,72 ,73 ,74 ,75 ,76 ,77 ,78 ,79 ,81 ,82 ,84 ,85 ,88 ilen lenarray iarr
iinstr = 21 imidi = p4 idyn = 8
imfrac = frac(imidi) imint=imidi - imfrac icount = ilen-1
loop: ;LOOP --------------- idiff = abs(imint - iarr[indx]) if idiff < iarrmin then iarrmin = idiff iarrval = iarr[indx] iarrndx = indx endif loop_lt indx, 1, icount, loop ;LOOP ---------------
ifile = iinstr * 1000 + idyn * 100 + iarrval ihalftone = imidi - iarrval - imfrac icents = cent(imfrac*100) itrans = 2^(ihalftone/12) * icents
print imidi, ifile, ihalftone, icents
asample diskin2 ifile, itrans out asample endin
</CsInstruments> <CsScore> i21 0 .2 60 i21 + . 66.25 i21 + . 66.5 i21 + . 66.75 i21 + . 67 i21 + . 67.25 i21 + . 67.5 i21 + . 67.75 i21 + . 68 e </CsScore> </CsoundSynthesizer>
Am 05.02.14 20:23, schrieb joachim heintz: hi luis - |