Archive for

July, 2017


DIY passive audio mixer

Comments Off

In previous posts, I’ve mentioned my TB-03 synthesizer and TR-8 drum machine. While both offer analog audio input and output to chain the sound, it gets tricky when trying to record since there are multiple volume nobs essentially daisy-chained. Adding even more devices breaks down the whole setup.

So I needed a simple audio mixer, and decided to put together something myself. The only requirement was to adjust the volume of the stereo out of each device, and mix it together into one signal. A simple solution adds a potentiometer on each input line (right and left), and combines each line down to one output. I used 10k ohm dual logarithmic rotary potentiometers (which I found at a local electronics shop – which means they’re probably quite old). The input and output connectors are all stereo mini-jack.

As the pictures show, it’s a simple small box, with four inputs, four rotary knobs, and one output. I liked the knobs, however, had wished they could be flush with the surface of the box. They were not made for the potentiometers I got, and it took some Dremel work to make them fit at all. The wiring got a bit messy, and combined dual or even three wire would have made it look better on the inside.

The mixer and volume adjustment work, however, I’m not sure if 10k ohm is enough to adjust the devices. It is not enough to mute the sound. This article suggest adding a 1k resistor in series, which I might try later. It would also be interesting to see at what resistance level the sound is completely muted. Other implementations connects the third pin of the potentiometer to ground from the input. In my box, all ground wires from all inputs and output are combined directly, which I’m not sure if is correct.

Oh, and as can be seen, there’s no scale to indicate the setting of each knob. These can all go to 11 if you like!

Comments Off

Hello World with Qt 5

Comments Off

Getting started with Qt development is rather easy. As with other C++ development discussed earlier, all tools and libraries are native in the Debian / Ubuntu repositories. The following packages should take care of the basic setup:

apt-get install gcc g++ gdb cmake make build-essential qtcreator qt5-default qtdeclarative5-dev qt5-doc qt5-doc-html qtbase5-doc-html qtbase5-examples

Once installed, this small “Hello World” example, inspired by this tutorial but updated for Qt 5, will verify that everything is setup correctly.

Notice that it is important that this file has the extension .cpp, e.g. helloworld.cpp.

#include <QtWidgets/QApplication>
#include <QtWidgets/QPushButton>

int main( int argc, char **argv ) {
  QApplication a( argc, argv );

  QPushButton hello( "Hello world!", 0 );
  hello.resize( 100, 30 );;
  return a.exec();

Once this file is in place, a Qt .pro project must be generated. (This should only be executed once, to generate the file).

qmake -project

It will create a file based on the name of the current directory, with the extension .pro. Edit the file to include the following two lines:

QT += core gui
QT += widgets

If backwards compatibility with older Qt versions is a concern, change the last line to:

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

Now, the application can be compiled and linked into a binary:

qmake && make && ./helloworld

It should generate a Makefile, make or compile the source code, and start the binary. If everything works out, a new application window with a small button like below will appear.

Comments Off

Review: “The New Tsar: The Rise and Reign of Vladimir Putin”, Steven Lee Myers

Comments Off

Lee Myers’ book is a fascinating and detailed biography of Putin’s life; from early childhood in a poor family in St. Petersburg; as a low level KGB officer; a loyal adviser of the St. Petersburg major Sobchak in the early 90s; and then suddenly and unexpectedly as first prime minister and then president of Russia at the turn of the century. The story includes detailed political and personal events up until the annexation of Crimea in 2014. Lee Myers balances the personal anecdotes, which give glimpses of Putin’s character, with overall political history and background. Throughout, all is very well researched and referenced, with the list of references taking up some fifty pages of a five hundred pages book.

Although some of the sources are clearly biased, as they come from stories told by Putin himself, his wife, or other loyal to Putin, Lee Myers paints a picture of Putin as extremely hard working, determined and goal oriented. Clearly, his unquestioning loyalty was something which got him forward in his early political career in the 1990s. Later on, and especially as president, he has expected the same unquestioning loyalty and servitude from his subordinates and even business interests. Where there has been opposition and resistance, it has been crushed decisively and sometimes brutally, including assassinations and other KGB style methods.

Putin’s upbringing and early life in Soviet Russia and background in the KGB, and also briefly as director of its reincarnation FSB, is a central part of his character, and still shapes his presidency and politics today. The US and the West is still seen as the enemy or at least opposition of Russia, and the politics and wars in Eastern Europe, Yugoslavia; Chechnya; Ukraine; Crimea, as well as the Middle East; Iraq; Afghanistan; Syria must be seen in this light. Thus it becomes clear why Russia is against the Americans in Syria: It is not to support Bashar al-Assad, but rather to avoid American forces on the footsteps of Russia, and furthermore to keep their naval base in the Mediterranean sea at Tartus at the east coast of Syria.

Lee Myers’ book ends in 2014, but hints at the next milestone in Russian politics: The upcoming presidential election in 2018, where Putin legally can sit a second term (which overall would be his fourth term). If he does, it means he will rule until 2024, since he extended the presidential term from four to six years while prime minister under Medvedev in 2011.

Most interesting

As mentioned, Lee Myers’ book is fascinating and a page turner, which is a good achievement when writing about politics. The blend between political and historical events, and personal anecdotes make it entertaining, and also something to quote. Personal favorites include the story from the business meeting between Putin and US business leaders, among them Robert Kraft, owner of the New England Patriots football team. He showed Putin his Super Bowl ring, who understood it as a gift, and put it in his pocket. Mr. Kraft was forced to announce it as a gift to avoid at diplomatic embarrassment.

Understanding Putin’s Russia goes a long way to explain many key world events and decisions over the last decades. Given that it looks like he will be at the head for another seven years, for almost quarter of a century in total, his reign will shape world affairs for decades to come.

Comments Off