Toney IOMMidi

Yet another Midi Pedal project….But with a specific purpose – to control a Laney BCC Loud Pedal.

The Laney BCC Loud Pedal is designed to be used in a pedal board. But I wanted to be able to reach the controls without leaning down to the pedal board and I also wanted the convenience of foot switching……and so designed/built yet another midi pedal.

It started off as arduino but has been redesigned to run on a bare avr micro. The board wakes up and sends midi out when a switch is pressed and then goes back to deep sleep to save battery. The board has more i/o ports that are needed as I intend to use the same PCB for other projects and also as a development board.

Here is a pic of the PCB board showing some west midlands flavored quotes on the silk screen. One quote is slightly obscured.

“give it full poke charlie (Noddy Holder)

The final project awaiting labels and decal…yeh its a black box…..

and here it is next to what its designed to control.

and the project has been named the Toney Iommidi, because it lets you change tone and it provides midi…..and inside it has a Tony Iommi quote.

If you are looking for an guitar amp large or small take a look at Laney amplification some of their amps and the BCC(Black Country Customs) Loud Pedal are built in the UK.

This page will be eventually updated with link on how to build your own.

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

Some things are best Whispered(WSPR)

WSPR (Weak Signal Propogation Reporting) is an interesting means of studying how radio propogation changes, and many people, myself included, have built beacons. But I wanted one that handled multiple bands. Ultimately I will be using an U3S from QRP Labs(Ultimate U3S ) But in the meantime I wanted to do some experimenting and get some more PCB design practice. So over a few weekends and evenings settled with a 6 band design.

This design supports 6 bands and each band filter output can be routed to one two outputs so it can be used multiple antennas. For the filters for each band I used kits from QRP Labs (QRP Labs Low Pass Filters) and to switch bands used relays ( under the filters) and yes it owes a lot to the QRP Labs U3s and their relay switch filter board is what gave me the idea to use the small relays beneath the filters.

The firmware is based on code by IW5EJM (multiband nodemcu wspr) but with quite a lot of changes and the addition of an OLEd display and web server. The OLED to show me when it last transmitted, on which band and when it last updated its time from NTP it is configurable via web browser. the web server is to enable configuration of which bands are active and to select test routines for setting up and tuning the filters.

Its a pretty standard wspr project with a couple of hardware features worth highlighting:

The 5V Regulator

The 5 volt regulator (next to the two diodes) is a murata switching regulator that has the same pinouts as an 7805 but has the big advantage of not getting hot when its supplied by 12 Volts.

Processor

For the processor its a Wemos D1(a real one ). A lot of the clones of the D1 have an underated 3v regulator on board. For more on that discussion on clone Wemos boards see this link from bbqkees

There is room for up to 3 FETs (socketed) but it can manage quite well with just 1 (bs170). I also included an 74HC00 socket in case I want to buffer the Si5351 output in some future experiments.

Debug and Measuring Points

All the headers are to make it easy to put a meter in line with the output stage and/or to feed it from 12V instead of 5V. It makes life a lot easier if at the design stage you add in test points etc. I also added LEDS on the select lines to the relays as that made debugging and config a lot easier. For the LEDS these are small SMD devices. The relay drive transistors could also have been made SMD but I was feeling old school and had a load of through hole transistors in a drawer.

The Drift…..

Frequency stability can be a bit hit and miss with the generic Si5351 modules and initialy there was frequently 3-4 drift on 12 mtrs. But there is some (excellent) advice on the QRP Labs web site from both Hans and John Ove (https://www.qrp-labs.com/synth/freqstab.html) . My variation was glueing an M3 nut to the xtal and the si5351, and then enclosing the module in some polystyrene. Now it is 0 drift for most decodes and I suspect for those that arent the drift may be with the receiving station.

Kicad 3 D Impression of the board

And now the real one

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

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 , , , | 1 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 https://www.youtube.com/watch?v=y9qI8OHYaAY

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)
3.52.75
3.013.1
or it could be….

DX7DX7 V Arturia
3.53.166

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 https://wiki.lyx.org/Layouts/Layouts

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/configure.py", line 1901, in <module>   
 ret = checkLatexConfig(lyx_check_config and LATEX, bool_docbook) 
File "/usr/share/lyx/configure.py", line 1422, in checkLatexConfig    
 for line in open(file, 'r', encoding='utf8').readlines():  
File "/usr/lib/python3.8/codecs.py", 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/configure.py" --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 https://www.lyx.org/trac/ticket/11736

modify /usr/share/lyx/configure.py 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 = ""        
logger.info("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/configure.py", line 1901, in <module>   
 ret = checkLatexConfig(lyx_check_config and LATEX, bool_docbook) 
File "/usr/share/lyx/configure.py", line 1422, in checkLatexConfig    
 for line in open(file, 'r', encoding='utf8').readlines():  
File "/usr/lib/python3.8/codecs.py", 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/configure.py" --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 https://stackoverflow.com/questions/29465612/how-to-detect-invalid-utf8-unicode-binary-in-a-text-file)

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 www.opencv.org 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 https://www.pyimagesearch.com/ )

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:-

cordova-plugin-chrome-apps-sockets-udp

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="com.whatever.app" version="1.0.0" 
xmlns=”http://www.w3.org/ns/widgets” 
xmlns:android=”http://schemas.android.com/apk/res/android"
xmlns:gap="http://phonegap.com/ns/1.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>
........rest of the platform entry
</platform>

For more info on this at stackoverflow see here

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