1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 
5 #include "general.h"
6 #include "fileoutput.h"
7 
8 /*
9 
10 Ringtonetools - Copyright 2001-2005 Michael Kohn (mike@mikekohn.net)
11 This falls under the Kohnian license.  Please read
12 it at http://ringtonetools.mikekohn.net/
13 
14 This program is NOT opensourced.  You may not use any part
15 of this program for your own software.
16 
17 */
18 
19 /* 3210 */
20 
write_3210_header(FILE * out,struct note_t * note)21 void write_3210_header(FILE *out, struct note_t *note)
22 {
23   if (note->songname[0]==0)
24   { strcpy(note->songname,"unamed"); }
25 
26   fprintf(out,"%s:Tempo=%d\n",note->songname,note->bpm);
27 }
28 
write_3210_note(FILE * out,struct note_t * note)29 void write_3210_note(FILE *out, struct note_t *note)
30 {
31   if (note->note_count>0) fprintf(out," ");
32 
33   fprintf(out,"%d",(1<<(note->length)));
34 
35   if (note->modifier!=0) fprintf(out,".");
36 
37   if (note->tone==0) fprintf(out,"-");
38     else
39   if (note->tone==1) fprintf(out,"c");
40     else
41   if (note->tone==2) fprintf(out,"#c");
42     else
43   if (note->tone==3) fprintf(out,"d");
44     else
45   if (note->tone==4) fprintf(out,"#d");
46     else
47   if (note->tone==5) fprintf(out,"e");
48     else
49   if (note->tone==6) fprintf(out,"f");
50     else
51   if (note->tone==7) fprintf(out,"#f");
52     else
53   if (note->tone==8) fprintf(out,"g");
54     else
55   if (note->tone==9) fprintf(out,"#g");
56     else
57   if (note->tone==10) fprintf(out,"a");
58     else
59   if (note->tone==11) fprintf(out,"#a");
60     else
61   if (note->tone==12) fprintf(out,"b");
62  /* if (note->tone==12) fprintf(out,"h"); */
63 
64   if (note->tone!=0)
65   {
66     fprintf(out,"%d",note->scale+1);
67   }
68 }
69 
write_3210_footer(FILE * out,struct note_t * note)70 void write_3210_footer(FILE *out, struct note_t *note)
71 {
72   fprintf(out,"\n");
73 }
74 
75