view oldchsool/musa.pl @ 71:a87eb778f225

Improvements to the MinGW crossbuild. Should now build with default tools from Debian mingw packages, though you need Win32 version of libSDL with the necessary headers and so on in addition. 64-bit builds not tested and probably won't work. Tested on Debian 7.0, earlier won't work. binutils-mingw-w64-i686 gcc-mingw-w64-i686 mingw-w64-i686-dev
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Aug 2012 03:08:10 +0300
parents acb5694e93d9
children
line wrap: on
line source

#!/usr/bin/perl
##!/opt/bin/perl5

sub End
{
   print "5\n";
}

sub Wait
{
   my($howlong)=@_;
   print "6,$howlong,\n";
}

sub Seq
{
   my($seqno,$seqdata)=@_;
   my($seqstr)='';
   my($lgt)=0;

   foreach(split('',$seqdata))
   {
         if($_ eq ',') { $seqstr.='255,'; }
      elsif($_ eq '.') { $seqstr.='254,'; }
      else             { $seqstr.=$_.','; }
      $lgt++;
   }

   print $seqno.','.$lgt.','.$seqstr."\n";
}

sub Notes
{
   print '4,'.($#_+1),',';

   foreach(@_) { print $_,','; }
   print "\n";
}

sub Bases
{
   print '7,';
   for($i=0;$i<3;$i++) { print $_[$i],','; }
   print "\n";
}

#   1   3       6   8   10 
# c   d   e   f   g   a   b   c
# 0   2   4   5   7   9   11  12

Bases(36,24,12);

Seq(0,'.');
#Seq(1,  '0.1.2.0.0.1.2.0.3.3.3.3.30313032');
Seq(2, '0.0.0,,.0.0.0,,.0.0.0,,.1,,.0,,.');
Seq (1, '0.1.2.0.0.1.2.0.3031303230123032');
#Seq(1,  '0.1.2.0.0.1.2.0.2010201030123032');

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Seq(0,'3.0.3.0.30313031');
Wait(16);

#########

Seq(0, '3.0.1.2.3...0...3.0.1.2.3.2.3.2.'.
       '3.0.1.2.3...0.3.2...3...1.2.3.0.'.
       '3.0.1.2.3...0...3.0.1.2.3.2.3.2.'.
       '3.0.1.2.3.0.1.2.3.0.3.1.0...3,,2'
);

#Seq(0, '3.0.1.0.3.0.1.2.3.0.1.2.3...1...');
#Seq(0 , '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,');
#Seq(0, '3.0.1.2.3.0.1.2.3.0.2.0.1.0.1.2.');
#Seq(0, '0.0.1.2.0.2.1.2.0.2.1.2.0.2.1.2.');
#Seq(0, '0.0.2.0.1.2.0.2.0.0.2.0.1.2.1.2.');
Seq(1,  '0.1.2.0.0.1.2.0.2010201030123032');
#'0.0.0.0.1.2.1.2.');
Seq(2, '0.0.0,,.0.0.0,,.0.0.0,,.1,,.0,,.');


#Seq(0, '3.0.1.2.3...0...3.0.1.2.3.2.3.2.'.
#       '3.0.1.2.3...0.3.2...3...1.2.3.0.'.
#       '3.0.1.2.3...0...3.0.1.2.3.2.3.2.'.
#       '3.0.1.2.3.0.1.2.3.0.3.1.0...3,,2'
#);
#Seq(1,  '0.1.2.0.0.1.2.0.2010201030123032');

#Seq(0, '3.0.1.0.3.0.1.2.3.0.1.2.3...1...');
#Seq(0 , '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,');
#Seq(0, '3.0.1.2.3.0.1.2.3.0.2.0.1.0.1.2.');
#Seq(0, '0.0.1.2.0.2.1.2.0.2.1.2.0.2.1.2.');
#Seq(0, '0.0.2.0.1.2.0.2.0.0.2.0.1.2.1.2.');
#'0.0.0.0.1.2.1.2.');

Bases(36,24,12);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Bases(36+5,24+5,12+5);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);


##############

Seq(0,'.');

Bases(36,24,12);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Seq(0,'3.0.3.0.30313031');
Wait(16);

##############

#Seq(0, '3.0.1.0.3.0.1.2.3.0.1.2.3...1...');

#Seq(0 , '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,'.
#        '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,'.
#        '0.0.1.0.2,..3...0,,,1.2.1.3.0.3,'. 
#        '0.0.1.0.2,,.3...0,,,1.2.0.123231');

Seq(0, '3.0.1.2.3.3.0...3...1...3.2.3.2.'.
       '3.0.1.2.3.3.0.1.2...3...1.2.3.0.'.
       '3.0.1.2.3.3.0...3...1.2.3.2.3.2.'.
       '3.0.1.2.3.3.0.1.3...3.1.0...3,,2'
);
#Seq(2, '0,,.0,,.0,,.0.0.0,,.0,,.0,,.1.2.');
#
Seq(2, '0.0.0,,.0.0.0,,.0.0.0,,.1,,.0,,.');
#Seq(1, '0...0.2.0...0.1.0.2.0.1.0.2.0.1.'.
#       '0...0.2.0...0.1.0.2.0.1.0...3.3.');
Seq (1, '0.1.2.0.0.1.2.0.3031303230123032');

#Seq(0, '3.0.1.2.3.0.1.2.3.0.2.0.1.0.1.2.');
#Seq(0, '0.0.1.2.0.2.1.2.0.2.1.2.0.2.1.2.');
#Seq(0, '0.0.2.0.1.2.0.2.0.0.2.0.1.2.1.2.');

Bases(36,24,12);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);


Bases(36+5,24+5,12+5);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Seq(0,'.');

Bases(36,24,12);




Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Seq(0,'3.0.3.0.30313031');
Wait(16);


##############

#Seq(0, '3.0.1.0.3.0.1.2.3.0.1.2.3...1...');

#Seq(0 , '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,'.
#        '0.0.1.0.2,..3...0,,,1.2.1.2.3.0,'.
#        '0.0.1.0.2,..3...0,,,1.2.1.3.0.3,'. 
#        '0.0.1.0.2,,.3...0,,,1.2.0.123231');

Seq(0, '3.0.1.2.3.3.0...3...1...3.2.3.2.'.
       '3.0.1.2.3.3.0.1.2...3...1.2.3.0.'.
       '3.0.1.2.3.3.0...3...1.2.3.2.3.2.'.
       '3.0.1.2.3.3.0.1.3...3.1.0...3,,2'
);
#Seq(2, '0,,.0,,.0,,.0.0.0,,.0,,.0,,.1.2.');
#
Seq(2, '0.0.0,,.0.0.0,,.0.0.0,,.1,,.0,,.');
#Seq(1, '0...0.2.0...0.1.0.2.0.1.0.2.0.1.'.
#       '0...0.2.0...0.1.0.2.0.1.0...3.3.');
Seq (1, '0.1.2.0.0.1.2.0.3031303230123032');

#Seq(0, '3.0.1.2.3.0.1.2.3.0.2.0.1.0.1.2.');
#Seq(0, '0.0.1.2.0.2.1.2.0.2.1.2.0.2.1.2.');
#Seq(0, '0.0.2.0.1.2.0.2.0.0.2.0.1.2.1.2.');

Bases(36,24,12);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

Bases(36+3,24+3,12+3);

Notes(0,3,7,12);
Wait(16);
Notes(3,7,10,12+3);
Wait(16);
Notes(2,5,9,14);
Wait(16);
Notes(0,3,7,12);
Wait(16);

#Notes(0,3,7,12);
#Wait(16);
#Notes(3,7,10,12+3);
#Wait(16);
#Notes(2,5,9,14);
#Wait(16);
#Notes(0,3,7,12);
#Wait(16);
#
#Notes(0,3,7,12);
#Wait(16);
#Notes(3,7,10,12+3);
#Wait(16);
#Notes(2,5,9,14);
#Wait(16);
#Notes(0,3,7,12);
#Wait(16);

###########################

Seq(0,'.');
Seq(1,'.');
Seq(2,'.');
Wait(64);

#####

Seq(0,'0.0.0.0.1.2.3.2.0.0.0.0.2...0...'.
      '1.1.1.1.0.3.2.3.1.1.1.1.0...1.0.');
Seq(1,'0.1.2.3.2.1.0.1.2.3.2.1.0.1.2.3.');
Seq(2,'0,,.0,,.0,,.1,,.0,,.0,,.0,,.2,,.');

Bases(36,24,12);

Notes(0,3,7,12);
Wait(48);
Notes(3,7,10,12+3);
Wait(16);

Notes(0,3,7,12);
Wait(48);
Notes(3,7,10,12+3);
Wait(16);

Bases(36+3,24+3,12+3);

Notes(0,3,7,12);
Wait(48);
Notes(3,7,10,12+3);
Wait(16);

Seq(0,'0.0.0.0.1.2.3.2.0.0.0.0.2...0...'.
      '1.1.1.1.0.3.2.3.1.1.1.1.0.3.2.0.');

Notes(0,3,7,12);
Wait(48);
Notes(3,7,10,12+3);
Wait(10);

#Seq(0,'.');
Seq(1,'.');
Seq(2,'.');

Wait(6);
Seq(0,'.');

Wait(128);

End;