UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > Specific Vintage Equipment > Vintage Computers

Notices

Vintage Computers Any vintage computer systems, calculators, video games etc., but with an emphasis on 1980s and earlier equipment.

Closed Thread
 
Thread Tools
Old 28th May 2023, 12:05 pm   #101
ortek_service
Octode
 
ortek_service's Avatar
 
Join Date: May 2018
Location: Northampton, Northamptonshire, UK.
Posts: 1,394
Default Re: Micro music box project.

When I gave it a brief-test, I zoomed-in to the 'glitches' and they were just about full-amplitude, but had around 45deg slope-angle on the rise / fall edges - Which I think were due to fairly-low speed of 4000-CMOS (Particularly at lower 5V voltage - With many other projects using this circuit, running at 15V. But I didn't try it at that voltage, being as it needs to work with SC/MP-II's 5V levels). Rather than a limitation of the 'scope I used (One of Tektronix cheaper / lower-end TDS2000-series DSO's, that's around 20yrs old but still with at least 100MHz B/W and 1GSa/s rate).
And I imagine were to-narrow to be seen by the SC/MP Sense-B input.

I did have a look at the CMOS Cookbook (which Chris had told me covered this type of circuits / had table of taps). In the 1988 (original was 1977) 2nd Edition, it's around page 376 - Page 389 of a pdf-version, available to view here: http://vtda.org/books/Electronics/Do...20-%201994.pdf

And this just has the taps at 11 and 18 - so only a single E-(N)OR gate required - that all the LFSR webpages etc. I found had.
But I did read (for the first time) from this, that if you use X-NOR's then the sequence is inverted (and 'stuck' condition is then all 1's, rather than all 0's. And if you 'mirror' the taps below end of chain - So 8 and 18 in this case? - then it produces a 'backwards' version of the sequence.
It seems four different maximal-sequences are possible from a minimal 2-tap LFSR. Although it doesn't mention using more taps, as I had previously read on some webpages / pdf articles, that 20 different (maximal?) sequences were possible using four rather than two taps).

However, the 3-tap (<< maximal length?) version used by the TWONKY, doesn't seem to appear in that book. So still a bit of a mystery where this (seemingly often-copied) design originated from (And if used for audible-noise on synths, then maybe a longer maximal-sequence would sound rather different). So I might try building the simpler 2-tap one (maybe just using breadboard for speed, and rather less complex than 31-stage one built that way on Wikipedia LFSR page) sometime, to compare outputs.
ortek_service is offline  
Old 1st Jun 2023, 9:12 pm   #102
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

One tiny step further... I decided before proceeding to compare the assembled output from Slothie's version of Geoff Philip's modified-for-MK14 Twonky code (#44) with my version (#15) and I'm pleased to say that the assembled files from both sources have exactly the same 16-bit checksum, which makes it highly likely that they are an exact match.

This means:

-We both got it exactly wrong

or

-We both got it exactly right

Next step is to see if it actually works..
SiriusHardware is online now  
Old 1st Jun 2023, 10:27 pm   #103
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

It does work!!!

But I think I may have been rather unkind to the Sirius Cybernetics robot choir... I am admittedly tone deaf but it doesn't sound to me as though it is playing legitimate musical notes. A succession of different tones of different lengths, yes.

I don't think GP altered the note pitch values from those in the original TWONKY article so the immediate assumption has to be that it is intended for a 4.00MHz clock, which mine is. However there was a block of changes made in the middle of the code for reasons I don't quite understand so that may have some bearing, maybe he did something which shifted the overall tuning by a percentage to make it sound right on a 4.43MHz clock.

I need someone else to have a go now, and for myself to try listening to it on something better (I'm using a Haynes cardbox Box 'amplifier' kit, which is basically an LM386 in a cardboard box with a 2-inch speaker. I could do better).

When I get a bit more time I'll record some of the output as it stands now.

Here's the code, which happens to be the one generated by Slothie's source code - but as I said, my version is identical. Load at 0B00, run at 0B00 and bear in mind that you will need to have connected the PRBS generator discussed earlier to NADS, SIN and SENSE-B (and power) in order for the program to run as intended. I took the output from FLAG 0.
Attached Files
File Type: zip twonkey.zip (444 Bytes, 13 views)

Last edited by SiriusHardware; 1st Jun 2023 at 10:37 pm.
SiriusHardware is online now  
Old 2nd Jun 2023, 1:27 pm   #104
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

Just been doing a little bit more research - first - and even I should have noticed this - the range of notes available is only eight notes and not eight consecutive notes either - in keyboard terms it can only play the 'white' notes.

The notes are from F to F, excluding the 'black' notes. Having looked at the comments in the source (which are from the original ETI article) all of the specified note frequencies are within +/- 2Hz of their expected frequencies because these are the closest frequencies that the code can generate given the minimum length of time a single instruction takes to execute.

If you are a real musician that +/- 2Hz is probably rather noticeable. I once made a microprocessor based 1750Hz toneburst (for amateur radio repeater access) and when I demonstrated it to another amateur whose day job happened to be teaching music, he immediately said 'It's flat'. It was in fact 1748Hz, the closest I could get to the proper frequency with that particular setup.

As I mentioned before though, I'm pretty tone deaf as well as actually quite deaf, so I need to use a more technical method. What I'm going to try next is to edit the tone values in the table so that all eight are the same pitch, and then also reduce the inter note gap to zero. That should make the code generate the same note continuously and allow me to measure the actual frequency being generated for each note in turn with a frequency meter.

As always, I'm away for the weekend so I probably won't get further with this until late next week. I'd be interested to know if anyone else has any success getting this going.
SiriusHardware is online now  
Old 2nd Jun 2023, 3:07 pm   #105
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,265
Default Re: Micro music box project.

It might be easier to capture each note on a digital storage scope to measure the frequencies. Modifying the code might be difficult to completely remove any gap between notes.
Mark1960 is offline  
Old 2nd Jun 2023, 3:42 pm   #106
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

I'm wondering if there is some freeware / shareware software which can take an audio file and analyse it, to identify the frequency of a highlighted section of an audio sample for example. It could be that something like 'Audacity' already has just such a feature but I just haven't found it yet.

I take your point about it being difficult to get a seamless transition between one note and the next, I was thinking that if I use a frequency meter on a very long sample / capture time it would show the average frequency despite the occasional blips.

I find it quite difficult to measure frequency more than approximately using a scope because the graduations on the scale are quite coarse and even the thickness of the trace can make it difficult to decide where to measure from and to. With a square wave I suppose I would try to get at least 11 cycles captured on the screen and measure from the leading edge of cycle 1 to the leading edge of cycle 11, but the accuracy won't be amazing.
SiriusHardware is online now  
Old 2nd Jun 2023, 3:53 pm   #107
Mark1960
Octode
 
Join Date: Mar 2020
Location: Kitchener, Ontario, Canada
Posts: 1,265
Default Re: Micro music box project.

I thought you might have access to a more recent DSO where you could set a marker at beginning and end samples and calculate the frequency from the difference in sample times. Some will even calculate the frequency for you.
Mark1960 is offline  
Old 2nd Jun 2023, 4:37 pm   #108
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

I do have a DSO but it is very low end, and doesn't have any of those posh features.

Another thing I could try is to run the original Twonky code on the MK14 - by putting the ETI Twonky code into the first 512 bytes (ROM) as intended and by providing RAM immediately above that by plugging in the Slothie-Ortonview, which provides RAM resident at 512 decimal / 0200 hex onwards.

I have a crude adaptor consisting of a 28-pin IC socket wired to 2 x 16 pin sockets, which is my way of trying out non original code on the MK14, by programming it into a 27E512 EEPROM and plugging it into the PROM sockets.

Incidentally another possible sound output device / transducer for the MK14 and other computers which just have a crude square wave output is a humble set of powered PC speakers. I may try that next myself.

Last edited by SiriusHardware; 2nd Jun 2023 at 4:45 pm.
SiriusHardware is online now  
Old 2nd Jun 2023, 11:13 pm   #109
Timbucus
Octode
 
Join Date: Mar 2019
Location: Barry, Vale of Glamorgan, Wales, UK.
Posts: 1,362
Default Re: Micro music box project.

Excellent progress - I am anxious to hear the output - I too am tone deaf.

I am going to have to build one of these - wonder if it would run on a Softy
Timbucus is offline  
Old 3rd Jun 2023, 9:08 am   #110
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

Even if not you could use the EPROM emulation feature of the SOFTY to run the original TWONKY code (or any other code for that matter) in the PROM area of the MK14 with suitably made cables and adaptors. But that would be running before you can walk, I think.
SiriusHardware is online now  
Old 7th Jun 2023, 9:31 pm   #111
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

Another experimental step forward - as suggested earlier I reduced the inter-note gap to the minimum possible and then changed all eight values in the note frequency table to each successive note value in turn, the aim being to get Twonky to play each of the eight possible notes nearly continuously for a while so their frequencies could be measured.

Bear in mind that I didn't remove the inter note gap entirely so each measurement read a little bit on the low side due to occasional missing cycles over time. This is what I got.

Code:
; Intended pitches @ 4MHz		Measured

.DB	50	; F	350.875Hz	349.255Hz
.DB	53	; E	332.005Hz	330.918Hz
.DB	60	; D	294.985Hz	294.128Hz
.DB	68	; C	261.645Hz	260.969Hz
.DB	72	; B	247.645Hz	247.044Hz
.DB	81	; A	221.045Hz	220.563Hz
.DB	91	; G	197.47Hz	197.091Hz
.DB	103	; F	175.07Hz	174.768Hz
All of them are only about 1 to 1.5Hz lower than the frequencies being aimed for and I think if I could have removed the inter-note pauses entirely then it probably would have been closer. The machine's clock frequency was measured as 4.000002 MHz.

From the above results I conclude that the code, even after being converted for the MK14 by Geoff Philips, is still written for a 4.00MHz clock and not a 4.43MHz clock.

The other thing I did was to connect the Flag0 output to the left-in and right-in on a pair of chunky, reasonably powerful powered PC speakers that I have. I had to add a divider consisting of a 220K in series with Flag0 and a 22K down to 0V in order to reduce the min-max volume to a reasonable range.

The speakers in question are quite big and bass-capable as PC speakers go with a bass and treble control so I turned the bass right up and the treble right down to make the sharp-edged tone sound a little bit more mellow. It made a world of difference to the sound after the tinny little barely boxed speaker I had tried originally, and I can now hear that Twonky does actually play recognisable notes although they might still make a proper musician wince.

I'm still trying to work out the best way to record a fragment of the output - I may just hold a phone up to the PC speakers. The sound quality should be quite good... after all... it's digitally mastered.

Last edited by SiriusHardware; 7th Jun 2023 at 9:39 pm.
SiriusHardware is online now  
Old 9th Jun 2023, 12:45 pm   #112
Realtime
Hexode
 
Join Date: Jan 2021
Location: Ashford, Kent, UK
Posts: 318
Default Re: Micro music box project.

Quote:
Originally Posted by SiriusHardware View Post
I'm still trying to work out the best way to record a fragment of the output - I may just hold a phone up to the PC speakers. The sound quality should be quite good... after all... it's digitally mastered.
I too am keen to hear this. I haven't got time at the moment to try and build a TWONKY of my own and just can't imagine what it actually sounds like.

That said I was wondering about using an 8 pin PIC (I think I've got some PIC10F parts somewhere) programmed with the random bit generator to simplify the implementation.
Realtime is offline  
Old 9th Jun 2023, 12:54 pm   #113
SiriusHardware
Dekatron
 
Join Date: Aug 2011
Location: Newcastle, Tyne and Wear, UK.
Posts: 11,485
Default Re: Micro music box project.

Well, obviously, I've heard the output from it now on reasonable speakers and measured the frequencies of the individual notes too so I can say they are reasonably close to what they were meant to be, or at least what the programmer meant them to be.

But I will still say... be careful what you wish for.

I only really have time to myself on Thursday evenings at the moment so I won't be able to attempt to set it all up again and record the output until Thursday next week at the earliest.
SiriusHardware is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 10:49 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.