Page 2 of 2

Re: Phase input for Razorblade Wave Read?

PostPosted: Sun Aug 27, 2023 9:04 am
by adamszabo
martinvicanek wrote:Here is my 2ct:

I totally agree with Spogg's comments regarding the precise counter. We could safely replace it by a simple counter for the present application.

I also agree with Tepeix' phase code v2. I am attaching my own version with comments (primarily for my own benefit, because otherwise I won't know what the heck all that is about by next week). It is almost identical to Tepeix' code.

So the remaining mystery are those FM spikes and double triggers that k brown is observing. Could we have the schem to see what`s going on?


In the assembly with the int and frac out it says at the end:

movaps j,xmm3;
movaps jfrac,xmm3;

but should be:

movaps j,xmm0;
movaps jfrac,xmm3;

;)

Re: Phase input for Razorblade Wave Read?

PostPosted: Sun Aug 27, 2023 9:53 am
by k brown
Gornish Helfin -

Even with the correction, using that assembler inside, the osc goes nuts! My ears are still ringing :shock:

nuts.jpg
nuts.jpg (46.62 KiB) Viewed 14092 times

Re: Phase input for Razorblade Wave Read?

PostPosted: Sun Aug 27, 2023 11:53 am
by Tepeix
Maybe we just have to multiply the phase to get the wanted result ?
Here with X 0.49999 it have only one peak.

Re: Phase input for Razorblade Wave Read?

PostPosted: Sun Aug 27, 2023 8:23 pm
by k brown
Well, in my own, stumbling, hunch-following, trial-and-error way, I seem to have figured this out.

Just putting this 'Add Phase' code from the iFFT osc between the original Razorblade osc 'Counter' and 'Interpolated Read' modules did the trick. Just needed to give the 'phaseLen' input a float of 168.562 (as in the iFFT), to set the Buffer Size, then the 'phase' input functions as expected.

Add Phase code.jpg
Add Phase code.jpg (44.34 KiB) Viewed 14061 times


A few minor wrinkles remain:
1. One-shots still double-trig (no biggy in a project to bypass the 'AddPhase' module for those waves).
2. The float range is strange to achive squ thru narrow pulse: 1.561 to 0.265.
3. Not sure the HiQ option is working, as the 'Add Phase' doesn't have both 'PosInt' and 'PosFrac' inputs; only 'offest'.

FM with two sines at Ratio 1:00 looks and sounds just as expected:

Propa FM.jpg
Propa FM.jpg (23.87 KiB) Viewed 14061 times


PW/PWM still work just fine, as does Sync!

I might be missing something, but so far everything seems to work fine.

Re: Phase input for Razorblade Wave Read?

PostPosted: Mon Aug 28, 2023 7:52 am
by Spogg
Well, you’ve pretty much duplicated what I did yesterday! :lol:

I’ll share mine because there are a few differences. I “tuned” the float value so it roughly matched Martin’s sine osc in terms of the knob position giving similar results. The value seems to change the range of operation, but I haven’t yet got to grips with the DSP.

But there are differences, which interests me. MyCo’s version produces flat bits in the output waveform when driven at higher modulation deviations, whereas Martin’s sine osc doesn’t; it continues to fold. That means the timbre will be different at higher modulation values. Unless someone quickly beats me to it, I intend to investigate this and try to solve it.

I suspect the double triggering is due to the index wrapping around to zero when the modulation value takes it above the number of samples, so it starts again. But I haven’t checked that yet.

Re: Phase input for Razorblade Wave Read?

PostPosted: Mon Aug 28, 2023 2:13 pm
by Tepeix
All those code are almost the same, but mine had an error i just spot..
(It could go to sample number where it might better go back to zero, which change a very little the transition.)

I think all is in the phaselen parameter of MyCo's, this is a little similar to my phase multiply,
we could reduce the phase change.

Re: Phase input for Razorblade Wave Read?

PostPosted: Mon Aug 28, 2023 3:47 pm
by Spogg
I think I’ve done it!

It behaves the same as Martin’s proper phase modulation on his sine osc (you can compare in the schematic).

MyCo’s version was good but it limited the number of “folds” you could get with phase modulation, which is why there were flat bits in the waveform at high modulation indexes. That was because his phase DSP went past the index limits at higher modulation levels; he only provided for one fold for plus and minus phase values.

The DX7 hardware used unipolar addition for the phase offset and I guess the wrap-around for folding was either done in the adder or the ROM reader. Maybe the adder only supplied the lower bits so the wrap-around would take into account higher modulation levels. The MSBs would be ignored, even though they still operated. Dunno.

My big challenge was to make it bipolar, so any waveform can provide FM without needing an operating point bias.
I also reduced the double precision counter to be fractional and the conversion to int & frac is done after my DSP phase code. The “High Quality” selector now works.

Now I’m waiting for Martin to laugh at my DSP code and show us a better way to achieve the end result. At the very least an optimised ASM version would be useful…

Re: Phase input for Razorblade Wave Read?

PostPosted: Mon Aug 28, 2023 6:08 pm
by k brown
Excellente!

AND the PW range is now normal; 0.5 for a perfect square.

Interestingly, the one-shots now trigger 5 times!; at a rate that tracks the keybaord. Kind of a cool effect actually! I may keep this version as a switchable option.

Already experimenting with these as modulator and carrier in the Synclavier-inspired project mentioned in this thread: viewtopic.php?f=4&t=120810&p=329902&hilit=synclavier#p329902

Very interesting results comparing sine modulated with various SQ waves and vice versa (the Synclavier approach vs the DX one). The band-limited SQ waves are, not surprisingly, more suited to use as carriers, so I'm including a simple filter for the carrier, to handle the brighter waves.