Csound Csound-dev Csound-tekno Search About

[Csnd] hardsync, bandlimited waveform needed

Date2026-04-09 14:46
FromStefan Thomas
Subject[Csnd] hardsync, bandlimited waveform needed
Hi all,
I wrote the csound patch below, which sounds nice in my ears. However, aliasing occurs at higher frequencies. So I need a band-limited version of gitriangle. How can I do that?
<CsoundSynthesizer>
<CsOptions>
 -odac -Ma -m0d
</CsOptions>
; ==============================================
<CsInstruments>

sr = 44100
ksmps = 10
nchnls = 2
0dbfs = 1
gisine   ftgen 0,0,2^13, 10, 1
ginvcos ftgen 0,0,16385,9,1,1,270
gitriangle ftgen 0,0,4097,7,0,2048,1.0,2049,0
instr 1
  icps mtof p4
iamp = ampdb(p5)
 
idur = 7
initReson = 5
itable = gisine; ginvcos
ismoothtable = gitriangle
anosync init 0


kslavecps expseg icps*initReson,idur,icps*1.4
amaster, async syncphasor icps, anosync
aslave, async2 syncphasor kslavecps, async
aosc tablei aslave, itable, 1
asmooth tablei amaster, ismoothtable, 1
asig = aosc*asmooth
iein = 0.01
irel = 0.3
aenv transegr 0,iein,(0),1,idur*0.1,(-10),0.7,idur*0.9,(-5),0,irel,(-7),0

aout = iamp*aenv*asig
outs aout, aout
endin

</CsInstruments>
; ==============================================
<CsScore>
i1 0 5 60 -6

</CsScore>
</CsoundSynthesizer>



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

Date2026-04-09 14:52
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] [EXTERNAL] [Csnd] hardsync, bandlimited waveform needed
A bandlimited triangle is a sum of odd cosine wave harmonics with 1/n^2 amplitudes. GEN19 should do this.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 9 Apr 2026, at 14:47, Stefan Thomas <kontrapunktstefan@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hi all,
I wrote the csound patch below, which sounds nice in my ears. However, aliasing occurs at higher frequencies. So I need a band-limited version of gitriangle. How can I do that?
<CsoundSynthesizer>
<CsOptions>
 -odac -Ma -m0d
</CsOptions>
; ==============================================
<CsInstruments>

sr = 44100
ksmps = 10
nchnls = 2
0dbfs = 1
gisine   ftgen 0,0,2^13, 10, 1
ginvcos ftgen 0,0,16385,9,1,1,270
gitriangle ftgen 0,0,4097,7,0,2048,1.0,2049,0
instr 1
  icps mtof p4
iamp = ampdb(p5)
 
idur = 7
initReson = 5
itable = gisine; ginvcos
ismoothtable = gitriangle
anosync init 0


kslavecps expseg icps*initReson,idur,icps*1.4
amaster, async syncphasor icps, anosync
aslave, async2 syncphasor kslavecps, async
aosc tablei aslave, itable, 1
asmooth tablei amaster, ismoothtable, 1
asig = aosc*asmooth
iein = 0.01
irel = 0.3
aenv transegr 0,iein,(0),1,idur*0.1,(-10),0.7,idur*0.9,(-5),0,irel,(-7),0

aout = iamp*aenv*asig
outs aout, aout
endin

</CsInstruments>
; ==============================================
<CsScore>
i1 0 5 60 -6

</CsScore>
</CsoundSynthesizer>



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

The information contained in this email may be confidential and privileged. It is intended only for the addressee(s) stated above. If you are not an addressee any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify us by email at dataprotection@mu.ie and delete this email from your system.

Please note that Maynooth University is subject to Freedom of Information and Data Protection laws. We may be required to disclose the content of emails under the FOI Act 2014, the Data Protection Act 2018 or GDPR.

Is don seolaí / do na seolaithe thuasluaite amháin an ríomhphost seo. D’fhéadfadh an t-eolas atá ann a bheith rúnda agus faoi phribhléid. Mura seolaí tú, tá cosc iomlán ar aon eolas atá sa ríomhphost seo a úsáid, a scaipeadh, a dháileadh, a fhoilsiú nó a chóipeáil. Má fuair tú an ríomhphost seo trí thimpiste, cuir sin in iúl dúinn láithreach trí ríomhphost a chur chuig  dataprotection@mu.ie  agus scrios an ríomhphost seo ó do chóras.

Tabhair faoi deara go bhfuil Ollscoil Mhá Nuad faoi réir dhlíthe um Shaoráil Faisnéise agus um Chosaint Sonraí. D’fhéadfadh ceangal a bheith orainn ábhar ríomhphoist a nochtadh faoin Acht um Shaoráil Faisnéise 2014, faoin Acht um Chosaint Sonraí 2018 nó faoi GDPR.

Registered charity number 20037130

 


Date2026-04-09 14:53
From"Jeanette C." <000015cdd0ffa6cd-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] hardsync, bandlimited waveform needed
Hi Stefan,
vco2ft should help. It generates a bunch of bandlimited waveforms, also pitch 
dependent. You can create or should create a wavetable, different versions of 
the triangle waves for different pitches. I think the dem in the manual shows 
that process.

A completely different option, which might defeat your point completely, is 
using squinewave which has built-in hardsync.

Best wishes,

Jeanette

--
  * PeerTube: https://makertube.net/@jeanette_c
  * GitHub: https://github.com/jeanette-c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g

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

Date2026-04-11 20:07
FromStefan Thomas
SubjectRe: [Csnd] [EXTERNAL] [Csnd] hardsync, bandlimited waveform needed
Hello everyone,
thanks for Your useful hints. I will try them all.
Stefan

Am Do., 9. Apr. 2026 um 15:53 Uhr schrieb Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie>:
A bandlimited triangle is a sum of odd cosine wave harmonics with 1/n^2 amplitudes. GEN19 should do this.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 9 Apr 2026, at 14:47, Stefan Thomas <kontrapunktstefan@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hi all,
I wrote the csound patch below, which sounds nice in my ears. However, aliasing occurs at higher frequencies. So I need a band-limited version of gitriangle. How can I do that?
<CsoundSynthesizer>
<CsOptions>
 -odac -Ma -m0d
</CsOptions>
; ==============================================
<CsInstruments>

sr = 44100
ksmps = 10
nchnls = 2
0dbfs = 1
gisine   ftgen 0,0,2^13, 10, 1
ginvcos ftgen 0,0,16385,9,1,1,270
gitriangle ftgen 0,0,4097,7,0,2048,1.0,2049,0
instr 1
  icps mtof p4
iamp = ampdb(p5)
 
idur = 7
initReson = 5
itable = gisine; ginvcos
ismoothtable = gitriangle
anosync init 0


kslavecps expseg icps*initReson,idur,icps*1.4
amaster, async syncphasor icps, anosync
aslave, async2 syncphasor kslavecps, async
aosc tablei aslave, itable, 1
asmooth tablei amaster, ismoothtable, 1
asig = aosc*asmooth
iein = 0.01
irel = 0.3
aenv transegr 0,iein,(0),1,idur*0.1,(-10),0.7,idur*0.9,(-5),0,irel,(-7),0

aout = iamp*aenv*asig
outs aout, aout
endin

</CsInstruments>
; ==============================================
<CsScore>
i1 0 5 60 -6

</CsScore>
</CsoundSynthesizer>



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

The information contained in this email may be confidential and privileged. It is intended only for the addressee(s) stated above. If you are not an addressee any use, dissemination, distribution, publication or copying of the information contained in this email is strictly prohibited. If you have received this email in error, please immediately notify us by email at dataprotection@mu.ie and delete this email from your system.

Please note that Maynooth University is subject to Freedom of Information and Data Protection laws. We may be required to disclose the content of emails under the FOI Act 2014, the Data Protection Act 2018 or GDPR.

Is don seolaí / do na seolaithe thuasluaite amháin an ríomhphost seo. D’fhéadfadh an t-eolas atá ann a bheith rúnda agus faoi phribhléid. Mura seolaí tú, tá cosc iomlán ar aon eolas atá sa ríomhphost seo a úsáid, a scaipeadh, a dháileadh, a fhoilsiú nó a chóipeáil. Má fuair tú an ríomhphost seo trí thimpiste, cuir sin in iúl dúinn láithreach trí ríomhphost a chur chuig  dataprotection@mu.ie  agus scrios an ríomhphost seo ó do chóras.

Tabhair faoi deara go bhfuil Ollscoil Mhá Nuad faoi réir dhlíthe um Shaoráil Faisnéise agus um Chosaint Sonraí. D’fhéadfadh ceangal a bheith orainn ábhar ríomhphoist a nochtadh faoin Acht um Shaoráil Faisnéise 2014, faoin Acht um Chosaint Sonraí 2018 nó faoi GDPR.

Registered charity number 20037130

 

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