Blog

 

Absurdistanian ISP (morse; 2010/preec/Q): generator

morse_gen by Tibor 'Igor2' Palinkas on 2021-03-12

Tags: 2010, preec, 2010preec, generator, sound, signal, morse

node source

 

 

Abstract: n/a

 

Datasheet

Task Absurdistanian ISP (morse)
When 2010 preec Q
Description html
Input pack zip

Generator

Because we had a wav task in the EC, we had to have one in the preec to prepare teams for loading wav files and processing sound. We wanted to make a task that is easy yet fun to solve. We choose decoding morse.

Since it's preec only and the task is trivial, we did not have a solver for it, only a generator . It starts with an shell script (most an AWK script), generator/morse.sh, which converts plain text read on stdin to morse code, dots and dashes on stdout.

The next step is generator/gen.c which converts this to raw 8 bit sound, reading morse on stdin, writing 8 bit data in decimal format to stdout. wave.[ch] are the very same files used in the generator of the wav task we did for the EC the same year.

Then num2raw (also copied from the EC task) converted this into raw binary and finally we used sox to convert the raw binary into wav.

The whole process is coordinated by the Makefile in inputs/. Before running make there, run make in gen/.

The rationale for such a long chain of filters is: easier debugging, alternative use of tools (different generators that did not end up in the final task), reuse (that's how the wave generator part is shared between the preec and ec task).

The generator is Copyright (C) 2010 Tibor 'Igor2' Palinkas and is licensed under the GNU GPL version 2.