source: buchla-68k/orig/BUCHLA/RIFFTMPO.C@ f806726

Last change on this file since f806726 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 1.1 KB
Line 
1/*
2 =============================================================================
3 rifftmpo.c -- calculate the Thunder riff tempo multiplier table
4 Version 1 -- 1989-01-25 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stdio.h"
9#include "stddefs.h"
10
11#define RTFILE "rifftmpo.dat"
12
13double rate[19][2] = {
14
15 {8.0, 1.0},
16 {5.0, 1.0},
17 {4.0, 1.0},
18 {3.0, 1.0},
19 {5.0, 2.0},
20 {2.0, 1.0},
21 {5.0, 3.0},
22 {3.0, 2.0},
23 {4.0, 3.0},
24 {1.0, 1.0},
25 {3.0, 4.0},
26 {2.0, 3.0},
27 {3.0, 5.0},
28 {1.0, 2.0},
29 {2.0, 5.0},
30 {1.0, 3.0},
31 {1.0, 4.0},
32 {1.0, 5.0},
33 {1.0, 8.0}
34};
35
36/*
37
38*/
39
40main()
41{
42 register int i, ri;
43 double rt;
44
45 FILE *fp;
46
47 if ((FILE *)NULL EQ (fp = fopen(RTFILE, "w"))) {
48
49 printf("ERROR: Unable to open \"%s\" for output\n", RTFILE);
50 exit(1);
51 }
52
53 for (i = 0; i < 19; i++) {
54
55 rt = rate[i][0] / rate[i][1];
56 ri = (int)(rt * 1000.0);
57
58 fprintf(fp, "\tDATA >%04.4x\t; %d/%d %6.4f %4d %2d\n",
59 0xFFFF & ri, (int)rate[i][0], (int)rate[i][1],
60 rt, 0xFFFF & ri, i);
61 }
62
63 fclose(fp);
64 exit(0);
65}
Note: See TracBrowser for help on using the repository browser.