Producing exact ratios

Multi-platform modular music creation studio
Post Reply
Posts: 3
Joined: Tue Jun 09, 2015 12:24 pm

Producing exact ratios

Post by Дож » Fri Jun 14, 2019 1:54 pm

Hi! I am reading "Harmonic Experience: Tonal Harmony from Its Natural Origins to Its Modern Expression" and I want to listen to intervals of whole ratios (3:2, 4:3, 5:4, 9:8, 10:9 etc) to investigate if I can hear resonances and recognize differences. So I need to produce exact ratios and I am searching for a way to do it with SunVox, but all my ideas have huge disadvantages in practice. Here the ideas:

1. I know that with "SP" event I can specify a pitch quite precisely, but computation a ratio parameter for some known tonic is hardly easy there. Thats because they are in logarithmic scale, so multiplying by some ratio (3:2 for example) is not a straightforward task. In addition, parameters are needed to be converted from/to hexdecimal base and they are inverted for some reason. Even if I make all the maths, I not gonna get exact ratio, but approximation (~1/256 of semitone accuracy seems good enough though).

2. The SpectraVoice module seems reasonable because it allows to specify exact frequency. Look at the setup on the following picture:
2019-06-14_10-56-01.png (13.41 KiB) Viewed 1119 times

I set frequency of the "1:1" module ("tonic") to 1000 Hz, "3:2" to 1500 Hz, "5:4" to 1250 Hz. Seems good but sounds bad. I think the reason is the way how the SpectraVoice module is implemented: it produces pulsating vibrato-like sound, and even worse the pulsations of separate modules are out of sync, interfere with each other and harm my harmonic experience. You can even see the pulsations on the spectrogram (here is 1000, 1500 and 1250 Hz sinwaves harmonics started simultaneosly with only one event. Do you see the holes and how they are out of sync?):
2019-06-14_11-15-25.png (7.12 KiB) Viewed 1119 times

Tweaking red parameters (attack, sustain, polyphony etc) does not seem to help, "spectrum resolution" somehow changes phase of the pulses, but it does not solve the problem too, and even if I use several harmonics of one module instead of several modules that does not change anything.

Is there a way to get rid of these pulses? Can it be considered as a bug (pulsations when mode=mono)?

3. Another option is to use Pitch Shifter, but it is not much better than using the SP event, because the "Pitch Scale" argument is limited to [-200,200] interval.

4. Last option is to generate correct samples with another software. It is not "SunVox way" at all :)

Maybe I miss something and there is another way? Maybe some Sound2Ctl/Velocity2Ctl magic? I'd like to use SpectraVoice, but it seems "SP" event is only real option for now. Does somebody have formula or program to convert between XXYY and actual frequency?


User avatar
Site Admin
Posts: 3295
Joined: Fri Jan 23, 2004 12:28 am
Location: Ekaterinburg. Russia

Re: Producing exact ratios

Post by NightRadio » Fri Jun 14, 2019 3:09 pm

1. Does somebody have formula or program to convert between XXYY and actual frequency?
From Pitch XXYY to Frequency: frequency (in Hz) = pow( 2, ( 30720 - XXYY ) / 3072 ) * 16.3339;
From Frequency to Pitch XXYY: XXYY = 30720 - log2( frequency / 16.3339 ) * 3072;

2. SpectraVoice produces pulsating vibrato-like sound
Bandwidth=0 is not real zero in SpectraVoice. It's little wider than pure sine. Two or three sines maybe. This is why you hear some pulsation.
This may be changed in the new versions.

Also if you need the sines only - try to use the LFO module with the following parameters:
freq = your frequency;
waveform = sin or sin2;
frequency unit = Hz;
generator = 1 (on).
And don't forget to put DC Blocker between the LFO and the Output.

Posts: 3
Joined: Tue Jun 09, 2015 12:24 pm

Re: Producing exact ratios

Post by Дож » Wed Jun 19, 2019 4:53 pm

Thanks for the answer! I gonna try both SP and LFO :)

Post Reply