File: sfitem.h

package info (click to toggle)
awesfx 0.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 784 kB
  • sloc: ansic: 6,532; sh: 56; makefile: 48
file content (85 lines) | stat: -rw-r--r-- 2,492 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*================================================================
 * sfitem.h
 *	soundfont generator conversion table
 *
 * Copyright (C) 1996-1999 Takashi Iwai
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *================================================================*/

#ifndef SFITEM_H_DEF
#define SFITEM_H_DEF

#include "sflayer.h"
#include "sffile.h"

typedef struct _LayerItem {
	int copy;	/* copy policy */
	int type;	/* conversion type */
	int minv;	/* minimum value */
	int maxv;	/* maximum value */
	int defv;	/* default value */
} LayerItem;

/* copy policy */
enum {
	L_INHRT,	/* add to global */
	L_OVWRT,	/* overwrite on global */
	L_RANGE,	/* range */
	L_PRSET,	/* preset only */
	L_INSTR,	/* instrument only */
};

/* data type */
enum {
	T_NOP,		/* nothing */
	T_NOCONV,	/* no conversion */
	T_OFFSET,	/* address offset */
	T_HI_OFF,	/* address coarse offset (32k) */
	T_RANGE,	/* range; composite values (0-127/0-127) */

	T_CUTOFF,	/* initial cutoff */
	T_FILTERQ,	/* initial resonance */
	T_TENPCT,	/* effects send */
	T_PANPOS,	/* panning position */
	T_ATTEN,	/* initial attenuation */
	T_SCALE,	/* scale tuning */

	T_TIME,		/* envelope/LFO time */
	T_TM_KEY,	/* time change per key */
	T_FREQ,		/* LFO frequency */
	T_PSHIFT,	/* env/LFO pitch shift */
	T_CSHIFT,	/* env/LFO cutoff shift */
	T_TREMOLO,	/* LFO tremolo shift */
	T_MODSUST,	/* modulation env sustain level */
	T_VOLSUST,	/* volume env sustain level */

	T_EOT,		/* end of type */
};

/* sbk->sf2 convertor function */
typedef int (*SBKConv)(int gen, int amount);

/* macros for range operation */
#define RANGE(lo,hi)	(((hi)&0xff) << 8 | ((lo)&0xff))
#define LOWNUM(val)	((val) & 0xff)
#define HIGHNUM(val)	(((val) >> 8) & 0xff)

/* layer type definitions */
extern LayerItem layer_items[SF_EOF];

int sbk_to_sf2(int oper, int amount);

#endif