Hi people,

Yesterday I wrote a small C program (~400 lines) to generate macros for 
the abc preprocessor *abcpp* <http://abcplus.sourceforge.net/#abcpp>.

It is intended to make easier write microtonal music. However, I think 
it can be useful also for percussion instruments and perhaps even for 
tablatures.

These are the steps:
0) Write a setup file to set the macros.
1) Generate the macros to an .abh file (abcpp header with macros).
2) Write the ABC music using the macros, after #include the .abh file.
3) Preprocess the ABC file.
4) Convert the ABC to MIDI.
5) Retune the MIDI file with scala <http://www.xs4all.nl/~huygensf/scala/>.


To test the program, I used an arrangement of a Christmas carol by Heinz 
Bohlen, from: <http://members.aol.com/bpsite/tonality.html> 
(<http://members.aol.com/bpsite/EskommteinSchiff.jpg>).

Here is the setup file:

{-----------------------------}
centre:60       {MIDI number for the pitch 0}
mod:13          {number of degrees for each modulo instance}
transp:-6       {transposition}
range:-30 30    {range relative to the center pitch}
alias:1 2       {use the columns 1 and 2 (nr from 0) to generate macros}
updown: ' ,     {additional symbols for high and low pitches}

{Bohlen-Pierce (BP) scale using i-gamma names}
   0:  i
   1:  l
   2:  lis  mes
   3:  m
   4:  n
   5:  nis  os
   6:  o
   7:  r
   8:  s
   9:  sis  tes
  10:  t
  11:  tis  us
  12:  u
{}
{-----------------------------}


Here are the auto-generated macros (BP to ABC):

# ===================={  BEGIN OF DEFINITIONS
#define {s,} ^C,
#define {sis,} =D,
#define {tes,} =D,
#define {t,} ^D,
#define {tis,} =E,
#define {us,} =E,
#define {u,} =F,
#define {i} ^F,
#define {l} =G,
#define {lis} ^G,
#define {mes} ^G,
#define {m} =A,
#define {n} ^A,
#define {nis} =B,
#define {os} =B,
#define {o} =C
#define {r} ^C
#define {s} =D
#define {sis} ^D
#define {tes} ^D
#define {t} =E
#define {tis} =F
#define {us} =F
#define {u} ^F
#define {i'} =G
#define {l'} ^G
#define {lis'} =A
#define {mes'} =A
#define {m'} ^A
#define {n'} =B
#define {nis'} =c
#define {os'} =c
#define {o'} ^c
#define {r'} =d
#define {s'} ^d
# ====================}   END OF DEFINITIONS  (TOTAL: 35)


Here is the original ABC code (with macros):

#include "mapa-bp.abh"

X:1
T:s-delta
T:Fassung 1
C:Arr.: Heinz Bohlen
R:carol
M:3/4
L:1/4
Q:1/4=90
K:C
%
V:1
%%MIDI program 71 % Clarinet
%%MIDI beat 90 85 85 1
{s} | {s}2 {s} | {us}2 {us} |
{l'} {n'} {os'} | {os'}2 {os'} | {us}2 {us} |
{s}2 {us} | [M:C] {l'}3 {l'} | {os'}{r'}{s'}{s'} |
{r'}/{os'}/{n'}/{mes'}/ {l'} {us} | {l'} {us} {us} {tes} | {s}3 ||
V:2
%%MIDI program 70 % Bassoon
%%MIDI beat 90 85 85 1
{s,} | {s,}2 {s,} | {s,}2 {s,} |
{s,} {us,} {l} | {l}2 {l} | {n}2 {n} |
{s}2 {r} | [M:C] {os}3 {os} | {l} {us,} {s,} {l} |
{us,}2 {s,} {n} | {l} {us} {s} {r} | {s}3 ||


And, finally, the output ABC code (after substituting the macros):

X:1
T:s-delta
T:Fassung 1
C:Arr.: Heinz Bohlen
R:carol
M:3/4
L:1/4
Q:1/4=90
K:C
%
V:1
%%MIDI program 71 % Clarinet
%%MIDI beat 90 85 85 1
=D | =D2 =D | =F2 =F |
^G =B =c | =c2 =c | =F2 =F |
=D2 =F | [M:C] ^G3 ^G | =c=d^d^d |
=d/=c/=B/=A/ ^G =F | ^G =F =F ^D | =D3 ||
V:2
%%MIDI program 70 % Bassoon
%%MIDI beat 90 85 85 1
^C, | ^C,2 ^C, | ^C,2 ^C, |
^C, =E, =G, | =G,2 =G, | ^A,2 ^A, |
=D2 ^C | [M:C] =B,3 =B, | =G, =E, ^C, =G, |
=E,2 ^C, ^A, | =G, =F =D ^C | =D3 ||


The scala commands to retune the MIDI file are:

equaltemp 13 3
example/midi in.mid out.mid


Shortly I will put the program online.


Cheers,
Hudson


-- 
Hudson Lacerda <http://geocities.yahoo.com.br/hfmlacerda/>
*Não deixe seu voto sumir! http://www.votoseguro.org/
*Apóie o Manifesto:        http://www.votoseguro.com/alertaprofessores/

                     == THE WAR IN IRAQ COSTS ==
http://nationalpriorities.org/index.php?option=com_wrapper&Itemid=182

        

        
                
_______________________________________________________ 
Yahoo! doce lar. Faça do Yahoo! sua homepage. 
http://br.yahoo.com/homepageset.html 



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/abcusers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to