Any QL users here?

Struggling with Fuse or trying to find an emulator with a specific feature. Ask your questions here.
Post Reply
User avatar
TMD2003
Rick Dangerous
Posts: 2041
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Any QL users here?

Post by TMD2003 »

For the uninitiated: as part of my Type Fantastic project I've had to type in a few QL listings. So far it's been going OK, but I've reached a listing where the emulation is running far too fast.

Jim Grimwood told me he uses QLAYW on some form Windows, which I have not been able to make work - I get the same error message whether I'm using Windows 7 on my regyular PC, or an old laptop running Windows 2000. What I do have working is the original QLAY for DOS, running in DOSBox. This emulates something along the lines of a 486 DX2 running at 66 MHz, which is more than enough to run QLAY.

However, Jim's version of the qlay.rc configuation file is where the problems lie. It has two parameters, both of which affect the speed of the QL emulation. i.e.:

-r js.rom
-c [email protected]
-l win2@sub2\
-l [email protected]
-p LPT1:
-d 3
-L UK
-f 845
-w 200

It's these last two that are the problem - if I use these settings with DOSBox, the emulation runs sluggishly - the keyboard response is slower than a 1K ZX81, and the old door wedge would also beat the QL microdrive at loading times. -f is the speed of the emulation but -w is an extra setting to slow it down further on particularly fast PCs. The default value of -f is 400, so that is probably the first setting I should restore, but -w I have no idea. So far I've been using -f 845 and -w 30 to get the emulation running at a decent speed, but now I've come to a program with cursor controls and it's like running Spectaculator at permanent 10x speed.

I thought I would get the answer I needed with the BEEP command.

BEEP d,p should produce a sound of length "d x 72 ms" at a pitch p, where 1 is "high" and 255 is "low". Now we run into trouble.

With -f set to 845 as I have it, the duration seems about right but the pitch clearly isn't; 1 is around middle C, to my ears, 64 is off the bottom of the scale and 255 is more like an old pulse-dial phone dialling very slowly.

So, Question 1: what frequency should the pitch values actually produce on a real QL, or an emulated QL that matches the real thing about as closely as possible?

As another test I could ask Question 2: how long should all the shash on the screen stay for when the QL first boots up?

Or, best of all, Question 3: does anyone use QLAY in DOSBox and if so, what are your -f and -w settings?
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
PeterJ
Site Admin
Posts: 6873
Joined: Thu Nov 09, 2017 7:19 pm
Location: Surrey, UK

Re: Any QL users here?

Post by PeterJ »

There is a QL forum here if you can't get your answer at SC.

https://www.qlforum.co.uk/

There used to be a QL fan on WoS. I think his handle was something like Rama Simon?
User avatar
TMD2003
Rick Dangerous
Posts: 2041
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: Any QL users here?

Post by TMD2003 »

That'd be ranma_simon.

I have to wonder, looking at the QL documentation, and a recent Spectrum machine code sounds program I've typed in: is it possible that the QL's BEEP command works exactly the same way as the Spectrum's CALL 949 routine? That's a piece of machine code that I can understand after the way it was explained - poke the pitch into HL, with 0 as the highest pitch and 255 as the lowest, poke the duration into DE, though what value corresponds to what duration wasn't specified (I can soon find out, mind...), CALL 949 and out comes the sound.
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
TMD2003
Rick Dangerous
Posts: 2041
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: Any QL users here?

Post by TMD2003 »

...and after a bit of looking around, and being somewhat disturbed at the way Sinclair chose to handle the QL's sound chip, I've found a program to play a musical scale... of sorts.

It sounds horrific. But at least it does give me a series of BEEP pitches and frequencies, so I have something to work with.

So... to cut a long story short, BEEP x,1 produces "a very high note", BEEP x,2 is an octave lower, BEEP x,4 is an octave below that, and so on and so on, with harmonics - ever less accurate, by the sounds of things - produced by the values in between powers of two. Was this Intel's decision, i.e. was it the intrinsic nature of the sound chip, or was it Sinclair's decision to handle it this way?

But most of all - GOOD GODS, SIR CLIVE, WHY THIS... THING, AND NOT THE AY-3-8910? Still, I suppose if you don't get it right first time...
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
User avatar
TMD2003
Rick Dangerous
Posts: 2041
Joined: Fri Apr 10, 2020 9:23 am
Location: Airstrip One
Contact:

Re: Any QL users here?

Post by TMD2003 »

...and another update. Though it's annoying that both the -f and -w parameters affect the pitch produced by BEEP, I've at least sorted it so that BEEP *,15 produces as near to 440 Hz as Christian Zetnitz's Soundcard Scope will detect, and my ears can't tell the difference. The settings are -f 400 and -w 31 - it was more reliable to adjust -w than -f, as adjusting -f seemed to make the speed adjust in blocks (i.e. the BEEP pitch is the same for a range of -f values, somewhere between 10 and 20, I reckon it's a block of 12) whereas -w had a more direct effect.

The cursor on the graphics program I've typed still moves far too fast. Another timing sequence I have is Nostalgia Nerd's video about the QL, where he shows a QL working... and it does appear to be a screen capture of QLAY (unless the real QL had win1_ and win2_ available and a file called hello_bas on win2_...?); I've checked the cursor blink rate on his video - counting 93 frames for 8 blinks - which scales to 46.5 seconds for 100 blinks, and it's close enough to my DOSBox QLAY setup, which I timed at 45 seconds for 100 blinks.

I think this is as close as I'll get, so... on with the show!
Spectribution: Dr. Jim's Sinclair computing pages.
Features my own programs, modified type-ins, RZXs, character sets & UDGs, and QL type-ins... so far!
Post Reply