Quantcast

[Csnd] Example 6.2 of csound book

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Example 6.2 of csound book

Andreas Bergsland-2
Hi,

I have some questions to instr 1 of example 6.2.orc in the new Csound-book:

1. What does negative table size in ftgen do (I can't find anything
about this in the manual)?

2. The table pointer is incremented by ksmps, but how can tablew write
to all the indices in between N*ksmps when you just use a(kpos) for index?

Best, Andreas

Example

idur = 5
isamps = round(idur*sr/ksmps)*ksmps
gifn ftgen 0,0,-isamps,2,0

instr 1
  kpos init 0
  asig inch 1
  tablew asig,a(kpos),gifn
  kpos += ksmps
  kpos = kpos == ftlen(gifn) ? 0 : kpos
endin
schedule(1,0,-1)


--
Andreas Bergsland

Associate professor - førsteamanuensis
Music Technology Programme - Musikkteknologiseksjonen
Department of Music - Institutt for musikk
Olavskvartalet
NTNU (Norwegian University of Science and Technology)
7491 Trondheim
NORWAY

Visiting address/besøksadresse: Fjordgt.1 (3.etg.)
e-mail: [hidden email]
Web: http://folk.ntnu.no/andbe
Office phone: 7359 0096
Mobile:       4566 3316


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

andreas_bergsland.vcf (344 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Example 6.2 of csound book

Victor Lazzarini
Negative sizes were used to stop Csound checking for power-of-two. Now it is not needed anymore.
The a(.) interpolates linearly between two consecutive k-values.

========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952

> On 9 May 2017, at 14:07, Andreas Bergsland <[hidden email]> wrote:
>
> Hi,
>
> I have some questions to instr 1 of example 6.2.orc in the new Csound-book:
>
> 1. What does negative table size in ftgen do (I can't find anything about this in the manual)?
>
> 2. The table pointer is incremented by ksmps, but how can tablew write to all the indices in between N*ksmps when you just use a(kpos) for index?
>
> Best, Andreas
>
> Example
>
> idur = 5
> isamps = round(idur*sr/ksmps)*ksmps
> gifn ftgen 0,0,-isamps,2,0
>
> instr 1
> kpos init 0
> asig inch 1
> tablew asig,a(kpos),gifn
> kpos += ksmps
> kpos = kpos == ftlen(gifn) ? 0 : kpos
> endin
> schedule(1,0,-1)
>
>
> --
> Andreas Bergsland
>
> Associate professor - førsteamanuensis
> Music Technology Programme - Musikkteknologiseksjonen
> Department of Music - Institutt for musikk
> Olavskvartalet
> NTNU (Norwegian University of Science and Technology)
> 7491 Trondheim
> NORWAY
>
> Visiting address/besøksadresse: Fjordgt.1 (3.etg.)
> e-mail: [hidden email]
> Web: http://folk.ntnu.no/andbe
> Office phone: 7359 0096
> Mobile:       4566 3316
>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
> <andreas_bergsland.vcf>


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Example 6.2 of csound book

Andreas Bergsland-2
Thanks! Good to know.
Andreas

> Negative sizes were used to stop Csound checking for power-of-two. Now it is not needed anymore.
> The a(.) interpolates linearly between two consecutive k-values.
>
> ========================
> Prof. Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 9 May 2017, at 14:07, Andreas Bergsland <[hidden email]> wrote:
>>
>> Hi,
>>
>> I have some questions to instr 1 of example 6.2.orc in the new Csound-book:
>>
>> 1. What does negative table size in ftgen do (I can't find anything about this in the manual)?
>>
>> 2. The table pointer is incremented by ksmps, but how can tablew write to all the indices in between N*ksmps when you just use a(kpos) for index?
>>
>> Best, Andreas
>>
>> Example
>>
>> idur = 5
>> isamps = round(idur*sr/ksmps)*ksmps
>> gifn ftgen 0,0,-isamps,2,0
>>
>> instr 1
>> kpos init 0
>> asig inch 1
>> tablew asig,a(kpos),gifn
>> kpos += ksmps
>> kpos = kpos == ftlen(gifn) ? 0 : kpos
>> endin
>> schedule(1,0,-1)
>>
>>
>> --
>> Andreas Bergsland
>>
>> Associate professor - førsteamanuensis
>> Music Technology Programme - Musikkteknologiseksjonen
>> Department of Music - Institutt for musikk
>> Olavskvartalet
>> NTNU (Norwegian University of Science and Technology)
>> 7491 Trondheim
>> NORWAY
>>
>> Visiting address/besøksadresse: Fjordgt.1 (3.etg.)
>> e-mail: [hidden email]
>> Web: http://folk.ntnu.no/andbe
>> Office phone: 7359 0096
>> Mobile:       4566 3316
>>
>>
>> Csound mailing list
>> [hidden email]
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>        https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
>> <andreas_bergsland.vcf>
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

--
Andreas Bergsland

Associate professor - førsteamanuensis
Music Technology Programme - Musikkteknologiseksjonen
Department of Music - Institutt for musikk
Olavskvartalet
NTNU (Norwegian University of Science and Technology)
7491 Trondheim
NORWAY

Visiting address/besøksadresse: Fjordgt.1 (3.etg.)
e-mail: [hidden email]
Web: http://folk.ntnu.no/andbe
Office phone: 7359 0096
Mobile:       4566 3316


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

andreas_bergsland.vcf (344 bytes) Download Attachment
Loading...