Csound Csound-dev Csound-tekno Search About

[Csnd] synced phase of VCOs

Date2020-04-08 23:43
FromMikoláš Štrajt
Subject[Csnd] synced phase of VCOs
Hi,
I am finally going to implement String machine.

I have researched this topic previously and I was advised (in this list) to use VCOs with synced phase.

So today I came up with something like this:

;=== source code
<Cabbage>
form caption("Untitled") size(400, 300), colour(58, 110, 182), pluginid("def1")
keyboard bounds(8, 158, 381, 95)
</Cabbage>
<CsoundSynthesizer>
<CsOptions>
-n -d -+rtmidi=NULL -M0 -m0d --midi-key-cps=4 --midi-velocity-amp=5
</CsOptions>
<CsInstruments>
; Initialize the global variables.
ksmps = 32
nchnls = 2
0dbfs = 1

gkPhs init 0

;this instrument will be triggered by keyboard widget
instr 1
kEnv madsr .1, .2, .6, .4
aOut vco2 0.5, p4, 10, 0 , gkPhs
outs aOut*kEnv, aOut*kEnv
endin

; this is source of oscillation for sync
instr 99
    kcps = cpsmidinn(60)
    gkPhs phasor kcps
endin

</CsInstruments>
<CsScore>
;causes Csound to run for about 7000 years...
f0 z

i99 0 -1
</CsScore>
</CsoundSynthesizer>
;==== end of source code

The key thing is that
aOut vco2 0.5, p4, 10, 0 , gkPhs
which will (hopefully) make this VCO make stay in sync with other VCOs (sharing the same gkPhs).

But I am not sure if I am doing it right, because when I compared it with version where gkPhs is not used results are not so different, both by listening and looking into waveforms in Audacity.

--
Mikoláš Štrajt

Date2020-04-08 23:59
From"Jeanette C."
SubjectRe: [Csnd] synced phase of VCOs
Apr 9 2020, Mikoláš Štrajt has written:
...
> But I am not sure if I am doing it right, because when I compared it with
> version where gkPhs is not used results are not so different, both by
> listening and looking into waveforms in Audacity.
...
I _THINK_ this is most noticeably when you have unison waves (i.e.
oscillators with the same starting phase with slight or no detune,
played at exactly the same time. Especially with slight detune you will
notice the phases drifting. For this example it should most likely be
due to the original desight, where you'd mostly have 12 oscillators
which were divided down to generate all the other tones. So all notes
one octave apart would have had the same phase.

Even from playing a few of those, I am not sure how much of a difference
this part of "modelling" the old electronics makes a difference. I
suspect most of the character is in the exact filtering/EQing and the
ensemble effect that you use.

Take this with a pinch of salt, please.

Best wishes,

Jeanette

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

They say, break away - I'm missing out on the fun and games <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

Date2020-04-09 07:32
FromPete Goodeve
SubjectRe: [Csnd] synced phase of VCOs
AttachmentsNone