1 /*---------------------------------------------------------------------------*
2   Project:  NintendoWare
3   File:     snd_MmlCommand.h
4 
5   Copyright (C)2009-2011 Nintendo/HAL Laboratory, Inc.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain proprietary
8   information of Nintendo and/or its licensed developers and are protected by
9   national and international copyright laws. They may not be disclosed to third
10   parties or copied or duplicated in any form, in whole or in part, without the
11   prior written consent of Nintendo.
12 
13   The content herein is highly confidential and should be handled accordingly.
14 
15   $Revision: 31311 $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef NW_SND_MML_COMMAND_H_
19 #define NW_SND_MML_COMMAND_H_
20 
21 namespace nw {
22 namespace snd {
23 namespace internal {
24 namespace driver {
25 
26 class MmlCommand
27 {
28 public:
29 
30     enum Mml
31     {
32         // 可変長パラメータコマンド
33         MML_WAIT            = 0x80,
34         MML_PRG             = 0x81,
35 
36         // 制御コマンド
37         MML_OPEN_TRACK      = 0x88,
38         MML_JUMP            = 0x89,
39         MML_CALL            = 0x8a,
40 
41         // 接頭コマンド
42         MML_RANDOM          = 0xa0,
43         MML_VARIABLE        = 0xa1,
44         MML_IF              = 0xa2,
45         MML_TIME            = 0xa3,
46         MML_TIME_RANDOM     = 0xa4,
47         MML_TIME_VARIABLE   = 0xa5,
48 
49         // u8パラメータコマンド
50         MML_TIMEBASE        = 0xb0,
51         MML_ENV_HOLD        = 0xb1,
52         MML_MONOPHONIC      = 0xb2,
53         MML_VELOCITY_RANGE  = 0xb3,
54         MML_BIQUAD_TYPE     = 0xb4,
55         MML_BIQUAD_VALUE    = 0xb5,
56         MML_BANK_SELECT     = 0xb6,
57         MML_FRONT_BYPASS    = 0xbf,  // おそらく CTR 専用
58         MML_PAN             = 0xc0,
59         MML_VOLUME          = 0xc1,
60         MML_MAIN_VOLUME     = 0xc2,
61         MML_TRANSPOSE       = 0xc3,
62         MML_PITCH_BEND      = 0xc4,
63         MML_BEND_RANGE      = 0xc5,
64         MML_PRIO            = 0xc6,
65         MML_NOTE_WAIT       = 0xc7,
66         MML_TIE             = 0xc8,
67         MML_PORTA           = 0xc9,
68         MML_MOD_DEPTH       = 0xca,
69         MML_MOD_SPEED       = 0xcb,
70         MML_MOD_TYPE        = 0xcc,
71         MML_MOD_RANGE       = 0xcd,
72         MML_PORTA_SW        = 0xce,
73         MML_PORTA_TIME      = 0xcf,
74         MML_ATTACK          = 0xd0,
75         MML_DECAY           = 0xd1,
76         MML_SUSTAIN         = 0xd2,
77         MML_RELEASE         = 0xd3,
78         MML_LOOP_START      = 0xd4,
79         MML_VOLUME2         = 0xd5,
80         MML_PRINTVAR        = 0xd6,
81         MML_SURROUND_PAN    = 0xd7,
82         MML_LPF_CUTOFF      = 0xd8,
83         MML_FXSEND_A        = 0xd9,
84         MML_FXSEND_B        = 0xda,
85         MML_MAINSEND        = 0xdb,
86         MML_INIT_PAN        = 0xdc,
87         MML_MUTE            = 0xdd,
88 #ifdef NW_PLATFORM_RVL
89         MML_FXSEND_C        = 0xde,
90 #endif
91         MML_DAMPER          = 0xdf,
92 
93         // s16パラメータコマンド
94         MML_MOD_DELAY       = 0xe0,
95         MML_TEMPO           = 0xe1,
96         MML_SWEEP_PITCH     = 0xe3,
97 
98         // 拡張コマンド
99         MML_EX_COMMAND      = 0xf0,
100 
101         // その他
102         MML_ENV_RESET       = 0xfb,
103         MML_LOOP_END        = 0xfc,
104         MML_RET             = 0xfd,
105         MML_ALLOC_TRACK     = 0xfe,
106         MML_FIN             = 0xff
107     };
108 
109     enum MmlEx
110     {
111         MML_SETVAR          = 0x80,
112         MML_ADDVAR          = 0x81,
113         MML_SUBVAR          = 0x82,
114         MML_MULVAR          = 0x83,
115         MML_DIVVAR          = 0x84,
116         MML_SHIFTVAR        = 0x85,
117         MML_RANDVAR         = 0x86,
118         MML_ANDVAR          = 0x87,
119         MML_ORVAR           = 0x88,
120         MML_XORVAR          = 0x89,
121         MML_NOTVAR          = 0x8a,
122         MML_MODVAR          = 0x8b,
123 
124         MML_CMP_EQ          = 0x90,
125         MML_CMP_GE          = 0x91,
126         MML_CMP_GT          = 0x92,
127         MML_CMP_LE          = 0x93,
128         MML_CMP_LT          = 0x94,
129         MML_CMP_NE          = 0x95,
130 
131         MML_USERPROC        = 0xe0
132     };
133 };
134 
135 
136 } // namespace nw::snd::internal::driver
137 } // namespace nw::snd::internal
138 } // namespace nw::snd
139 } // namespace nw
140 
141 
142 #endif /* NW_SND_MML_COMMAND_H_ */
143 
144