Skip to main content

Posts

Made in Korea

Au milieu des années 80, quand le MIDI commençait à se répendre, les constructeurs proposaient des accessoires MIDI dans leurs catalogues. C'était le cas notamment pour Yamaha avec son MIDI Expander YME8, visible entre autre dans leur catalogue "The World of Musical Instruments". Mais ces accessoires "officiels" étaient souvent très chers, et une offre parallèle est apparue. Quand j'ai eu le besoin d'acheter une MIDI Thru box (autre nom pour le MIDI Expander), le magasin m'a proposé un équivalent moins cher, le MD80 de LEEM, qui n'est autre qu'une copie coréenne du YME8. Bas prix, car la qualité de réalisation est loin d'égaler celle de Yamaha: le boîtier ne ferme pas parfaitement (alors que le Yamaha possède deux boîtiers: un intérieur sur lequel est fixé le régulateur de tension, un extérieur conportant la sérigraphie), la sérigraphie est grossière, la visserie n'est pas homogène, même les patins en caoutchouc sont différents (2 d...

C++ : a nasty bug

It took me 2 days to figure out this bug in C++. The context I use ncurses and I want to manage several windows. I created a class (Window) with all the methods I need. class Window { private: WINDOW *win; ... public: ... } No issue here. To store my objects, I used a vector of pointers: std::vector<Window*> Windows; The bug I want to create 2 windows, so I did the following: Window *A = new Window(...); // Instantiate the class Window, implicitely calling the constructor Windows.push_back(*A); // Adding object A to the vectors Window *B = new Window(...); // New instantiation Windows.push_back(*B); // Adding object B to the vectors The bug was here: when I pushed back the second object (B), the memory manager decided to reallocate the vectors, because vectors must be contiguous. Doing so implicitely called the destructor of the first object; the window A disappeared. Possible solutions Reserve memory for the vectors Wind...

MIDI dump of Yamaha TX816

Abstract I own two Yamaha TX816 and I need to dump and reorganize the patches. My computer runs on Ubuntu 24.04, the MIDI interface is E-MU XMIDI 1X1. Part 1 - dumping Using Bladesk Librarian A fantastic librarian working directly in your browser: https://bladesk.github.io/DX7II-Librarian/ . It works well with my Yamaha DX7 MK1, but failed to receive dumps from the TX816. Using ALSA command amidi This simple command comes with ALSA and runs into a terminal (CTRL+ALT+T to open a terminal). QJackCtl must be installed first: $ sudo apt install qjackctl $ amidi -l Dir Device Name IO hw:2,0,0 E-MU XMidi1X1 Midi In $ amidi --port=hw:2,0,0 --receive=TX816B-module1.syx cannot open port "hw:2,0,0": Device or resource busy What's going on? First, let's check the system calls: $ sudo strace amidi --port=hw:2,0,0 --receive=TX816B-module1.syx ... openat(AT_FDCWD, "/dev/snd/controlC2", O_RDWR|O_CLOEXEC) = 4 ioctl(4, SNDRV_CTL_IOCTL_PVERSION, 0x7f...

Update to Ubuntu 24.04

After years running Ubuntu 20.04, I recently (January 2025) installed Ubuntu 24.04 Noble Numbat. This cames with few improvements and a couple of disappointments, mainly the lost of my dual-screen: my graphic card, Nvidia Quadro FX3700, is not supported anymore by the latest driver. The result is: when the computer boots up, it does on output 0 (right screen). But as soon as Wayland starts, it switches to output 1 (left screen), ignoring the other output; my right screen remains black. This is a new behavior, it works fine on 20.04. Keyboard I write mainly in French and English. My keyboard is US Qwerty with US International layout. In English, what I see on keyboard is what I get on screen. In French, the diacritics are obtained with compositional keys: To get Ubuntu 20 Ubuntu 24 á é í ó ú ý Á É Í Ó Ú Ý ' e (Quote letter) ' E (Quote shift+letter) à è ...

Quickly sorting resistors

How to sort a batch of resistors? I received a batch of about 200 resistors from the E24 serie (3 bands) that I want to sort. Here is a solution for a quick sort: Make a first sort according to the multiplier coefficient This is usually the 3rd band, but maybe the 4th or 5th for the E48 or E96 series. For this value, we find the following colors: black = × 10⁰ = × 1 brown = × 10¹ = × 10 red = × 10² = × 100 orange = × 10³ = × 1000 (× 1k) yellow = × 10⁴ = × 10,000 (× 10k) green = × 10⁵ = × 100,000 (× 100k) blue = × 10⁶ = × 1,000,000 (× 1M) purple = × 10⁷ = × 10,000,000 (× 10M) gray = × 10⁸ = × 100,000,000 (× 100M) white = × 10⁹ = × 1,000,000,000 (× 1G) I ended up with 5 piles, having no value beyond 1M. Make a second sort according to the first band black = 0 brown = 1 red = 2 orange = 3 yellow = 4 green = 5 blue = 6 purple = 7 gray = 8 white = 9 Each pile was divided into 10 sub-heaps, with more or less items in each (sometimes...

Fake voltage regulators

Repairing a symmetric regulated power supply A great find on the sidewalk I was walking down the sidewalk when I came across an abandoned power supply and a bag full of components in front of an antique store. The dealer told me that the device does not work. One might wonder why he left it on the sidewalk in this case... Anyway, I grabbed the whole. (note: the pictures below were taken after the fix). On first inspection, it's a well built DIY creation. Solid folded aluminum housing, all cables tie-wrapped, voltage regulators mounted on generous heat-sinks with all the fittings. The only complain would be on the big capacitors; usually, they are glued on the PCB to avoid humming. However, we see the project was never completed, since the digital voltmeter (DVM) is not connected internally. Also, withing the components in the bag was another voltage regulator, a LM317K in a TO-3 package. First test After a more in-depth inspection (transformer, fuse,...

My journey with ATTiny4313 (part 6)

Part 6: Debugging Bugs are everywehere... Simulating MO44.DRV During my journey, I used my Atari with Cubase and the driver MO44.DRV. However, since my prototype is not yet recognized by the driver, my testing ability is limited. To overcome this issue, I decided to use another ATTiny to simulate the driver. I wrote a quick program (simulmo4) and checked the result with Saleae Logic. Great, exactly what I wanted! Slowing down the simulation My simulator was too fast for an easy debugging. So I decided to slow it down in 2 ways: By setting the CKDIV8 fuse (divide clock by 8) using this link https://www.engbedded.com/fusecalc/ By setting the CLKPR register (clock prescaler) to 00000011 (prescaler division factor = 8, cf. datasheet page 33) .equ PRESCALER, 0x03 ... ; --------------------------------- ; Configuration of system clock prescaler ; --------------------------------- ldi r16, (1<<CLKPCE) STORE CLKPR, r16 ; Permit c...