-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sounds are mellow #1
Comments
Just wanting to add some additional observations related to this issue... If you download the app Spectroid on Android (https://play.google.com/store/apps/details?id=org.intoorbit.spectrum) you can see the exact frequencies that this module puts out. I've noticed that the "pure" sine wave often has several harmonics that come through as well. Those harmonics are likely what's making the tone more "mellow". For example, in the attached image, the bright pink bits on the left are the actual frequencies I mixed together, while the faint blips to the right are harmonic frequencies that came through as well. Those harmonics may be the result of this module (I'm still looking through the implementation to see if that seems to be the case), but I'd suspect your computer's sound card has something to do with it as well. I'm under the impression that many such cards do slight modifications to the sounds they are given to play so that they will "sound better". |
Hi,
Sorry for the delayed response,
Your script looks fine. The tones module is just generating the raw digital
samples for those super basic waveforms (sine, sawtooth, triangle, square),
and writing those samples directly into a .wav file.
You can see the code that is generating the digital sample values in
tones/tone.py, specifically the Samples() class.
No idea about the harmonics, sounds like you know more about it than me.
Perhaps there is a bug in tones.py which actually selects square/sawtooth
even though you selected sine?
Thanks,
Erik
…On Tue, Nov 24, 2020 at 2:57 PM Joseph Hale ***@***.***> wrote:
Just wanting to add some additional observations related to this issue...
If you download the app *Spectroid* on Android (
https://play.google.com/store/apps/details?id=org.intoorbit.spectrum) you
can see the exact frequencies that this module puts out. I've noticed that
the "pure" sine wave often has several harmonics that come through as well.
Those harmonics are likely what's making the tone more "mellow". For
example, in the attached image, the bright pink bits on the left are the
actual frequencies I mixed together, while the faint blips to the right are
harmonic frequencies that came through as well.
[image: 1kHz Base - Silent]
<https://user-images.githubusercontent.com/47901316/100160620-30349f00-2e6d-11eb-9e12-7cba2177489e.png>
Those harmonics may be the result of this module (I'm still looking
through the implementation to see if that seems to be the case), but I'd
suspect your computer's sound card has something to do with it as well. I'm
under the impression that many such cards do slight modifications to the
sounds they are given to play so that they will "sound better".
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSPNR35BOGYTNIRQEBO533SRQ23ZANCNFSM4SJC6TBQ>
.
|
@liudr FYI, @jhale1805 has graciously fixed a bug that was causing imperfect sine waves to be generated. He has made a pull request here #4, which we are still working on, but when that pull request is merged then this may fix the original problem you reported for sine waves not sounding quite right. I will release a new version on pip when those changes are all ironed out. |
tones 1.2.0 can be installed with "pip" now, all waveforms should be sounding correct now. |
Hi,
Great python module you made! I'm trying to learn piano cords so I'm just using python and your module to generate the sounds of cords, such as c major cord, by c-e-g in that order and then using 3 channels one for each ceg simultaneously so I can hear the cord. I chose SINE_WAVE but the sound is very mellow, not like the hard sine wave sound. Here is my script. Could you take a look? Thanks.
`from tones import SINE_WAVE, SAWTOOTH_WAVE
from tones.mixer import Mixer
mixer = Mixer(44100, 1)
mixer.create_track(0, SINE_WAVE, attack=0.1, decay=0.1)
mixer.create_track(1, SINE_WAVE, attack=0.1, decay=0.1)
mixer.create_track(2, SINE_WAVE, attack=0.1, decay=0.1)
mixer.add_note(0, note='c', octave=4, duration=1.0)
mixer.add_note(0, note='e', octave=4, duration=1.0)
mixer.add_note(0, note='g', octave=4, duration=1.0)
mixer.add_note(0, note='c', octave=4, duration=3.0)
mixer.add_note(1, note='c', octave=4, duration=1.0)
mixer.add_note(1, note='e', octave=4, duration=1.0)
mixer.add_note(1, note='g', octave=4, duration=1.0)
mixer.add_note(1, note='e', octave=4, duration=3.0)
mixer.add_note(2, note='c', octave=4, duration=1.0)
mixer.add_note(2, note='e', octave=4, duration=1.0)
mixer.add_note(2, note='g', octave=4, duration=1.0)
mixer.add_note(2, note='g', octave=4, duration=3.0)
mixer.write_wav('tones.wav')
samples = mixer.mix()
`
The text was updated successfully, but these errors were encountered: