Csound Csound-dev Csound-tekno Search About

[Csnd] noisy sines

Date2021-08-31 10:44
FromTom Peters
Subject[Csnd] noisy sines
Hi,
I am studying tuning and harmony, and have been using CSound to generate 
examples. I thought it best (and easiest) to use pure sine waves to 
better hear differences in tuning. My sound card and monitor speaker 
appear to have trouble with sounding that, but the result has been just 
bearable if ugly, and I haven't blown out my speakers yet.
However now I put pages on-line and when playing the .ogg from the 
Internet the result awful: static noise with a melody.

My PC can play anything Youtube throws at it fine.

Any advise on how to make better pure-pitch notes are welcome.

e.g.:
http://arpeters.net/Nederlandse_paginas/Muziekleer/DiatonischeTonen.htm#StemmingPythagoras

The .csd:



-+rtaudio=alsa	; On Linux use ALSA kernel sound driver
;-o dac
;-o PytEAE.wav --format=wav ; for file output in WAV format
-o PytEAE.ogg --ogg	; for file output in OGG format



; Orchestra:
; + defaults:
kr = 4410
ksmps = 10
sr = 44100
nchnls = 2	; stereo
0dbfs = 1 	; normalized

instr 1, sine
; play a single note as pure sine wave
iDur=p3-p2	; duration of note
iFreq=p4	; base frequency
iNote=p5	; ratio for note in ladder
iAmp=0.25
; ADSR envelope parameters:
iAtt=0.1
iDec=0.2
iSus=0.7
iRel=0.2	; added to note duration
kEnv adsr iAtt, iDec, iSus, iRel
aSig oscils iAmp, iFreq*iNote, 0, 0
aSig*=kEnv
outs aSig, aSig
endin




; Pythagorean scale, descending, centered on A
i 1   0    1 440 [3/2]
i 1 ^+1.0 .  .   [4/3]
i 1 ^+1.0 .  .   [32/27]
i 1 ^+1.0 .  .   [9/8]
i 1 ^+1.0 .  .   [1/1]
i 1 ^+1.0 .  .   [8/9]
i 1 ^+1.0 .  .   [64/81]
i 1 ^+1.0 .  .   [3/4]




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

Date2021-08-31 11:33
From"Jeanette C."
SubjectRe: [Csnd] noisy sines
Aug 31 2021, Tom Peters has written:
...
> -o PytEAE.ogg --ogg	; for file output in OGG format
Have you tried .wav or any other uncompressed output? I don't know which
quality options are used or if they can be controlled.
...

> aSig oscils iAmp, iFreq*iNote, 0, 0
Did you try oscil:
aSig oscil iAmp, iFreq*iNote, -1
(with an ftable number of -1 this oscillator uses an internal sine
wave.)
...

I can't think of anything else. I am just synthesizing a few things and
use sinewaves regularly, with the expected result of clean, pure tones.

HTH.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

I'm reaching out to you
To find that you're not there <3
(Britney Spears)

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

Date2021-08-31 11:49
FromTarmo Johannes
SubjectRe: [Csnd] noisy sines
Hi

Sounds correct to me when here (Csound 6.16.2, openSuse Linux) when I play it live, also saving into wav. or ogg

One small thing -  you can get the duration just form p3:
iDur=p3


greetings,
tarmo

Kontakt Jeanette C. (<julien@mail.upb.de>) kirjutas kuupäeval T, 31. august 2021 kell 13:33:
Aug 31 2021, Tom Peters has written:
...
> -o PytEAE.ogg --ogg   ; for file output in OGG format
Have you tried .wav or any other uncompressed output? I don't know which
quality options are used or if they can be controlled.
...

> aSig oscils iAmp, iFreq*iNote, 0, 0
Did you try oscil:
aSig oscil iAmp, iFreq*iNote, -1
(with an ftable number of -1 this oscillator uses an internal sine
wave.)
...

I can't think of anything else. I am just synthesizing a few things and
use sinewaves regularly, with the expected result of clean, pure tones.

HTH.

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

I'm reaching out to you
To find that you're not there <3
(Britney Spears)

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