Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

ESQ1 Project

Post any examples or modules that you want to share here

Re: ESQ1 Project

Postby KG_is_back » Fri Jul 13, 2018 3:40 am

indeed it is a table of 16bit integers, that plots exponential fuction. The following is just speculation, but it's very likely the case. The table is used to calculate "step" variable from provided pitch. A sampler/rompler has internal "counter", which is incremented by the "step". The value of the counter is then used to read samples from the wave and do some interpolation.

So the table is equivalent to this calculation (pitches are in semitones):
Code: Select all
step=(current_sample_rate/wave_sample_rate) * ( 2^((requested_pitch - pitch_of_wave)/12))

Keep in mind, this would yield a fractional value. This can be accounted for, by having the "counter" be fractional too - basically integer, with decimal (or rather binary) point. MSB then refer to the integer part, which is used to fetch the value from the wave table and LSB are the fractional part used in interpolation.

Here is an example code of simple rompler with linear interpolation and counter with 1byte fractional part:
Code: Select all

out0=wave[counter>>8]; //get nearest previous/current value in wave table
out1=wave[1+counter>>8]; //get nearest next value in wave table
frac=counter & 0xFF; //extracts the fractional byte

output=(out0*(255-frac) + out1*frac)/255; //linear interpolation

counter=counter+step; //increment step



The table is 2048 values long, so its resolution is questionable. It is quite possible it is being interpolated itself. The assembler code provided your previous post seems to suggest that, as there is some bit-shifting involved.
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: ESQ1 Project

Postby Spogg » Fri Jul 13, 2018 3:38 pm

That’s fascinating KG and thank you for your input :D

What surprised me is you say that interpolation could be built into the step-size lookup table and I don’t get that. But that’s no surprise, given my poor maths skills :lol:
Do you mean they could choose an optimised step value for every pitch needed? This would have to be at the expense of accurate tuning surely…?

The hardware Frequency Control is “dumb” in the DOC chip, so, as you imply, the lookup table would be the only place to add-in any interpolation. Based on what I heard on the poor quality YouTube clips, there is certainly aliasing present (amongst the other recording artefacts).

Anyway, I’ve attached a modified spreadsheet. This has all the hex codes for waveforms replaced by the wav names directly. It took quite some time! Also there’s a single folder with all the wavs inside at root level. This work is for my needs later on, but it’s here if anyone is interested, and could save someone else several hours of work.


The fun continues…

Spogg
Attachments
Wav names in sheet 1 and wavs all in one folder with no index number.zip
(323.72 KiB) Downloaded 1028 times
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Re: ESQ1 Project

Postby tulamide » Sat Jul 14, 2018 8:17 am

KG, many thanks! I wonder if Spogg is aware of this, but it is a fantastic mind that comes to all those conclusions just by evaluating the table I posted. Awesome job!

Now, for a moment, I want to say something that is totally off-topic. Maybe you all knew it already, but I just discovered it. The guy who made the DOC chip for the Ensoniq synths is not just anybody. It is one of the three founders of Ensoniq, ok. But more important, it is Bob Yannes! The same Bob Yannes, who invented the SID chip, used in the C64. The most famous soundchip ever created!

Even today, people still create SID music! With such a genius behind all this, I don't wonder anymore about the amazing details we discovered about the DOC so far. Don't forget, it was in the mid-80s!

OK, back to topic again :lol:
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: ESQ1 Project

Postby KG_is_back » Sat Jul 14, 2018 5:12 pm

Spogg wrote:What surprised me is you say that interpolation could be built into the step-size lookup table and I don’t get that. But that’s no surprise, given my poor maths skills
Do you mean they could choose an optimised step value for every pitch needed? This would have to be at the expense of accurate tuning surely…?

The hardware Frequency Control is “dumb” in the DOC chip, so, as you imply, the lookup table would be the only place to add-in any interpolation. Based on what I heard on the poor quality YouTube clips, there is certainly aliasing present (amongst the other recording artefacts).


To clarify, I'm nor saying that interpolation is present. I merely said that it may be. My point was, that the table provides a step-value for a counter (which is apparently build into the DOC) and that the counter must have sub-sample precision to produce pitches properly. Otherwise the frequencies would be limited to multiples of sample-rate, which is obviously not the case.

I am completely unfamiliar with ESQ1 and how it is implemented internally. I haven't got the faintest clue about what the chips inside do...
KG_is_back
 
Posts: 1196
Joined: Tue Oct 22, 2013 5:43 pm
Location: Slovakia

Re: ESQ1 Project

Postby Spogg » Sun Jul 15, 2018 9:49 am

Oh I see KG, thanks.

I can confirm there is no subsample interpolation in the original, so as you say, for all non-integer ratio values there is aliasing.

The DOC steps through the waveform samples in whole sample values. It has a fixed clock rate of 38,461 Hz and only the step size is varied to get the desired frequency.

This was 1986 don’t forget, and the achievement was amazing for its time. I did know the same guy made the SID chip; a very clever man.

My take on this will be to have a quality switch which can turn interpolation on and off. It makes quite a difference as you can imagine. It depends on whether you want an original authentic sound or a more modern smooth one.

I emailed Rainer to see if he would supply the zip password for the full documented (commented) OS on his site, but I got no reply. It’s not important for me at this stage, but it would be interesting to see exactly how the exponential converter table was fed and especially how the notion of “normalising” worked. This would be down to you, KG, of course since you clearly have an amazing talent for such analysis.

Cheers

Spogg
User avatar
Spogg
 
Posts: 3358
Joined: Thu Nov 20, 2014 4:24 pm
Location: Birmingham, England

Previous

Return to User Examples

Who is online

Users browsing this forum: No registered users and 21 guests