Closed mouseos closed 1 year ago
Hoping @josmithiii can help here
Interesting - Those are really high frequencies! What sampling rate are you running?
This little test shows that rdtable
does not start at time 0, but one sample later:
`
N = 14;
ft = ma.SR / N;
show_sine = os.oscsin(ft);
process = show_sine; `
I used faust2plot -double test.dsp && test
to print the first 15 samples, but GitHub code-quoting is broken when I try to paste the result of that here. Come to think of it, maybe that's because I'm on a Mac and do not have ^M after every line. It's easier to run it yourself if you want to see it.
I thought that this had been fixed already: the phasor doesn't start at zero.
What I usually do when I need it to do so is to force the incremental step to be zero at time n = 0:
import("stdfaust.lib"); N = 14; ft = ma.SR / N; show_sine = os.oscsin(ft); oscsin2(freq) = rdtable(tablesize, os.sinwaveform(tablesize), int(os.phasor( tablesize, freq * 1'))) with { tablesize = pl.tablesize; }; correctSine = oscsin2(ft); process = show_sine , correctSine;
Ciao, Dr Dario Sanfilippo http://dariosanfilippo.com
On Sun, 12 Mar 2023 at 10:59, Julius Smith @.***> wrote:
This little test shows that rdtable does not start at time 0, but one sample later: ` N = 14; ft = ma.SR / N; show_sine = os.oscsin(ft);
process = show_sine; `
— Reply to this email directly, view it on GitHub https://github.com/grame-cncm/faust/issues/865#issuecomment-1465145122, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHG3I2BPQL2YGNPU7UKUERTW3WM7DANCNFSM6AAAAAAVX5Z7KQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
@dariosanfilippo I remember yes (finding old mails of november 2021). We indeed still have the problem and it happens for several oscillators in the library (the ones build on top of an internal phasor_imp
). I'll have a look ASAP.
@mouseos: for the future, better report Faust libraries issues on the relevant project.
Should be fixed in https://github.com/grame-cncm/faustlibraries/commit/9b41b22cbcf42b0717c51a95853d485ca8408f0a where I corrected the internal phasor_imp
.
@mouseos can you check that it also fixes your issue?
Thank you for making the correction and we apologize for the incorrect location of the issue.
We will check later to see if it has been corrected.
Interesting - Those are really high frequencies! What sampling rate are you running?
192KHz
Various oscillators, such as os.osc, are slightly out of phase. I am building a fm mpx encoder. I have a part of it that does amplitude modulation with a 38KHz signal, but the phase of that part is slightly out of phase, so if I let it sit for a few minutes, it will generate an incorrect signal.
Code mpx(L,R)=(L+R)+((L-R)os.oscsin(38000))+(os.oscsin(19000)0.1);
I wrote an oscillator that resets every second as follows: freq=38000; os.hs_oscsin(freq,ba.pulse(ba.sec2samp(1)))); This works fine without any phase shift, but I cannot set any frequency other than integer.