[Csnd] output amplitude?

Hi,
I've been tinkering with CSound for study of hamony and tuning. One of the problems I am having is that the volume of sound output appears uneven. For example check this page: the diatonic ladder in E in Pythagorean tuning playing pure sines. I specify the frequencies as fractions w.r.t. a base frequency (i.c. 440 Hz). To me the higher frequency tones appear fainter than lower frequency tones, and the note with base frequency appears louder than all. But for the amplitude I used the same iAmp=0.25 for all notes.
Any problem with my code?
Thanx.

http://arpeters.net/Nederlandse_paginas/Muziekleer/PytEAE.htm

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

It looks like you are specifying 1.2 seconds for the madsr envelope (adding the segment values together), but the score only allows 1 second for each note, so this may have something to do with it.

BTW, I use pure tunings all the time (often using sines – in fact I have a CD-length piece that uses nothing but since waves with pure tunings[1]) and have not noticed any variation in amplitude based on pitch. However, I use a higher-quality oscillator opcode (poscil3) which I would recommend for this sort of application, and perhaps this is a factor as well, though it seems less likely to me than the envelope.

I note that I haven’t used masdr myself; for my purposes a simple AR envelope (e.g., using linen) is generally sufficient), but of course it depends on context which is the better choice.

  • Dave

[1] http://recordings.irritablehedgehog.com/album/dave-seidel-60-hz

Oops: “since waves” shou;d be “sine waves”.

I think that madsr is not a problem. If you look at the rendered output file:

https://drive.google.com/file/d/1L33t9fYrwRjpp12WvwplpGhcf0MSnUuj/view?usp=sharing

you can see that all the notes are exactly the same amplitude. Any subjective change in loudness is because of psychoacoustic factors. There’s no problem with the code.

I also enjoy tinkering with Csound for study of harmony and tuning.

Bill

Hi,
I've been tinkering with CSound for study of hamony and tuning. One of the problems I am having is that the volume of sound output appears uneven. For example check this page: the diatonic ladder in E in Pythagorean tuning playing pure sines. I specify the frequencies as fractions w.r.t. a base frequency (i.c. 440 Hz). To me the higher frequency tones appear fainter than lower frequency tones, and the note with base frequency appears louder than all. But for the amplitude I used the same iAmp=0.25 for all notes.
Any problem with my code?
Thanx.

Pythagorean scale with CSound and Ogg

Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE Send bugs reports to Issues · csound/csound · GitHub Discussions of bugs and features can be posted here

Bill Alves
Professor of Music, The Claremont Colleges
Harvey Mudd College
301 Platt Blvd. Claremont CA 91711
http://pages.hmc.edu/alves/
http://www.billalves.com/

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Thanks, Bill, I should have considered that aspect!

Just a suggestion. Try modifying the amplitude with a sone table. That is supposed to account for psycho effects

Get TypeApp for Android

Bill,
thank you for making the diagram. What do you use to convert a .ogg file to a graph?
All my notes are programmed to play for 1 second, but from the graph I see that they are not neatly separated but blend one into the other, showing beat frequencies. Only the last note tapers off as I intended. So Dave Seidel may be right that somehow the envelope stretches each note to 1.2 seconds.
Any idea what might be going on, or how the madsr should be used?

Bill,
thank you for making the diagram. What do you use to convert a .ogg file
to a graph?

I guess that depends on your OS. I used a utility on the Haiku OS I run,
and can verify Bill's statements. I can also verify that there is a considerable
subjective variation in the amplitudes of the sequence when listening!
I'm not sure if it's resonance in my audio or what, but the first of your
sounds seems much louder than the others. To check that this wasn't
a "first one" effect, I added in the [64/81] sound at the start (which is much
softer to me), and the "440 [3/2]" tone is still the (subjective) loudest.

OK, I just used headphones from my laptop audio, and the effect is the same.
Guess it's my ears! If I just use the laptop's own (tinny!) speakers, the effect
is very pronounced. Can hardly hear the later notes.

All my notes are programmed to play for 1 second, but from the graph I
see that they are not neatly separated but blend one into the other,
showing beat frequencies. Only the last note tapers off as I intended.
So Dave Seidel may be right that somehow the envelope stretches each
note to 1.2 seconds.

Yes, as I understand it, that's how madsr works. The release time is *added on*
to the p3 of the note. The madsr page is not very clear, but it says it uses 'linsegr'
and that page says:
"When [it] senses an event termination or MIDI noteoff, it immediately extends
the performance time of the current instrument by irel seconds, and sets out to
reach the value iz by the end of that period (no matter which segment the unit is in"

Any idea what might be going on, or how the madsr should be used?

I just changed all notes in the score except the first to:
      i 1 ^+1.5 . 440 [4/3]
etc.
(I.e. replaced "+" with "^+1.5", so the notes are 1.5 secs apart, but still
only 1 second long.) No beat frequencies now, but the effect is still there.

  -- Pete --

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Dear Tom,

I just looked at the audio file within an audio editor. I use Amadeus but one can also use Audacity or any number of others. By the way, one can choose the format of the output file, and it does not have to be in ogg format, in case your audio editor will not open ogg files.

As Pete mentioned, madsr adds the release segment onto the end of the specified note duration (p3). This is so that, when used with MIDI, the release segment is added on after the note-off message. The opcode adsr may act like you expect.

Because the notes are only a step apart, you will see and hear beat frequencies when they overlap.

Bill

Bill,
thank you for making the diagram. What do you use to convert a .ogg file to a graph?
All my notes are programmed to play for 1 second, but from the graph I see that they are not neatly separated but blend one into the other, showing beat frequencies. Only the last note tapers off as I intended. So Dave Seidel may be right that somehow the envelope stretches each note to 1.2 seconds.
Any idea what might be going on, or how the madsr should be used?
--
Tom Peters

I think that madsr is not a problem. If you look at the rendered output file:
https://drive.google.com/file/d/1L33t9fYrwRjpp12WvwplpGhcf0MSnUuj/view?usp=sharing
you can see that all the notes are exactly the same amplitude. Any subjective change in loudness is because of psychoacoustic factors. There’s no problem with the code.
I also enjoy tinkering with Csound for study of harmony and tuning.
Bill

Hi,
I've been tinkering with CSound for study of hamony and tuning. One of the problems I am having is that the volume of sound output appears uneven. For example check this page: the diatonic ladder in E in Pythagorean tuning playing pure sines. I specify the frequencies as fractions w.r.t. a base frequency (i.c. 440 Hz). To me the higher frequency tones appear fainter than lower frequency tones, and the note with base frequency appears louder than all. But for the amplitude I used the same iAmp=0.25 for all notes.
Any problem with my code?
Thanx.

Pythagorean scale with CSound and Ogg

Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE Send bugs reports to Issues · csound/csound · GitHub Discussions of bugs and features can be posted here

Bill Alves
Professor of Music, The Claremont Colleges
Harvey Mudd College
301 Platt Blvd. Claremont CA 91711
Bill Alves
http://www.billalves.com/
Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
LISTSERV 16.5 - CSOUND List at LISTSERV.HEANET.IE
Send bugs reports to
      Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

Bill Alves
Professor of Music, The Claremont Colleges
Harvey Mudd College
301 Platt Blvd. Claremont CA 91711
http://pages.hmc.edu/alves/
http://www.billalves.com/

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

madsr was designed for use with midi. You might find adsr more like what you want.

Get TypeApp for Android

Bill, John,
thanx for the tips.
For those interested, you may find the final (for now) version for the Pythagorean scale here:
http://arpeters.net/Nederlandse_paginas/Muziekleer/PytEAE.htm