Page 3 of 4
Re: QL Music
Posted: Mon Jan 31, 2022 10:06 am
by dilwyn
stevepoole wrote:Hi Derek,
After some checking it would appear that I had renamed Dilwyn's full Toolkit suite as DJTK_bin for the music program!
This is wasteful, as only the code to acces font swapping is necessary....
Perhaps Dilwyn can advise just which sub-files are necessary so I can zip them for the FastStave_bas music notations ?
Then I would like to post the modified DJTK_bin file for the Jan 30th forum entry, so Derek's tweaks won't be necessary any more.
Next I shall cut down the full program, so that music samples can be added to any program at all, ( because FastStave_bas is a neat but comprehensive demo... )
Best Wishes, Steve.
Not sure I understand...
If you mean that only the font setting instruction is needed, out of the entire toolkit, it may be easier to use a smaller single extension from my website at
http://www.dilwyn.me.uk/tk/font.zip. If you want to link it to a QLiberator compiled program use $$asmb=flp1_font_cde,0,10 (or the equivalent REM $$=flp1_font_cde,0,10 in Turbo)
Although these days, I don't know what the advantage of using such an extension would be (or the DJToolkit one from the toolkit Norman wrote for me so many moons ago) since 99.9% of QL systems these days have Toolkit 2, which contains a perfectly good extension called CHAR_USE to change fonts.
The only advantage of using the DJToolkit one would be that it also has the WHERE_FONT function to track down the address of an already installed font for a given channel. So Norman's offer to extract the keyword(s) you want may be useful in that respect. You could probably use the DEA disassembler to extract keywords from given toolkits, although it's not the easiest of processes! Plus, potentially copyright issues with some non-PD toolkits. There's an article about using DEA to do this on Quanta's website, at
https://quanta.org.uk/software-library/helpline/ - scroll down to article 35, Toolkits and Extensions and click on the link to download the PDF file to read.
(I haven't yet had a chance to look at Steve's music program, hence why I sound a little confused).
Re: QL Music
Posted: Mon Jan 31, 2022 10:34 am
by stevepoole
Thanks Dilwyn,
What is the syntax for swapping fonts with CHAR_USE please ? That would greatly simplify the FastStaves_bas requirements...
FastStaves also contains a BEEP experimenter keyboard with parameters you can modify on screen.
It transpires that if you use Xsteps as exact multiples of Ysteps, then wrap, random and fuzzy have no effect whatsoever !
You can play 3rd, fifth and 7th chords, but of course only using the two possible pitches per beep.
The music sample player not only plays music, but also shows the notes on the staves as they are panned on screen...
The program should run on 128ko, and perhaps on other emulators than QPC2?
Regards, Steve.
Re: QL Music
Posted: Mon Jan 31, 2022 11:27 am
by dilwyn
Extract from the Toolkit 2 documentation for the CHAR_USE command.
Basically: CHAR_USE #channel,font1_address,font2_address
If either address is given as zero, the font for the channel is reset to the one built into the operating system. So you can reset both afterward with CHAR_USE #channel,0,0
EDIT: The extract below was meant to be in a QUOTE structure, but the Forum gives me a 403 error when I try. So you get it as unstructured text instead.
Re: QL Music
Posted: Mon Jan 31, 2022 11:28 am
by dilwyn
dilwyn wrote:Extract from the Toolkit 2 documentation for the CHAR_USE command.
Basically: CHAR_USE #channel,font1_address,font2_address
If either address is given as zero, the font for the channel is reset to the one built into the operating system. So you can reset both afterward with CHAR_USE #channel,0,0
EDIT: The extract below was meant to be in a QUOTE structure, but the Forum gives me a 403 error when I try. So you get it as unstructured text instead.
OK, seems I can't post that extract and if I shorten it, it gets removed as though it was an attachment, so here's a link to the manual instead:
http://www.dilwyn.me.uk/docs/manuals/tk2.zip
Now you know why I have that avatar of me, the PC and the axe...

Re: QL Music
Posted: Mon Jan 31, 2022 12:06 pm
by Derek_Stewart
Hi Steve,
After typing "prepare" and then running the fastStave_bas programme, selecting option 0 the programme stop with an error at line 5670, where it tries load dos5_font_bytess, which is not in the supplied files.
Re: QL Music
Posted: Mon Jan 31, 2022 1:41 pm
by stevepoole
Hi Folks,
Thanks Derek and Dilwyn for your reports.
Now just UNZIP and LOAD fastStave2_bas. (Examine Line 5620 and alter it if you do not have the correct device to read from.)
Then RUN and choose BEGIN (just once to load the special font). Then follow the various instructions on screen. I just reTested, OK on QPC2.
_______________
Derek : I had previously had problems on my QL which has a dodgy byte in high memory, So I have fixed the bad saved file.
Dilwyn : Many thanks for the CHAR_USE code, so users now only require TK2_EXT to be used with QDOS.
Regards, Steve.
Re: QL Music
Posted: Tue Feb 01, 2022 9:17 am
by Exile
stevepoole wrote:Hi Folks,
Thanks Derek and Dilwyn for your reports.
Now just UNZIP and LOAD fastStave2_bas. (Examine Line 5620 and alter it if you do not have the correct device to read from.)
Then RUN and choose BEGIN (just once to load the special font). Then follow the various instructions on screen. I just reTested, OK on QPC2.
Thanks - this looks good! I had to modify line 1440, there was a missing *, but after that all went well.
This seems to run fine on sQLux on a Raspberry Pi4 and play in tune. (I've been adding Sound support for sQLux)
Re: QL Music
Posted: Tue Feb 01, 2022 9:52 am
by stevepoole
Hi Exile,
Sorry about that missing (*) multiply sign. I thought that that fault was definitevely fixed but not so.....
The problem is due to a bad byte in the high memory of my QL : Any parts of a program which uses that area get one byte zeroed. In this case it is the slave block which transfers a file to flp1_ ! So The reloaded file gets a MISTake put in where the multiply sign should occur. Nothing seems to remedy the fault...
So sadly, I cannot supply the corrected file, but thanks for indicating the fix.
Perhaps I should abandon my SGC completely ? But it is usually usable with code that does not use the bad byte area in Ram !
Regards, Steve.
_______________________
Re: QL Music
Posted: Tue Feb 01, 2022 10:00 am
by XorA
Perhaps I should abandon my SGC completely ? But it is usually usable with code that does not use the bad byte area in Ram !
Isnt the SGC ZIP ram? Thats easy to replace, maybe ask a hardware guru like Derek to look at it?
Definitely at current prices worth repairing them!
Re: QL Music
Posted: Tue Feb 01, 2022 11:04 am
by Derek_Stewart
XorA wrote:Perhaps I should abandon my SGC completely ? But it is usually usable with code that does not use the bad byte area in Ram !
Isnt the SGC ZIP ram? Thats easy to replace, maybe ask a hardware guru like Derek to look at it?
Definitely at current prices worth repairing them!
Thanks for the vote of confidence, I have some Zip Ram from a SGC.
I can fit the ram and test the SGC if required.