Csound Csound-dev Csound-tekno Search About

Example 6.2 of csound book

Date2017-05-09 14:07
FromAndreas Bergsland
SubjectExample 6.2 of csound book
Attachmentsandreas_bergsland.vcf  
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: andreas.bergsland@ntnu.no
Web: http://folk.ntnu.no/andbe
Office phone: 7359 0096
Mobile:       4566 3316


Csound mailing list
Csound@listserv.heanet.ie
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

Date2017-05-09 14:33
FromVictor Lazzarini
SubjectRe: Example 6.2 of csound book
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  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: andreas.bergsland@ntnu.no
> Web: http://folk.ntnu.no/andbe
> Office phone: 7359 0096
> Mobile:       4566 3316
> 
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> 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
> 


Csound mailing list
Csound@listserv.heanet.ie
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

Date2017-05-09 22:37
FromAndreas Bergsland
SubjectRe: Example 6.2 of csound book
Attachmentsandreas_bergsland.vcf  
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  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: andreas.bergsland@ntnu.no
>> Web: http://folk.ntnu.no/andbe
>> Office phone: 7359 0096
>> Mobile:       4566 3316
>>
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> 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
>> 
>
> Csound mailing list
> Csound@listserv.heanet.ie
> 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: andreas.bergsland@ntnu.no
Web: http://folk.ntnu.no/andbe
Office phone: 7359 0096
Mobile:       4566 3316


Csound mailing list
Csound@listserv.heanet.ie
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