nesdev.comhttp://forums.nesdev.com/ Doing a supersaw lead on the spc700http://forums.nesdev.com/viewtopic.php?f=12&t=16225 Page 1 of 2

 Author: psycopathicteen [ Tue Jul 18, 2017 2:46 pm ] Post subject: Doing a supersaw lead on the spc700 Sorry my computer logged me out from writing this, so I need to explain this quickly.So I figured out supersaw leads can be done like this. Use a long BRR sample (but not too long because of memory constraints). Set every BRR block to filter 1. Set every sample to 0. Now for every oscillator peak/impulse sample, add 1 to the sample height. If multiple oscillators peak at the same time, add them up. Filter 1 will create the sawtooth pattern after every impulse sample.

 Author: rainwarrior [ Tue Jul 18, 2017 5:48 pm ] Post subject: Re: Doing a supersaw lead on the spc700 I don't think the BRR filter on an impulse train is really equivalent to a saw's output spectrum*, but a filtered super-pulse-train might be a useful musical instrument of its own?Have you tried just making a super-saw sample, though? That worked fairly well for MOD music. (i.e. record a few seconds of it, crossfade for a loop.)* Edit: maybe it actually is, in the right circumstance, see lidnariq's post below.

 Author: tepples [ Tue Jul 18, 2017 6:38 pm ] Post subject: Re: Doing a supersaw lead on the spc700 The integral of a pulsetrain is a stairstep function. A stairstep function minus the line that bisects each rise and run is a sawtooth wave.Filter 1 is a leaky integral: y[n] = x[n] + .9375*y[n - 1]. The leaky integral of a pulsetrain is a sawtooth with a bunch of DC added. So you might want to treat some oscillators as positive impulses and some as negative impulses in order to minimize spurious DC.

 Author: lidnariq [ Tue Jul 18, 2017 6:48 pm ] Post subject: Re: Doing a supersaw lead on the spc700 Saw's spectrum should just be a "perfect" lowpass (i.e. integrator) filter of an impulse train, IIRC?I guess I should look at the interpolation filters... Lessee... nocash says Filter 0: new = sample Filter 1: new = sample + old*1+((-old*1) SAR 4) Filter 2: new = sample + old*2+((-old*3) SAR 5) - older+((older*1) SAR 4) Filter 3: new = sample + old*2+((-old*13) SAR 6) - older+((older*3) SAR 4) Filter 0 is easy.Filter 1 is ...y[n] = x[n]+y[n-1]-y[n-1]/16.Y = X + 15·Y·z¯¹÷16Y·(1-15z¯¹÷16)=XY÷X=1/(1-15z¯¹÷16)so transfer function is a single zero at 0 and a pole at +15/16. That's a lowpass with corner frequency at ≈1/56 the sample playback rate ... probably close enough to a perfect integrator?edit: add the other two-Filter 2: H=1/(1-61z¯¹÷32+15z¯²÷16) → Two zeros at 0, poles at (61±sqrt(-119))÷64 → Resonant (underdamped) 2nd-order lowpass; resonance is +9db at sample rate÷36; -3db point is at ≈1/20th the sample rate.Filter 3: H=1/(1-115z¯¹÷64+13z¯²÷16) → Two zeros at 0, poles at (115±sqrt(-87))÷128 → Critically damped 2nd-order lowpass; -3db point is at ≈1/39th of the sample rate.

 Author: psycopathicteen [ Tue Jul 18, 2017 7:02 pm ] Post subject: Re: Doing a supersaw lead on the spc700 rainwarrior wrote:Have you tried just making a super-saw sample, though? That worked fairly well for MOD music. (i.e. record a few seconds of it, crossfade for a loop.)I've tried doing so in the past and they always come out weak sounding, or take up too much memory. Just really difficult to get it to sound good. Using an algorithm would guarantee everything would be crystal clear.

 Author: rainwarrior [ Tue Jul 18, 2017 7:38 pm ] Post subject: Re: Doing a supersaw lead on the spc700 lidnariq wrote:Saw's spectrum should just be a "perfect" lowpass (i.e. integrator) filter of an impulse train, IIRC?I was thinking that a sawtooth should be -6db/octave but... ah! Yes, a simple lowpass filter should produce that. Sorry, I was working from incorrect fuzzy memories.Though, also I thought that our filter was at a fixed cutoff, but the impulse train was being streamed in, so I didn't think it was going to be tuned to the target oscillator frequency anyway. Maybe I misinterpreted this as well... maybe that's just a matter of adjusting amplitude to fit.

 Author: 93143 [ Tue Jul 18, 2017 7:52 pm ] Post subject: Re: Doing a supersaw lead on the spc700 Unless I'm missing something, using real single-sample impulses would result in a muffled sound, since the BRR decoding is upstream of the gaussian interpolator. But since the BRR filters are linear, it should be possible to prefilter the impulse train to counteract this.It seems to me that with a sufficiently compact treble boost filter, such as the one BRRTools uses, it might be feasible to synthesize the BRR data for this scheme in real time. This would allow very long notes with no looping artifacts in not very much RAM. On the other hand, avoiding buffer pacing glitches might be a bit fiddly, and playing more than one note at a time might require multiple buffers...

 Author: psycopathicteen [ Tue Jul 18, 2017 8:30 pm ] Post subject: Re: Doing a supersaw lead on the spc700 I can imagine that working by using {2,-1} pre-filter, but then you'd have to make sure more than 3 oscillators peak at once. You can probably use negative peaks instead just because the negative range is slightly bigger.

 Author: psycopathicteen [ Wed Jul 19, 2017 9:32 am ] Post subject: Re: Doing a supersaw lead on the spc700 Here's some 65816 code to make a "pulse train." Registers X and Y need to be fed with a random seed value for where to start the first wave, so that the 7 oscillators don't merge into a single sawtooth at the loop point.Code:make_pulse_train:clc-;inc {sample},xtyaadc {wavelength_lo}taytxaadc {wavelength_hi}taxcmp #\$2000bcc -rts

 Author: tepples [ Wed Jul 19, 2017 10:22 am ] Post subject: Re: Doing a supersaw lead on the spc700 So that we're all on the same page, I first want to understand the requirements for this synthesis.In a supersaw, by how much are the oscillators typically detuned?At what pitches is it used?How long is a note held?And at what sample rate did you intend to synthesize it? 8K? 32K?

 Author: Revenant [ Wed Jul 19, 2017 11:42 am ] Post subject: Re: Doing a supersaw lead on the spc700 tepples wrote:In a supersaw, by how much are the oscillators typically detuned?This post seems to have a pretty good analysis of the detune setup on the original Roland JP-8000 supersaw:Quote:When you look at the SuperSaw's various examinations, which can be found on the web, it gets pretty clear that Roland used maximum pitch spreads expressed in prime numbers. I chose maximum detune values in cents and these here should come pretty close to the JP8000: -191, -109, -37, 0, 31, 107, 181. Beating is reduced to an absolute minimum when using prime detune values. Phase randomization (on note-on) is also definitely needed or you won't get a strong attack on every note-on.

 Author: lidnariq [ Wed Jul 19, 2017 11:56 am ] Post subject: Re: Doing a supersaw lead on the spc700 Having just tried reconstructing that in puredata... I'm think he meant to say "mil" not "cents".

 Author: Revenant [ Wed Jul 19, 2017 11:57 am ] Post subject: Re: Doing a supersaw lead on the spc700 Yeah, I'm pretty sure it's not actually supposed to span almost four semitones, but you get the idea.

 Author: tepples [ Wed Jul 19, 2017 12:20 pm ] Post subject: Re: Doing a supersaw lead on the spc700 Assuming those are in thousandths of a semitone, this one-liner spits out the frequency ratios:Code:\$ python3 -c 'print("\n".join("%.5f" % 2**(detune/12000) for detune in [-191, -109, -37, 0, 31, 107, 181]))'0.989030.993720.997871.000001.001791.006201.01051Or to scale them by (say) 4096 for soft-synthesizing with integer math:Code:\$ python3 -c 'print("\n".join("%d" % round(4096 * 2**(detune/12000)) for detune in [-191, -109, -37, 0, 31, 107, 181]))'4051407040874096410341214139

 Author: psycopathicteen [ Wed Jul 19, 2017 1:57 pm ] Post subject: Re: Doing a supersaw lead on the spc700 I could possibly do variable detune amounts by making the loop longer or shorter. For example, If I have 8192 samples, and 32 samples per cycle (base frequency) then I can divide 8192 by {253,254,255,256,257,258,259} to get the oscillator frequencies. If I had 8224 samples, then I can divide them by {254,255,256,257,258,259,260} and have resulting frequencies that are slightly closer.

 Page 1 of 2 All times are UTC - 7 hours Powered by phpBB® Forum Software © phpBB Grouphttp://www.phpbb.com/