Speech Synthesis

Anything QL Software or Programming Related.
User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Speech Synthesis

Post by bwinkel67 »

NormanDunbar wrote:
Dilwyn wrote:I had written quite a lengthy reply to this and it hasn't appeared on here??? (Bangs head hard on wall :cry: ).
This one? viewtopic.php?f=3&t=3847&view=unread&si ... 687#p42300

It certainly appeared for me, and, was very interesting indeed. Thanks.


Cheers,
Norm.
There's a reply 5 down from that where it just includes a quote but nothing else...I think that's what Dilwyn was referring to.


User avatar
dilwyn
Mr QL
Posts: 2753
Joined: Wed Dec 01, 2010 10:39 pm

Re: Speech Synthesis

Post by dilwyn »

bwinkel67 wrote:
NormanDunbar wrote:
Dilwyn wrote:I had written quite a lengthy reply to this and it hasn't appeared on here??? (Bangs head hard on wall :cry: ).
This one? viewtopic.php?f=3&t=3847&view=unread&si ... 687#p42300

It certainly appeared for me, and, was very interesting indeed. Thanks.


Cheers,
Norm.
There's a reply 5 down from that where it just includes a quote but nothing else...I think that's what Dilwyn was referring to.
Ah, that's what happened. Thanks - yesterday was a busy and frustrating day I would like to restart from scratch given the chance!

I had a quick look for the sound article I mentioned in my Spectrum book. The article is longer than I remembered (well,it was 35 years ago and the old grey cells ain't what they used to be) and the published version is not the version I thought it was i.e. not the interrupt driven version I thought it was, but otherwise complete and scannable if anyone is interested.

I asked a few people about trying to get in touch with my former work colleague to see if he had kept any of our work. Sadly, it seems he had a serious stroke two or three years ago and is in a care home nowadays, so that is unlikely to lead to anything. But Jan's work is probably going to be of far more use to you anyway.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Speech Synthesis

Post by bwinkel67 »

janbredenbeek wrote: The complete source and circuit diagram are here on GitHub: https://github.com/janbredenbeek/QL-Basicode
So reading this diagram, you need to add a 4.5 volt power source to the circuit to get it to work I'm guessing? Also, is that a 2.5K preset resistor I assume...so you have to do a little adjustment to get it to load properly?
cassetteinterface.png
I do have a spare ROM cartridge and need to order some stuff including a few EPROMs (27C128) and an EPROM programmer (TL866II Plus) for some other projects. So it'll be a while before I can get it all to work but I'm excited to see if I can use the software on my QLL with ROM cartridge to get it to load and save.

Some questions:
  • Am I assuming correctly it should still work on a BBQL even with the update for SMSQ/E?
  • Also, I have a US QL so does its slight speed difference add any issues?
  • Does it have to be an actual cassette or can I just connect it to my line-in/audio-out of my computer and capture it digitally on that side (like I do with ZX81 stuff)?
The goal is just to get it initially to save/load and then take a look at doing other stuff with it (i.e. sound output, sound sampling, etc...). I think that would be pretty cool extension to the QL with just the hardware it has.

Again, this is such a cool project you did. I know you've created a ton of cool QL software and I use a bunch of it, but for me, this is the coolest just because you got the QL to do something that most folks wouldn't think was possible :) Would love to see some of those Demo programmers use that and create a more realistic "demo scene" program that plays digitized music instead of just the beeper (if possible...I'm assuming it will be but obviously no where near to that yet and may not be technically savvy to do that).


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Speech Synthesis

Post by janbredenbeek »

bwinkel67 wrote:
janbredenbeek wrote: The complete source and circuit diagram are here on GitHub: https://github.com/janbredenbeek/QL-Basicode
So reading this diagram, you need to add a 4.5 volt power source to the circuit to get it to work I'm guessing? Also, is that a 2.5K preset resistor I assume...so you have to do a little adjustment to get it to load properly?
The 2.5K preset provides a pull-up so the level is just around the transition point. There is an earlier thread about it: viewtopic.php?t=1179&p=38201#p38191
Some questions:
[*] Am I assuming correctly it should still work on a BBQL even with the update for SMSQ/E?
SMSQ/E requires a (super)Gold Card, which has different timing so will not work (the delay loops will have to be adjusted for the faster processor).
[*] Also, I have a US QL so does its slight speed difference add any issues?
Maybe... but from what I gathered the speed difference is somewhere between 5-10% so it should still be between limits. Also, it doesn't affect recordings read back with the same machine.
[*] Does it have to be an actual cassette or can I just connect it to my line-in/audio-out of my computer and capture it digitally on that side (like I do with ZX81 stuff)?
No, it can be any source, as it's just a 1-bit sample it only counts the high-low transitions.
The goal is just to get it initially to save/load and then take a look at doing other stuff with it (i.e. sound output, sound sampling, etc...). I think that would be pretty cool extension to the QL with just the hardware it has.
Using a bit-banged port is a very crude way for sound sampling. There have been more sophisticated developments in the past, e.g. Peter Graf's QL Sampled Sound System which is available on the Q40 and Q68 in hardware, and on QPC2 in software. However as far as I know this only supports playback, not recording (since Peter is on this forum he'll probably be able to comment more on this).


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Speech Synthesis

Post by bwinkel67 »

janbredenbeek wrote:
bwinkel67 wrote: [*] Am I assuming correctly it should still work on a BBQL even with the update for SMSQ/E?
SMSQ/E requires a (super)Gold Card, which has different timing so will not work (the delay loops will have to be adjusted for the faster processor).
My question was actually the opposite: "Can a BBQL (with QDOS) still run the software even with the updates you put in for SMSQ/E" is what I was asking. So I was concerned it may not run with QDOS with the SMSQ/E changes, not that I wanted to run SMSQ/E on the BBQL. Sounds like that's the case.


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Speech Synthesis

Post by janbredenbeek »

bwinkel67 wrote: My question was actually the opposite: "Can a BBQL (with QDOS) still run the software even with the updates you put in for SMSQ/E" is what I was asking. So I was concerned it may not run with QDOS with the SMSQ/E changes, not that I wanted to run SMSQ/E on the BBQL. Sounds like that's the case.
Yes, it should still be compatible with QDOS. The changes for SMSQ/E were mainly in the BASIC parser, the tape I/O routines haven't been touched.


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Speech Synthesis

Post by bwinkel67 »

janbredenbeek wrote: Yes, it should still be compatible with QDOS. The changes for SMSQ/E were mainly in the BASIC parser, the tape I/O routines haven't been touched.
Another question, your BASECODE needs to run in ROM for timing reasons. There's a utility for a Spectrum emulator that also uses the QL network ports. It seems to only run with expanded memory but is RAM based. Any idea why their timings work in RAM?

Here is their README on it...I'm guessing the "small interface circuit" must be similar to yours...haven't tracked it down yet.

Code: Select all

    =======================================================================
    ================= ZM/Diginet and the Super Gold Card ==================
    =======================================================================

    Currently  ZM/ac's  Diginet  works  only  with Expanderam, Trump Card or
    Gold  Card espansions. Unfortunately it does not work on the QVME or the
    QXL.


    On  the  Super  Gold  Card we experienced some problems when calculating
    the MIN and MAX leader values sampling the LEADER from the tape.


    If  you see that after the calibration Diginet does not recognise at all
    the  ZX  programs  on  the tape try lowering manually (say upto 30%) the
    MIN  leader value and/or increasing the MAX leader value (say upto 30%).
    Then  "Auto  adjust" the other values. On my Super Gold Card system good
    values  are  250/300  for  the  MIN leader value and 650/750 for the MAX
    leader value.


    Now  try  to  re-read  again  the  tape. Anway best results are achieved
    using our small interface circuit.

    


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Speech Synthesis

Post by janbredenbeek »

bwinkel67 wrote: Another question, your BASECODE needs to run in ROM for timing reasons. There's a utility for a Spectrum emulator that also uses the QL network ports. It seems to only run with expanded memory but is RAM based. Any idea why their timings work in RAM?
They probably do a speed measurement on startup. One could count the number of instructions executed in a certain time using the frame interrupt or hardware clock as reference and calculate the timing loops accordingly.

The problem with internal RAM is that the number of wait states is not constant and varies with the line and frame sync. This would lead to a very distorted output (not just lower frequencies).

On external RAM I would expect a more constant number of wait states (if at all) so simply adjusting the timing constants may work. I have yet to test this - remember when I wrote this code there were no Gold Cards and the Trump Card was just around the corner! I believe the speed of the Trump Card RAM is about half-way between internal RAM and ROM (it is said that the CST RAM expansions were the fastest at the time).


User avatar
bwinkel67
QL Wafer Drive
Posts: 1187
Joined: Thu Oct 03, 2019 2:09 am

Re: Speech Synthesis

Post by bwinkel67 »

Thanks again for the info. I will look through both your code and theirs to get an idea of how it works. Haven't done any 68K assembly since the 90's and did more Z80 in the 80's so it'll be re-learning some of that (now days I spend more time creating my own machine/assembly language as a teaching tool, which tends to be simpler). I'm guessing the interface to the QL network will end up being a trap call...so maybe I can create a quick test in C.

If I don't build the interface right away, is there a concern of just sticking a mono speaker (perhaps amped) on the network jack (i.e. I don't want to blow any circuit in the QL but want to see what sort of noise/sound can come out of it)? It seems that the emulator instructions didn't quite require it but recommended it for better results.


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Speech Synthesis

Post by janbredenbeek »

bwinkel67 wrote: If I don't build the interface right away, is there a concern of just sticking a mono speaker (perhaps amped) on the network jack (i.e. I don't want to blow any circuit in the QL but want to see what sort of noise/sound can come out of it)? It seems that the emulator instructions didn't quite require it but recommended it for better results.
The network ports are well buffered so a short circuit wouldn't do any harm, but it may be wise to put a capacitor in series with the speaker to decouple the DC component in the output signal.


Post Reply