Console - richardjwild/arctracker GitHub Wiki

Arctracker has a --pianola option switch that, when enabled, prints out the patterns to the console as they are played, like this:

$ ./arctracker --pianola ../modfiles/cream.trk 
File is TRACKER format.
Module name: cream of the earth
Author: Converted From Amiga
 0  0 | E-1 AH1E | --- -000 | E-1 9H1E | --- -S07 | 
 0  1 | --- -H1E | --- -000 | --- 9H1E | --- -000 | 
 0  2 | --- AH1E | --- -000 | --- 9H1E | --- -000 | 
 0  3 | --- AH1E | --- -000 | --- 9H1E | --- -000 | 
 0  4 | --- -H1E | --- -000 | --- 9H1E | --- -000 | 
 0  5 | --- AH1E | --- -000 | --- 9H1E | --- -000 | 
 0  6 | --- -H1E | --- -000 | --- 9H1E | --- -000 | 
 0  7 | --- AH1E | --- -000 | --- 9H1E | --- -000 | 
 0  8 | D-1 AH1E | --- -000 | --- 9H1E | --- -000 | 
 0  9 | --- -H1E | --- -000 | --- 9H1E | --- -000 |

If the option is not enabled, it simply prints the current position in the song sequence as it plays:

$ ./arctracker ../modfiles/cream.trk 
File is TRACKER format.
Module name: cream of the earth
Author: Converted From Amiga
Playing position 3 of 27

I had the thought that I would put the code that prints the patterns into a module of its own, so I created a compilation unit called pianola.c and moved the relevant code into it. This usefully cut some code from play_mod.c. However, in my very next commit I decided to rename the compilation unit to console.c because after surveying what was left in play_mod.c I found I wanted to move the position indicator into there as well. In the next commit I moved that into console.c. Finally, a bit of reformatting and this small job was done.

Previous: Separating the Formats I | Next: Bits and Bytes