Csound Csound-dev Csound-tekno Search About

Re: [Csnd] samples playback PWGL/Csound

Date2014-02-04 14:09
Fromk_o_m_p
SubjectRe: [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  schrieb:

>hi luis -
>
>this should be very easy to do. the midi note triggers an instrument 
>instance, and this instance selects the sample, and applies any other 
>transformations. something like:
>
>strset 60, "sample1.wav"
>strset 61, "sample2.wav"
>...
>
>massign 0, "Play"
>
>instr Play
>iSample notnum
>iTransp = 100 ;cent
>aPlay diskin iSample, cent(iTransp)
>out aPlay
>endin
>
>this is not tested, but you will know what i mean. not sure, though, in 
>your example, how you get the sample and the transposition.
>
>hoe this helps, best -
>
>	joachim
>
>
>Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
>> Hello,
>>
>> I'm building a patch in PWGL/Lisp that generates score events to trigger 61
>> samples within a csound orchestra. This works fine until now. My problem
>> is that the PWGL Patch is becoming more complex and it takes quite a
>> long time to generate the csound score. One solution would be to move
>> some tasks from PWGL to Csound which should be more much faster. This is
>> where I would like to ask your opinion. How would you do the following:
>> Csound receives a midi note number and has to decide according to the
>> available samples which one to choose and which transposition should be
>> applied. Something like this:
>>
>> Samples available (60 63 66 69)
>> Input Midi note: 61
>> Output: sample 60 transposition 2^1/12
>>
>> I thought about using tables but also about arrays - I'm not yet
>> familiar with arrays.
>>
>> Thanks.
>>
>> Luís
>>
>> --
>> signatur http://luisantunespena.eu
>>
>
>
>Send bugs reports to the Sourceforge bug trackers
>csound6:
>            https://sourceforge.net/p/csound/tickets/
>csound5:
>            https://sourceforge.net/p/csound/bugs/
>Discussions of bugs and features can be posted here
>To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>

Date2014-02-04 17:37
Fromjoachim heintz
SubjectRe: [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  schrieb:
>
>> hi luis -
>>
>> this should be very easy to do. the midi note triggers an instrument
>> instance, and this instance selects the sample, and applies any other
>> transformations. something like:
>>
>> strset 60, "sample1.wav"
>> strset 61, "sample2.wav"
>> ...
>>
>> massign 0, "Play"
>>
>> instr Play
>> iSample notnum
>> iTransp = 100 ;cent
>> aPlay diskin iSample, cent(iTransp)
>> out aPlay
>> endin
>>
>> this is not tested, but you will know what i mean. not sure, though, in
>> your example, how you get the sample and the transposition.
>>
>> hoe this helps, best -
>>
>> 	joachim
>>
>>
>> Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
>>> Hello,
>>>
>>> I'm building a patch in PWGL/Lisp that generates score events to trigger 61
>>> samples within a csound orchestra. This works fine until now. My problem
>>> is that the PWGL Patch is becoming more complex and it takes quite a
>>> long time to generate the csound score. One solution would be to move
>>> some tasks from PWGL to Csound which should be more much faster. This is
>>> where I would like to ask your opinion. How would you do the following:
>>> Csound receives a midi note number and has to decide according to the
>>> available samples which one to choose and which transposition should be
>>> applied. Something like this:
>>>
>>> Samples available (60 63 66 69)
>>> Input Midi note: 61
>>> Output: sample 60 transposition 2^1/12
>>>
>>> I thought about using tables but also about arrays - I'm not yet
>>> familiar with arrays.
>>>
>>> Thanks.
>>>
>>> Luís
>>>
>>> --
>>> signatur http://luisantunespena.eu
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug trackers
>> csound6:
>>             https://sourceforge.net/p/csound/tickets/
>> csound5:
>>             https://sourceforge.net/p/csound/bugs/
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>              https://sourceforge.net/p/csound/tickets/
> csound5:
>              https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>

Date2014-02-04 23:51
FromLuis Antunes Pena
SubjectRe: [Csnd] samples playback PWGL/Csound
Attachmentssamplertest.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:
"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 <jh@joachimheintz.de> schrieb:

hi luis -

this should be very easy to do. the midi note triggers an instrument
instance, and this instance selects the sample, and applies any other
transformations. something like:

strset 60, "sample1.wav"
strset 61, "sample2.wav"
...

massign 0, "Play"

instr Play
iSample notnum
iTransp = 100 ;cent
aPlay diskin iSample, cent(iTransp)
out aPlay
endin

this is not tested, but you will know what i mean. not sure, though, in
your example, how you get the sample and the transposition.

hoe this helps, best -

    joachim


Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
Hello,

I'm building a patch in PWGL/Lisp that generates score events to trigger 61
samples within a csound orchestra. This works fine until now. My problem
is that the PWGL Patch is becoming more complex and it takes quite a
long time to generate the csound score. One solution would be to move
some tasks from PWGL to Csound which should be more much faster. This is
where I would like to ask your opinion. How would you do the following:
Csound receives a midi note number and has to decide according to the
available samples which one to choose and which transposition should be
applied. Something like this:

Samples available (60 63 66 69)
Input Midi note: 61
Output: sample 60 transposition 2^1/12

I thought about using tables but also about arrays - I'm not yet
familiar with arrays.

Thanks.

Luís

--
signatur http://luisantunespena.eu



Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"



Send bugs reports to the Sourceforge bug trackers
csound6:
             https://sourceforge.net/p/csound/tickets/
csound5:
             https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




Send bugs reports to the Sourceforge bug trackers
csound6:
           https://sourceforge.net/p/csound/tickets/
csound5:
           https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
signatur luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)

Date2014-02-05 09:53
Fromjoachim heintz
SubjectRe: [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  schrieb:
>>>
>>>> hi luis -
>>>>
>>>> this should be very easy to do. the midi note triggers an instrument
>>>> instance, and this instance selects the sample, and applies any other
>>>> transformations. something like:
>>>>
>>>> strset 60, "sample1.wav"
>>>> strset 61, "sample2.wav"
>>>> ...
>>>>
>>>> massign 0, "Play"
>>>>
>>>> instr Play
>>>> iSample notnum
>>>> iTransp = 100 ;cent
>>>> aPlay diskin iSample, cent(iTransp)
>>>> out aPlay
>>>> endin
>>>>
>>>> this is not tested, but you will know what i mean. not sure, though, in
>>>> your example, how you get the sample and the transposition.
>>>>
>>>> hoe this helps, best -
>>>>
>>>>     joachim
>>>>
>>>>
>>>> Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
>>>>> Hello,
>>>>>
>>>>> I'm building a patch in PWGL/Lisp that generates score events to
>>>>> trigger 61
>>>>> samples within a csound orchestra. This works fine until now. My
>>>>> problem
>>>>> is that the PWGL Patch is becoming more complex and it takes quite a
>>>>> long time to generate the csound score. One solution would be to move
>>>>> some tasks from PWGL to Csound which should be more much faster.
>>>>> This is
>>>>> where I would like to ask your opinion. How would you do the
>>>>> following:
>>>>> Csound receives a midi note number and has to decide according to the
>>>>> available samples which one to choose and which transposition
>>>>> should be
>>>>> applied. Something like this:
>>>>>
>>>>> Samples available (60 63 66 69)
>>>>> Input Midi note: 61
>>>>> Output: sample 60 transposition 2^1/12
>>>>>
>>>>> I thought about using tables but also about arrays - I'm not yet
>>>>> familiar with arrays.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> Luís
>>>>>
>>>>> --
>>>>> signatur http://luisantunespena.eu
>>>>>
>>>>
>>>>
>>>> Send bugs reports to the Sourceforge bug trackers
>>>> csound6:
>>>> https://sourceforge.net/p/csound/tickets/
>>>> csound5:
>>>> https://sourceforge.net/p/csound/bugs/
>>>> Discussions of bugs and features can be posted here
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>> "unsubscribe csound"
>>>>
>>>>
>>>
>>> Send bugs reports to the Sourceforge bug trackers
>>> csound6:
>>> https://sourceforge.net/p/csound/tickets/
>>> csound5:
>>> https://sourceforge.net/p/csound/bugs/
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe csound"
>>>
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug trackers
>> csound6:
>> https://sourceforge.net/p/csound/tickets/
>> csound5:
>> https://sourceforge.net/p/csound/bugs/
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe csound"
>>
>>
>>
>
>
> --
> signatur luis antunes pena
> Severinswall 54
> D-50678 Köln
>
> http://luisantunespena.eu
>
> +49 (0)221 29020757
> +49 (0)176 968 09 867 (mobile)

Date2014-02-05 09:55
Fromjoachim heintz
SubjectRe: [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  schrieb:
>>>>
>>>>> hi luis -
>>>>>
>>>>> this should be very easy to do. the midi note triggers an instrument
>>>>> instance, and this instance selects the sample, and applies any other
>>>>> transformations. something like:
>>>>>
>>>>> strset 60, "sample1.wav"
>>>>> strset 61, "sample2.wav"
>>>>> ...
>>>>>
>>>>> massign 0, "Play"
>>>>>
>>>>> instr Play
>>>>> iSample notnum
>>>>> iTransp = 100 ;cent
>>>>> aPlay diskin iSample, cent(iTransp)
>>>>> out aPlay
>>>>> endin
>>>>>
>>>>> this is not tested, but you will know what i mean. not sure,
>>>>> though, in
>>>>> your example, how you get the sample and the transposition.
>>>>>
>>>>> hoe this helps, best -
>>>>>
>>>>>     joachim
>>>>>
>>>>>
>>>>> Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
>>>>>> Hello,
>>>>>>
>>>>>> I'm building a patch in PWGL/Lisp that generates score events to
>>>>>> trigger 61
>>>>>> samples within a csound orchestra. This works fine until now. My
>>>>>> problem
>>>>>> is that the PWGL Patch is becoming more complex and it takes quite a
>>>>>> long time to generate the csound score. One solution would be to move
>>>>>> some tasks from PWGL to Csound which should be more much faster.
>>>>>> This is
>>>>>> where I would like to ask your opinion. How would you do the
>>>>>> following:
>>>>>> Csound receives a midi note number and has to decide according to the
>>>>>> available samples which one to choose and which transposition
>>>>>> should be
>>>>>> applied. Something like this:
>>>>>>
>>>>>> Samples available (60 63 66 69)
>>>>>> Input Midi note: 61
>>>>>> Output: sample 60 transposition 2^1/12
>>>>>>
>>>>>> I thought about using tables but also about arrays - I'm not yet
>>>>>> familiar with arrays.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> Luís
>>>>>>
>>>>>> --
>>>>>> signatur http://luisantunespena.eu
>>>>>>
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug trackers
>>>>> csound6:
>>>>> https://sourceforge.net/p/csound/tickets/
>>>>> csound5:
>>>>> https://sourceforge.net/p/csound/bugs/
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>>
>>>>>
>>>>
>>>> Send bugs reports to the Sourceforge bug trackers
>>>> csound6:
>>>> https://sourceforge.net/p/csound/tickets/
>>>> csound5:
>>>> https://sourceforge.net/p/csound/bugs/
>>>> Discussions of bugs and features can be posted here
>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>> "unsubscribe csound"
>>>>
>>>>
>>>
>>>
>>> Send bugs reports to the Sourceforge bug trackers
>>> csound6:
>>> https://sourceforge.net/p/csound/tickets/
>>> csound5:
>>> https://sourceforge.net/p/csound/bugs/
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>> "unsubscribe csound"
>>>
>>>
>>>
>>
>>
>> --
>> signatur luis antunes pena
>> Severinswall 54
>> D-50678 Köln
>>
>> http://luisantunespena.eu
>>
>> +49 (0)221 29020757
>> +49 (0)176 968 09 867 (mobile)
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"
>
>
>

Date2014-02-05 10:07
FromLuis Antunes Pena
SubjectRe: [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 ..." ...


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 <jh@joachimheintz.de> schrieb:

hi luis -

this should be very easy to do. the midi note triggers an instrument
instance, and this instance selects the sample, and applies any other
transformations. something like:

strset 60, "sample1.wav"
strset 61, "sample2.wav"
...

massign 0, "Play"

instr Play
iSample notnum
iTransp = 100 ;cent
aPlay diskin iSample, cent(iTransp)
out aPlay
endin

this is not tested, but you will know what i mean. not sure,
though, in
your example, how you get the sample and the transposition.

hoe this helps, best -

    joachim


Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
Hello,

I'm building a patch in PWGL/Lisp that generates score events to
trigger 61
samples within a csound orchestra. This works fine until now. My
problem
is that the PWGL Patch is becoming more complex and it takes quite a
long time to generate the csound score. One solution would be to move
some tasks from PWGL to Csound which should be more much faster.
This is
where I would like to ask your opinion. How would you do the
following:
Csound receives a midi note number and has to decide according to the
available samples which one to choose and which transposition
should be
applied. Something like this:

Samples available (60 63 66 69)
Input Midi note: 61
Output: sample 60 transposition 2^1/12

I thought about using tables but also about arrays - I'm not yet
familiar with arrays.

Thanks.

Luís

--
signatur http://luisantunespena.eu



Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"



Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"




Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"





--
signatur luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)


Send bugs reports to the Sourceforge bug trackers
csound6:
            https://sourceforge.net/p/csound/tickets/
csound5:
            https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"





Send bugs reports to the Sourceforge bug trackers
csound6:
           https://sourceforge.net/p/csound/tickets/
csound5:
           https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
signatur
http://luisantunespena.eu


Date2014-02-05 11:39
Fromjpff
SubjectRe: [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
>                               
>                               schrieb:
>
>                                     hi
>                                     luis -
>
>                                     this
>                                     should
>                                     be
>                                     very
>                                     easy
>                                     to do.
>                                     the
>                                     midi
>                                     note
>                                     triggers
>                                     an
>                                     instrument
>                                     instance,
>                                     and
>                                     this
>                                     instance
>                                     selects
>                                     the
>                                     sample,
>                                     and
>                                     applies
>                                     any
>                                     other
>                                     transformations.
>                                     something
>                                     like:
>
>                                     strset
>                                     60,
>                                     "sample1.wav"
>                                     strset
>                                     61,
>                                     "sample2.wav"
>                                     ...
>
>                                     massign
>                                     0,
>                                     "Play"
>
>                                     instr
>                                     Play
>                                     iSample
>                                     notnum
>                                     iTransp
>                                     = 100
>                                     ;cent
>                                     aPlay
>                                     diskin
>                                     iSample,
>                                     cent(iTransp)
>                                     out
>                                     aPlay
>                                     endin
>
>                                     this
>                                     is not
>                                     tested,
>                                     but
>                                     you
>                                     will
>                                     know
>                                     what i
>                                     mean.
>                                     not
>                                     sure,
>                                     though,
>                                     in
>                                     your
>                                     example,
>                                     how
>                                     you
>                                     get
>                                     the
>                                     sample
>                                     and
>                                     the
>                                     transposition.
>
>                                     hoe
>                                     this
>                                     helps,
>                                     best -
>
>                                        
>                                     joachim
> 
>
>                                     Am
>                                     04.02.2014
>                                     00:08,
>                                     schrieb
>                                     Luis
>                                     Antunes
>                                     Pena:
>                                           Hello,
>
>                                           I'm
>                                           building
>                                           a
>                                           patch
>                                           in
>                                           PWGL/Lisp
>                                           that
>                                           generates
>                                           score
>                                           events
>                                           to
>                                           trigger
>                                           61
>                                           samples
>                                           within
>                                           a
>                                           csound
>                                           orchestra.
>                                           This
>                                           works
>                                           fine
>                                           until
>                                           now.
>                                           My
>                                           problem
>                                           is
>                                           that
>                                           the
>                                           PWGL
>                                           Patch
>                                           is
>                                           becoming
>                                           more
>                                           complex
>                                           and
>                                           it
>                                           takes
>                                           quite
>                                           a
>                                           long
>                                           time
>                                           to
>                                           generate
>                                           the
>                                           csound
>                                           score.
>                                           One
>                                           solution
>                                           would
>                                           be
>                                           to
>                                           move
>                                           some
>                                           tasks
>                                           from
>                                           PWGL
>                                           to
>                                           Csound
>                                           which
>                                           should
>                                           be
>                                           more
>                                           much
>                                           faster.
>                                           This
>                                           is
>                                           where
>                                           I
>                                           would
>                                           like
>                                           to
>                                           ask
>                                           your
>                                           opinion.
>                                           How
>                                           would
>                                           you
>                                           do
>                                           the
>                                           following:
>                                           Csound
>                                           receives
>                                           a
>                                           midi
>                                           note
>                                           number
>                                           and
>                                           has
>                                           to
>                                           decide
>                                           according
>                                           to
>                                           the
>                                           available
>                                           samples
>                                           which
>                                           one
>                                           to
>                                           choose
>                                           and
>                                           which
>                                           transposition
>                                           should
>                                           be
>                                           applied.
>                                           Something
>                                           like
>                                           this:
>
>                                           Samples
>                                           available
>                                           (60
>                                           63
>                                           66
>                                           69)
>                                           Input
>                                           Midi
>                                           note:
>                                           61
>                                           Output:
>                                           sample
>                                           60
>                                           transposition
>                                           2^1/12
>
>                                           I
>                                           thought
>                                           about
>                                           using
>                                           tables
>                                           but
>                                           also
>                                           about
>                                           arrays
>                                           -
>                                           I'm
>                                           not
>                                           yet
>                                           familiar
>                                           with
>                                           arrays.
>
>                                           Thanks.
>
>                                           Luís
>
>                                           --
>                                           signatur
>                                           http://luisantunespena.eu
> 
> 
>
>                                     Send
>                                     bugs
>                                     reports
>                                     to the
>                                     Sourceforge
>                                     bug
>                                     trackers
>                                     csound6:
>                                     https://sourceforge.net/p/csound/tickets/
>                                     csound5:
>                                     https://sourceforge.net/p/csound/bugs/
>                                     Discussions
>                                     of
>                                     bugs
>                                     and
>                                     features
>                                     can be
>                                     posted
>                                     here
>                                     To
>                                     unsubscribe,
>                                     send
>                                     email
>                                     sympa@lists.bath.ac.uk
>                                     with
>                                     body
>                                     "unsubscribe
>                                     csound"
> 
> 
>
>                               Send bugs reports
>                               to the Sourceforge
>                               bug trackers
>                               csound6:
>                               https://sourceforge.net/p/csound/tickets/
>                               csound5:
>                               https://sourceforge.net/p/csound/bugs/
>                               Discussions of
>                               bugs and features
>                               can be posted here
>                               To unsubscribe,
>                               send email
>                               sympa@lists.bath.ac.uk
>                               with body
>                               "unsubscribe
>                               csound"
> 
> 
> 
>
>                         Send bugs reports to the
>                         Sourceforge bug trackers
>                         csound6:
>                         https://sourceforge.net/p/csound/tickets/
>                         csound5:
>                         https://sourceforge.net/p/csound/bugs/
>                         Discussions of bugs and
>                         features can be posted here
>                         To unsubscribe, send email
>                         sympa@lists.bath.ac.uk with
>                         body
>                         "unsubscribe csound"
> 
> 
> 
> 
>
>                   --
>                   signatur luis antunes pena
>                   Severinswall 54
>                   D-50678 Köln
>
>                   http://luisantunespena.eu
>
>                   +49 (0)221 29020757
>                   +49 (0)176 968 09 867 (mobile)
> 
> 
>
>             Send bugs reports to the Sourceforge bug trackers
>             csound6:
>                         https://sourceforge.net/p/csound/tickets/
>             csound5:
>                         https://sourceforge.net/p/csound/bugs/
>             Discussions of bugs and features can be posted here
>             To unsubscribe, send email sympa@lists.bath.ac.uk with
>             body "unsubscribe
>             csound"
> 
> 
> 
> 
>
>       Send bugs reports to the Sourceforge bug trackers
>       csound6:
>                  https://sourceforge.net/p/csound/tickets/
>       csound5:
>                  https://sourceforge.net/p/csound/bugs/
>       Discussions of bugs and features can be posted here
>       To unsubscribe, send email sympa@lists.bath.ac.uk with body
>       "unsubscribe csound"
> 
> 
> 
> 
> 
> --
> 
> http://luisantunespena.eu
> 
>

Date2014-02-05 19:23
Fromjoachim heintz
SubjectRe: [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  schrieb:
>>>>>>
>>>>>>> hi luis -
>>>>>>>
>>>>>>> this should be very easy to do. the midi note triggers an instrument
>>>>>>> instance, and this instance selects the sample, and applies any
>>>>>>> other
>>>>>>> transformations. something like:
>>>>>>>
>>>>>>> strset 60, "sample1.wav"
>>>>>>> strset 61, "sample2.wav"
>>>>>>> ...
>>>>>>>
>>>>>>> massign 0, "Play"
>>>>>>>
>>>>>>> instr Play
>>>>>>> iSample notnum
>>>>>>> iTransp = 100 ;cent
>>>>>>> aPlay diskin iSample, cent(iTransp)
>>>>>>> out aPlay
>>>>>>> endin
>>>>>>>
>>>>>>> this is not tested, but you will know what i mean. not sure,
>>>>>>> though, in
>>>>>>> your example, how you get the sample and the transposition.
>>>>>>>
>>>>>>> hoe this helps, best -
>>>>>>>
>>>>>>>     joachim
>>>>>>>
>>>>>>>
>>>>>>> Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
>>>>>>>> Hello,
>>>>>>>>
>>>>>>>> I'm building a patch in PWGL/Lisp that generates score events to
>>>>>>>> trigger 61
>>>>>>>> samples within a csound orchestra. This works fine until now. My
>>>>>>>> problem
>>>>>>>> is that the PWGL Patch is becoming more complex and it takes
>>>>>>>> quite a
>>>>>>>> long time to generate the csound score. One solution would be to
>>>>>>>> move
>>>>>>>> some tasks from PWGL to Csound which should be more much faster.
>>>>>>>> This is
>>>>>>>> where I would like to ask your opinion. How would you do the
>>>>>>>> following:
>>>>>>>> Csound receives a midi note number and has to decide according
>>>>>>>> to the
>>>>>>>> available samples which one to choose and which transposition
>>>>>>>> should be
>>>>>>>> applied. Something like this:
>>>>>>>>
>>>>>>>> Samples available (60 63 66 69)
>>>>>>>> Input Midi note: 61
>>>>>>>> Output: sample 60 transposition 2^1/12
>>>>>>>>
>>>>>>>> I thought about using tables but also about arrays - I'm not yet
>>>>>>>> familiar with arrays.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> Luís
>>>>>>>>
>>>>>>>> --
>>>>>>>> signatur http://luisantunespena.eu
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Send bugs reports to the Sourceforge bug trackers
>>>>>>> csound6:
>>>>>>> https://sourceforge.net/p/csound/tickets/
>>>>>>> csound5:
>>>>>>> https://sourceforge.net/p/csound/bugs/
>>>>>>> Discussions of bugs and features can be posted here
>>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>>> "unsubscribe csound"
>>>>>>>
>>>>>>>
>>>>>>
>>>>>> Send bugs reports to the Sourceforge bug trackers
>>>>>> csound6:
>>>>>> https://sourceforge.net/p/csound/tickets/
>>>>>> csound5:
>>>>>> https://sourceforge.net/p/csound/bugs/
>>>>>> Discussions of bugs and features can be posted here
>>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>>> "unsubscribe csound"
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> Send bugs reports to the Sourceforge bug trackers
>>>>> csound6:
>>>>> https://sourceforge.net/p/csound/tickets/
>>>>> csound5:
>>>>> https://sourceforge.net/p/csound/bugs/
>>>>> Discussions of bugs and features can be posted here
>>>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>>>>> "unsubscribe csound"
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> signatur luis antunes pena
>>>> Severinswall 54
>>>> D-50678 Köln
>>>>
>>>> http://luisantunespena.eu
>>>>
>>>> +49 (0)221 29020757
>>>> +49 (0)176 968 09 867 (mobile)
>>>
>>>
>>> Send bugs reports to the Sourceforge bug trackers
>>> csound6:
>>> https://sourceforge.net/p/csound/tickets/
>>> csound5:
>>> https://sourceforge.net/p/csound/bugs/
>>> Discussions of bugs and features can be posted here
>>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
>>> csound"
>>>
>>>
>>>
>>
>>
>> Send bugs reports to the Sourceforge bug trackers
>> csound6:
>> https://sourceforge.net/p/csound/tickets/
>> csound5:
>> https://sourceforge.net/p/csound/bugs/
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body
>> "unsubscribe csound"
>>
>>
>>
>
>
> --
> signatur
> http://luisantunespena.eu

Date2014-02-05 20:00
FromLuis Antunes Pena
SubjectRe: [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

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
                              <jh@joachimheintz.de>
                              schrieb:

                                    hi
                                    luis -

                                    this
                                    should
                                    be
                                    very
                                    easy
                                    to do.
                                    the
                                    midi
                                    note
                                    triggers
                                    an
                                    instrument
                                    instance,
                                    and
                                    this
                                    instance
                                    selects
                                    the
                                    sample,
                                    and
                                    applies
                                    any
                                    other
                                    transformations.
                                    something
                                    like:

                                    strset
                                    60,
                                    "sample1.wav"
                                    strset
                                    61,
                                    "sample2.wav"
                                    ...

                                    massign
                                    0,
                                    "Play"

                                    instr
                                    Play
                                    iSample
                                    notnum
                                    iTransp
                                    = 100
                                    ;cent
                                    aPlay
                                    diskin
                                    iSample,
                                    cent(iTransp)
                                    out
                                    aPlay
                                    endin

                                    this
                                    is not
                                    tested,
                                    but
                                    you
                                    will
                                    know
                                    what i
                                    mean.
                                    not
                                    sure,
                                    though,
                                    in
                                    your
                                    example,
                                    how
                                    you
                                    get
                                    the
                                    sample
                                    and
                                    the
                                    transposition.

                                    hoe
                                    this
                                    helps,
                                    best -

                                       
                                    joachim


                                    Am
                                    04.02.2014
                                    00:08,
                                    schrieb
                                    Luis
                                    Antunes
                                    Pena:
                                          Hello,

                                          I'm
                                          building
                                          a
                                          patch
                                          in
                                          PWGL/Lisp
                                          that
                                          generates
                                          score
                                          events
                                          to
                                          trigger
                                          61
                                          samples
                                          within
                                          a
                                          csound
                                          orchestra.
                                          This
                                          works
                                          fine
                                          until
                                          now.
                                          My
                                          problem
                                          is
                                          that
                                          the
                                          PWGL
                                          Patch
                                          is
                                          becoming
                                          more
                                          complex
                                          and
                                          it
                                          takes
                                          quite
                                          a
                                          long
                                          time
                                          to
                                          generate
                                          the
                                          csound
                                          score.
                                          One
                                          solution
                                          would
                                          be
                                          to
                                          move
                                          some
                                          tasks
                                          from
                                          PWGL
                                          to
                                          Csound
                                          which
                                          should
                                          be
                                          more
                                          much
                                          faster.
                                          This
                                          is
                                          where
                                          I
                                          would
                                          like
                                          to
                                          ask
                                          your
                                          opinion.
                                          How
                                          would
                                          you
                                          do
                                          the
                                          following:
                                          Csound
                                          receives
                                          a
                                          midi
                                          note
                                          number
                                          and
                                          has
                                          to
                                          decide
                                          according
                                          to
                                          the
                                          available
                                          samples
                                          which
                                          one
                                          to
                                          choose
                                          and
                                          which
                                          transposition
                                          should
                                          be
                                          applied.
                                          Something
                                          like
                                          this:

                                          Samples
                                          available
                                          (60
                                          63
                                          66
                                          69)
                                          Input
                                          Midi
                                          note:
                                          61
                                          Output:
                                          sample
                                          60
                                          transposition
                                          2^1/12

                                          I
                                          thought
                                          about
                                          using
                                          tables
                                          but
                                          also
                                          about
                                          arrays
                                          -
                                          I'm
                                          not
                                          yet
                                          familiar
                                          with
                                          arrays.

                                          Thanks.

                                          Luís

                                          --
                                          signatur
                                          http://luisantunespena.eu



                                    Send
                                    bugs
                                    reports
                                    to the
                                    Sourceforge
                                    bug
                                    trackers
                                    csound6:
                                    https://sourceforge.net/p/csound/tickets/
                                    csound5:
                                    https://sourceforge.net/p/csound/bugs/
                                    Discussions
                                    of
                                    bugs
                                    and
                                    features
                                    can be
                                    posted
                                    here
                                    To
                                    unsubscribe,
                                    send
                                    email
                                    sympa@lists.bath.ac.uk
                                    with
                                    body
                                    "unsubscribe
                                    csound"



                              Send bugs reports
                              to the Sourceforge
                              bug trackers
                              csound6:
                              https://sourceforge.net/p/csound/tickets/
                              csound5:
                              https://sourceforge.net/p/csound/bugs/
                              Discussions of
                              bugs and features
                              can be posted here
                              To unsubscribe,
                              send email
                              sympa@lists.bath.ac.uk
                              with body
                              "unsubscribe
                              csound"




                        Send bugs reports to the
                        Sourceforge bug trackers
                        csound6:
                        https://sourceforge.net/p/csound/tickets/
                        csound5:
                        https://sourceforge.net/p/csound/bugs/
                        Discussions of bugs and
                        features can be posted here
                        To unsubscribe, send email
                        sympa@lists.bath.ac.uk with
                        body
                        "unsubscribe csound"





                  --
                  signatur luis antunes pena
                  Severinswall 54
                  D-50678 Köln

                  http://luisantunespena.eu

                  +49 (0)221 29020757
                  +49 (0)176 968 09 867 (mobile)



            Send bugs reports to the Sourceforge bug trackers
            csound6:
                        https://sourceforge.net/p/csound/tickets/
            csound5:
                        https://sourceforge.net/p/csound/bugs/
            Discussions of bugs and features can be posted here
            To unsubscribe, send email sympa@lists.bath.ac.uk with
            body "unsubscribe
            csound"





      Send bugs reports to the Sourceforge bug trackers
      csound6:
                 https://sourceforge.net/p/csound/tickets/
      csound5:
                 https://sourceforge.net/p/csound/bugs/
      Discussions of bugs and features can be posted here
      To unsubscribe, send email sympa@lists.bath.ac.uk with body
      "unsubscribe csound"





--

http://luisantunespena.eu


Send bugs reports to the Sourceforge bug trackers
csound6:
           https://sourceforge.net/p/csound/tickets/
csound5:
           https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"




--
signatur http://luisantunespena.eu

Date2014-02-09 16:06
FromLuis Antunes Pena
SubjectRe: [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 -

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 <jh@joachimheintz.de> schrieb:

hi luis -

this should be very easy to do. the midi note triggers an instrument
instance, and this instance selects the sample, and applies any
other
transformations. something like:

strset 60, "sample1.wav"
strset 61, "sample2.wav"
...

massign 0, "Play"

instr Play
iSample notnum
iTransp = 100 ;cent
aPlay diskin iSample, cent(iTransp)
out aPlay
endin

this is not tested, but you will know what i mean. not sure,
though, in
your example, how you get the sample and the transposition.

hoe this helps, best -

    joachim


Am 04.02.2014 00:08, schrieb Luis Antunes Pena:
Hello,

I'm building a patch in PWGL/Lisp that generates score events to
trigger 61
samples within a csound orchestra. This works fine until now. My
problem
is that the PWGL Patch is becoming more complex and it takes
quite a
long time to generate the csound score. One solution would be to
move
some tasks from PWGL to Csound which should be more much faster.
This is
where I would like to ask your opinion. How would you do the
following:
Csound receives a midi note number and has to decide according
to the
available samples which one to choose and which transposition
should be
applied. Something like this:

Samples available (60 63 66 69)
Input Midi note: 61
Output: sample 60 transposition 2^1/12

I thought about using tables but also about arrays - I'm not yet
familiar with arrays.

Thanks.

Luís

--
signatur http://luisantunespena.eu



Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"



Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"




Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"





--
signatur luis antunes pena
Severinswall 54
D-50678 Köln

http://luisantunespena.eu

+49 (0)221 29020757
+49 (0)176 968 09 867 (mobile)


Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
csound"





Send bugs reports to the Sourceforge bug trackers
csound6:
https://sourceforge.net/p/csound/tickets/
csound5:
https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body
"unsubscribe csound"





--
signatur
http://luisantunespena.eu


Send bugs reports to the Sourceforge bug trackers
csound6:
           https://sourceforge.net/p/csound/tickets/
csound5:
           https://sourceforge.net/p/csound/bugs/
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"





--
signatur http://luisantunespena.eu