Yet Another Practice Oscillator Keyer Combo Zzzzzzzzzzz

Yeh just what the world needs….

Nooooo not another cw keyer and oscillator project, well yes…. It was built as a combination of other projects so they all fitted in one box.

(shown above is a 3D Render from KiCad )

WHY!!!?, well a project was needed to illustrate the use of Kicad I wanted to combine some other projects into one unit.

The project started as an oscillator, then an oscillator and keyer, then oscillator, keyer and small audio amp.

Why another practice oscillator? Well so many are harsh sounding squarewaves with very abrupt envelopes and something smoother sounding was needed. So the oscillator is a twin t oscillator with some envelope shaping as described in this article by K4ICY and the keyer is the Open Source Keyer from Jan DK3LJ , which was further modified by Jack AL4SV and K3NG, details here.

The keyer and oscillator are battery powered in case the box gets used portable and keyer and oscillator have been kept separate (hence the two batteries ).

The front panel provides input for straight key and paddles. There is a switch to select between the shaping of the rise time of the envelope, and trimmers on board to allow the two envelopes to be customised. eg one for paddles, one for sk.

An low level audio output is provided for feeding into a microphone input, eg on your pic or mixer, for practicing over zoom, or taking part in LICW classes.

The finished real PCB is shown above.

There are a few things I would do differently next time, but thats for another blog entry.

Posted in Uncategorized | Tagged , , , | Leave a comment

Pedal Effect Power Plug Safety Sleeve

For many guitar pedals the DC power lead is centre negative. Which to my personal view is the wrong way round!, we can thank BOSS for this configuration.

q)So whats wrong with having positive on the sleeve of the DC connector.

a)If you are using a daisy chain lead and dont use all the plugs you have 9V hanging about looking for some metal work to short itself out to.

If the centre had been used there is much less possibility of an incident. But thats not what we have so….

q)so how can we make things a bit safer?

a)dustcaps or sleeves,

But where to find such a handy thing. Here……Effectively bolt sleeves.

One Plug With a Sleeve and One Without

Posted in effects, electronics, guitar | Leave a comment

Silence the Xiegu G90-H1 Fan Stand

The xiegu G90 is a popular amateur radio transceiver and when used for digital modes can apparently get a bit warm. To help with this there is an accessory stand and fan combo called the G90-H1.

(eg from radioworld or Sinotel )

The problem is the fan the G90-H1 is not quiet (and runs all the time), but you can replace the fan with a quieter one. and/or fit an inline switch.

If you want to try a different fan then uses a 92x14mm fan. It only uses two wires so whether you have a fan with pwm control pins doesnt matter. Eg Noctua NF-A9x14 PWM.

Some write ups and advertising say “Monitored by a digital chip…” but the reality is the control circuit is a linear controller with an op amp and a thermistor.

So to make it quieter we can:

  1. Add New Fan
  2. Modify Circuit to ensure new fan starts
  3. Get back on air or hand it back to the friend you’ve modded it for

After replacing the fan with a noctua , the fan did not start every time and so to increase the fan speed at normal temperature to ensure it does start requires an increase to the gain of the circuit. One way to do this is to increase R3 (stock is 68K) or put a pot in series with it.One way to do this is outlined below and at the vid at

The mod is to cut that track that feeds R3 and put a variable resistor in series with it.

The mod and the schematic of the circuit are shown below.

You may have to adjust the fan speed to adequately adjust the G90 for your own situation. For my specific use case the replacement fan with a slightly reduced air flow does what I need. Your mileage, as they say, may vary.

The pot in place over the cut.

Posted in electronics | Tagged , , | Leave a comment

DX7 Ratios vs Arturia DX7 V Ratios

An small problem highlighted on youtube and on the Arturia forums is the differnance in how modulation is expressed for the operators is done differently.

Taking as an example the factory program of TUB_BEL

DX7DX7 V(Arturia)
or it could be….

DX7DX7 V Arturia

The method of converting from to the other is explained in this post on the Arturia forums here.

But why the difference.

On Arturia DX7 V the number of the ratio is expressed as a percentage of the number on the left.

Whereas on the DX7 the number is expressed as the percentage of an octave. (I think!)

This has a slightly confusing side effect in that an ratio on the DX7 can be represented in more than one set of numbers on the arturia.

Generally I want to go from real DX7 to Arturia hence wrote an simple (and ugy application to do the conversion)

Application to ease the calculations

How to go from Arturia DX7 V to Real DX7

Example 1

2 .75

Take the left number (freq) = 2

multiply it by the ratio part (so 2 * .75)

Then add it to the left number (the 2)

3 .5 = 2 * .75 +2 is the DX 7 Equivalent.

Arghhhhh you say (I know I did) how can 3.5 on the DX7 be either 2 27 or 3 1 on the Arturia.

OK, so the ratio on the Arturia is expressed as a percentage of the Freq (the number on the left) so lets work that back with the same calculation

Example 2

3 .166 On the Arturia DX7 V

Take the left number (freq) = 3

multiply it by the ratio part (so 3 x 0.166= 0.499 but we’ll round it up to 0.5)

Then add it to the left number (the 3) = 3.5

3.5 = 2 * .75 +2 is the DX 7 Equivalent

At least I think this is how it works, am I wrong?

Posted in coding, computing, midi, music, Uncategorized | Leave a comment

Lyx Configuration Fails When new Layouts Added

Added something to lyx, clicked reconfigure and you get the news that “reconfiguration failed….”.

Been there done that, got the errors and much sadness. So This post is a quick a)reminder to me what I did, b)some notes to help others fix/debug similar problems.

I’d just added these book links from editorium from the link for book layouts at

Which provides new layout files ( LyXBook–Default.layout and LyXBook–Archaic.layout ) which have to be placed in /usr/share/lyx/layouts folder. Once done you need to tell lyx to reconfigure (Tools-Reconfigure). But at that point I got an error message like this:-

The system reconfiguration has failed.Default textclass is used but LyX maynot be able to work properly.Please reconfigure again if needed.

Although fairly obvious what had broken the setup was the new layout files, Ithough it would be useful to document how you can debug this type of problem.

Launch Lyx from command line so you can see error messages

This gave some clues.

Traceback (most recent call last):  
File "/usr/share/lyx/", line 1901, in <module>   
 ret = checkLatexConfig(lyx_check_config and LATEX, bool_docbook) 
File "/usr/share/lyx/", line 1422, in checkLatexConfig    
 for line in open(file, 'r', encoding='utf8').readlines():  
File "/usr/lib/python3.8/", line 322, in decode    
 (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 845: invalid start byte
support/Systemcall.cpp (276): Systemcall: 'python3 -tt "/usr/share/lyx/" --binary-dir="/usr/bin/"' finished with exit code 1

The immediate clue is in one of the files there is something that was expected to be an utf-8 encoded character, but wasnt. Now need to find it…..We have only added two layout files so they are where the problem lies, but which line of which file?

Now just in case you have added lots of layout and want to identify the specific file you can modify the python script as explained at

modify /usr/share/lyx/ around line 1420 which looks like this
catline = ""        
for line in open(file, 'r', encoding='utf8').readlines()

add an extra line so it looks liek this instead. Its Python so be careful with those indents spaces vs tabs

catline = """class: " + classname)       
for line in open(file, 'r', encoding='utf8').readlines()

Then tell Lyx to reconfigure again, the difference being we now get told which file had the problem.

class: LyXBook--Default
Traceback (most recent call last):  
File "/usr/share/lyx/", line 1901, in <module>   
 ret = checkLatexConfig(lyx_check_config and LATEX, bool_docbook) 
File "/usr/share/lyx/", line 1422, in checkLatexConfig    
 for line in open(file, 'r', encoding='utf8').readlines():  
File "/usr/lib/python3.8/", line 322, in decode    
 (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa9 in position 845: invalid start byte
support/Systemcall.cpp (276): Systemcall: 'python3 -tt "/usr/share/lyx/" --binary-dir="/usr/bin/"' finished with exit code 1

Well that confimed a few things the file is LyXBook–Default, and the error related to unicode/utf-8.

So lets find where the non utf-8 characters are in the layout files.

For this need a little grep incantation and explained here

(as shown by Pablo Bianchi at

Which says

grep -axv '.*' LyXBook--Default.layout     

the arguments here are 
-a, --text: treats file as text, essentialy prevents grep to abort once finding an invalid byte sequence (not being utf8)    
-v, --invert-match: inverts the output showing lines not matched    
-x '.*' (--line-regexp): means to match a complete line consisting of any utf8 character.

So lets run the command

grep -axv '.*' LyXBook--Default.layout 
# LyXBook layouts, modules, and documentation copyright � 2013 by the Editorium. All rights reserved.
# LyXBook� is a trademark of the Editorium:

You can spot the non utf-8

And you can see which lines have something non utf-8 in them.

So you can now go and remove those characters, reconfigure Lyx and and all will be happiness….ish

Posted in Uncategorized | Tagged , | Leave a comment

OpenCV Function exploring and Image Stabilisation for DICOM

The open CV library provides many useful functions for image processing. But it can be difficult and slow to learn the best parameter values and the optimum order to apply them. My first application of opencv was to count the flock sizes of birds and I wanted to optimise the operations for enhancing the image prior to applying the counting mechanism.

For the next project I wanted to be able to experiment “interactively” with the order of the processes and also to convert grayscale images to a 3D representation. (the project was to find an slightly embossed area on a rusty sign on a canal aqueduct).

So I wrote apython application to facilitate this and a version of it is shown below.

( For anyone wanting to learn about opencv an excellent resource is )

The ‘pipeline’ of processes is shown on the left and their order can be changed and they can be enabled or disabled via the checkbox. The process panel (in blue above) shows the image being input to a processing stage and the output from that stage. The large image shows the result after the image has been processed by all the enabled stages of the pipeline. The 3d image shows the grayscale values converted to heights.

I also wanted a testing environment for future android projects and so decided to try a java implementation. The current version is shown below and its operation is the same as the python version shown above.

The UI of the JAVA version showing effect of canny edge detection

The next addition was to use template matching to provide image stabilization of a series of jpeg images in which an object was not always in the same location in the photo but for comparison purpose needed to be overlaid.

Image Stabilisation

The image processing pipeline is use to improve contrast of the image. A section of the enhanced image is then used as a template which is is searched for in each image of the image set. The co-ordinates of the located item are then used to extract the selection from the ORIGINAL image set and saved as a new file.The enhanced images and template are only used to locate the region of interest.

Medical Application DICOM Image stabilisation

Many medical imaging modalities save their resultant images as a sequence of images in the DICOM format.

In some image sequence the item of interest moves due to movement of the patient or their organs for example due to breathing. The work-around can be for each image to be examined and processed manual to select and crop the item of interest. This is time consuming as such images may be a set of hundred of images.

To assist some medical colleagues I modified the code to process dicom series. The specific scenario here is wanting to identify and extract the kidney in the sequence shown. This was to enable co-registration of the images for use by another diagnostic tool.

The constrained matcher shows the selected reference template (in a green rectangle). The output of the filter shows a white rectangle around the matched area in the test image, the large image on the right shows a zoom view.

The filter can either show the matched region (show in first section of the video) or as the extracted rectangle on its its own (as shown later in the video).

The matching method can also be changed via the dropdown in the filter.

To “help” the matcher a “contraint area” has been selected (the blue rectangle) and this limits where in the input image the matcher is limited to searching. There are other subtleties involved in this process such as selecting which “slice” of an image has the best shape to use as a template and means of filtering the relevant dicom positions.

The next version really needs some deep learning enhancement 🙂

Example of stabilising image

A download of the application will be available in future.

Posted in android, coding, computing, dicom, imaging, JAVA, matplotlib, opencv, pandas, python, Uncategorized | Tagged , | Leave a comment

Replacing Switches on Boss Multi-effects

As another weekend project during lockdown I resurrected an old BOSS ME multi-effects unit. An ME30, described in one forum post as “the worst sounding pedal ever”

It was one of the early digital effects units but with a bit of care and tweaking is OK, especially for portable practice purposes.

Once back in use it lasted a day before one of the footswitches failed. So time to fix it, there are plenty of resources online for the Boss service manual(link to manual). The manual also lists various self tests for the pedal and setup scope traces etc.

Finding the exact replacement switches was less successfull, but I found some that are of comparable size and easily available. These would likely fit other generations of Boss effects.For anyone wanting to do refurb and ME30 the process is relatively painless.

  • Order new switches
  • Dismantle
  • Desolder old switches
  • Fit new switches
  • Reassemble
  • Rrrrrrrrrrrrrock, or whatever

The switches I used were from RS Components and made by Omron.

Yellow Plunger Tactile Switch, SPST-NO 50 mA @ 24 V dc 3mm RS Stock No.718-2411 Cost 12p Each!!!!!! The originals had a soft rubber actuator which had a bit of “give” but in the underside of the pedal there is also a squashy rubber buffer. If this worries you then there are switches with smaller actuators to which you could attach a soft top.

The only problem part of the project was one of the switches is obscured by the screening plate that covers the some of the electronics. You could unsolder it, but as the switch is so close to one edge you can/could bend it out of the way slighting (aka a bit of a bodge or a pragmatic solution depending on your view point). I opted bending it out the way. The pictures below show the old/new switches and the screening plate.Have fun.

The Screen Plate bent to give access to the switch terminals
The New Omron Switches next to one of the original switches

Posted in electronics, guitar | Tagged , | Leave a comment

Sending UDP Packets with Phonegap and the In App Browser

To send some instructions to a server process I needed to send UDP packets from an Android device. Normally I would “go native” and java/kotlin but for this one I tried phonegap. This is a reminder of a couple of tweaks needed.

You need this package:-


ie cordova plugin add cordova-plugin-chrome-apps-sockets-udp

I also wanted to check a web page so used the cordova “in app browser

That worked on older Android but on on newer versions gave the error net::ERR_CLEARTEXT_NOT_PERMITTED .

To fix that needs tweaks in the project config.xml needed the xml android namespace adding as below

<widget id="" version="1.0.0" 

and in the platform stanza

<platform name="android">
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge"   target="/manifest/application">
  <application android:usesCleartextTraffic="true" />
</edit-config> of the platform entry

For more info on this at stackoverflow see here

Posted in android, coding, computing, Uncategorized | Tagged , | Leave a comment

Effect of Resistor in Parallel with Pot

Following on from the post on the capacitor bleed circuit, a comparison in the behaviour of the pot with and without the resistor bypass.

The diagram below shows the voltage out from a potentiometer as it is turned..and the effect of a resistor in parallel with one end of the pot and the wiper.

For example at half rotation, rather than the output being at 50% its around 64%.

And a reminder, these are showing comparisons against a linear taper pot.

If you want to know more about modelling pots and changing the taper see and an example of qucs with modelling a potentiometer here. For more general “how to use sweep parameters see

Posted in coding, computing, education, guitar, music, qucs, simulation | Tagged , | Leave a comment

Guitar Bleed Capacitor Vs RC Network

Many guitars have a “bleed” capacitor across the volume potentiometer so that as the volume is reduced the high frequencies are not as attentuated as much.Companies such as Fender also use an RC network to give more bass as the volume is reduced.

Typical combination are explained in this article So just out of interest (and as I wanted a demo circuit to use with qucs The Quite Universal Circuit Simulator ) I did some circuit simulation.

I did some frequency plots comparing the single capacitor configuration vs the new Fender network. I’ve shown plots for 3 settings of volume. These are settings of the pot from the point of view of resistance from the wiper to ground. So 5 is the pot at halfway FROM an electrical point of view, 9 at 90%, 1 at 10%

It should be remembered that volume/tone control pots are likely to be audio or logarithmic taper rather than linear. So halfway through the rotation wont be 50% signal level.

If you need an explantion of log/linear pots have a look at

As you would (probably) expect the difference are most obvious when the volume pot is at the lower setting showing a significant amount of high frequency signal getting through.

The overal signal level is higher for a given pot position (other than at max) on the Fender network due to the effect of the top of the pot and the wiper being in parallel with the resistors in the bleed circuit (a total of 170K). So when the pot is at 10% between wiper and ground ie 25K the remaining 225K is in parallel with that 170K yielding about 96K so that effective pot position is nearer 20% (ish)…and yes I could have accounted for that in the circuit but didnt, but if you want to there is a link to the qucs file below.

Anyway long and short of all this, is yes the new Fender combination will seem less toppy….But we knew that at the start 🙂

The qucs file can be downloaded here

The circuits in Qucs

Posted in coding, computing, guitar, music, Uncategorized | Tagged , | Leave a comment