Subversion Repositories svn.mios

Rev

Rev 303 | Rev 696 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 303 Rev 628
Line 35... Line 35...
35
    private static int combo = 6;
35
    private static int combo = 6;
36
    private static int simplerotary = 7;
36
    private static int simplerotary = 7;
37
   
37
38
    public static Vector createMSTR(Patch patch) {
38
    public static Vector createMSTR(Patch patch) {
39
        Vector drumControl = new Vector();     
39
        Vector drumControl = new Vector();
40
        drumControl.add(new SIDSysexParameterControl(rotary,null,patch,82,0,7,"Volume"));
40
        drumControl.add(new SIDSysexParameterControl(rotary, null, patch, 82,
-
 
41
                0, 7, "Volume"));
41
        return drumControl;
42
        return drumControl;
42
    }
43
    }
43
       
44
44
    public static Vector createInstrument(Patch patch, int offset) {
45
    public static Vector createInstrument(Patch patch, int offset) {
45
        Vector multiControl = new Vector();
46
        Vector multiControl = new Vector();
46
        // Master
47
        // Master
47
        multiControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,3,1,"Poly","Switches between Poly/Mono mode"));     
48
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
49
                112 + offset, 3, 1, "Poly", "Switches between Poly/Mono mode"));
48
        multiControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,0,1,"Legato"));
50
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
51
                112 + offset, 0, 1, "Legato"));
49
        multiControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,2,1,"Fingered Portamento"));
52
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
53
                112 + offset, 2, 1, "Fingered Portamento"));
50
        multiControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,1,1,"Wavetable only"));
54
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
55
                112 + offset, 1, 1, "Wavetable only"));
51
        multiControl.add(new SIDSysexParameterControl(rotary,SIDSysexInfo.voiceAssign,patch,113+offset,0,4,"Voice Assign","Voice assignment"));
56
        multiControl.add(new SIDSysexParameterControl(rotary,
-
 
57
                SIDSysexInfo.voiceAssign, patch, 113 + offset, 0, 4,
-
 
58
                "Voice Assign", "Voice assignment"));
-
 
59
        multiControl.add(new SIDSysexParameterControl(combo,
-
 
60
                SIDSysexInfo.multiParams, patch, 114 + offset, 0, 8,
52
        multiControl.add(new SIDSysexParameterControl(combo,SIDSysexInfo.multiParams,patch,114+offset,0,8,"Velocity Assign","Velocity parameter assignment"));
61
                "Velocity Assign", "Velocity parameter assignment"));
53
        multiControl.add(new SIDSysexParameterControl(combo,SIDSysexInfo.multiParams,patch,115+offset,0,8,"PitchB. Assign","Pitch Bender assignment"));
62
        multiControl.add(new SIDSysexParameterControl(combo,
-
 
63
                SIDSysexInfo.multiParams, patch, 115 + offset, 0, 8,
-
 
64
                "PitchB. Assign", "Pitch Bender assignment"));
54
       
65
55
        //LFO 1&2
66
        // LFO 1&2
56
        for(int i=0;i<2;i++) {         
67
        for (int i = 0; i < 2; i++) {
57
            multiControl.add(new SIDSysexParameterControl(button,null,patch,116+(7*i)+offset,0,1,"On/Off","Enable/disable LFO"));
68
            multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
69
                    116 + (7 * i) + offset, 0, 1, "On/Off",
-
 
70
                    "Enable/disable LFO"));
58
            multiControl.add(new SIDSysexParameterControl(button,null,patch,116+(7*i)+offset,1,1,"Key Sync","Key synchronisation"));
71
            multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
72
                    116 + (7 * i) + offset, 1, 1, "Key Sync",
-
 
73
                    "Key synchronisation"));
59
            multiControl.add(new SIDSysexParameterControl(button,null,patch,116+(7*i)+offset,2,1,"MIDI Sync","Global clock synchronisation"));     
74
            multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
75
                    116 + (7 * i) + offset, 2, 1, "MIDI Sync",
-
 
76
                    "Global clock synchronisation"));
60
            multiControl.add(new SIDSysexParameterControl(button,null,patch,116+(7*i)+offset,3,1,"Oneshot","Oneshot mode"));
77
            multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
78
                    116 + (7 * i) + offset, 3, 1, "Oneshot", "Oneshot mode"));
61
            multiControl.add(new SIDSysexParameterControl(lfoselect,null,patch,116+(7*i)+offset,4,4,"Waveform"));
79
            multiControl.add(new SIDSysexParameterControl(lfoselect, null,
-
 
80
                    patch, 116 + (7 * i) + offset, 4, 4, "Waveform"));
62
            multiControl.add(new SIDSysexParameterControl(rotary,null,patch,117+(7*i)+offset,0,-8,"Pitch Depth","Pitch modulation depth"));    
81
            multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
82
                    117 + (7 * i) + offset, 0, -8, "Pitch Depth",
-
 
83
                    "Pitch modulation depth"));
63
            multiControl.add(new SIDSysexParameterControl(rotary,createRateStr(),patch,118+(7*i)+offset,0,8,"Rate"));   // Let op CSn flag!
84
            multiControl.add(new SIDSysexParameterControl(rotary,
-
 
85
                    createRateStr(), patch, 118 + (7 * i) + offset, 0, 8,
-
 
86
                    "Rate")); // Let op CSn flag!
64
            multiControl.add(new SIDSysexParameterControl(rotary,null,patch,119+(7*i)+offset,0,8,"Delay"));
87
            multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
88
                    119 + (7 * i) + offset, 0, 8, "Delay"));
65
            multiControl.add(new SIDSysexParameterControl(rotary,null,patch,120+(7*i)+offset,0,8,"Phase"));
89
            multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
90
                    120 + (7 * i) + offset, 0, 8, "Phase"));
66
            multiControl.add(new SIDSysexParameterControl(rotary,null,patch,121+(7*i)+offset,0,-8,"PWM Depth","Pulse width modulation depth"));
91
            multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
92
                    121 + (7 * i) + offset, 0, -8, "PWM Depth",
-
 
93
                    "Pulse width modulation depth"));
67
            multiControl.add(new SIDSysexParameterControl(rotary,null,patch,122+(7*i)+offset,0,-8,"Cutoff Depth","Filter cutoff modulation depth"));
94
            multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
95
                    122 + (7 * i) + offset, 0, -8, "Cutoff Depth",
-
 
96
                    "Filter cutoff modulation depth"));
68
        }
97
        }
69
       
98
70
        // Envelope
99
        // Envelope
71
        multiControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,4,1,"Curve to Attack","Curve assigned to Attack rate"));
100
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
101
                130 + offset, 4, 1, "Curve to Attack",
-
 
102
                "Curve assigned to Attack rate"));
72
        multiControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,5,1,"Curve to Decay","Curve assigned to Decay rate"));
103
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
104
                130 + offset, 5, 1, "Curve to Decay",
-
 
105
                "Curve assigned to Decay rate"));
73
        multiControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,6,1,"Curve to Sustain","Curve assigned to Sustain rate"));
106
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
107
                130 + offset, 6, 1, "Curve to Sustain",
-
 
108
                "Curve assigned to Sustain rate"));
-
 
109
        multiControl
74
        multiControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,7,1,"MIDI Sync","Global clock synchronisation"));
110
                .add(new SIDSysexParameterControl(button, null, patch,
-
 
111
                        130 + offset, 7, 1, "MIDI Sync",
-
 
112
                        "Global clock synchronisation"));
75
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,131+offset,0,-8,"Depth Pitch","Pitch modulation depth"));
113
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
114
                131 + offset, 0, -8, "Depth Pitch", "Pitch modulation depth"));
76
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,132+offset,0,-8,"Depth PWM","Pulse width modulation depth"));
115
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
116
                132 + offset, 0, -8, "Depth PWM",
-
 
117
                "Pulse width modulation depth"));
77
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,133+offset,0,-8,"Depth Cutoff","Filter cutoff modulation depth"));
118
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
119
                133 + offset, 0, -8, "Depth Cutoff",
-
 
120
                "Filter cutoff modulation depth"));
78
        multiControl.add(new SIDSysexParameterControl(slider,null,patch,134+offset,0,8,"Attack","Attack rate"));
121
        multiControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
122
                134 + offset, 0, 8, "Attack", "Attack rate"));
79
        multiControl.add(new SIDSysexParameterControl(slider,null,patch,135+offset,0,8,"Decay","Decay rate"));
123
        multiControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
124
                135 + offset, 0, 8, "Decay", "Decay rate"));
80
        multiControl.add(new SIDSysexParameterControl(slider,null,patch,136+offset,0,8,"Sustain","Sustain level"));
125
        multiControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
126
                136 + offset, 0, 8, "Sustain", "Sustain level"));
81
        multiControl.add(new SIDSysexParameterControl(slider,null,patch,137+offset,0,8,"Release","Release rate"));
127
        multiControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
128
                137 + offset, 0, 8, "Release", "Release rate"));
82
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,138+offset,0,-8,"Curve"));
129
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
130
                138 + offset, 0, -8, "Curve"));
83
131
84
        // Wavetable
132
        // Wavetable
85
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,139+offset,0,6,"Clock Divider","Clock divider (sets tempo)"));
133
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
134
                139 + offset, 0, 6, "Clock Divider",
-
 
135
                "Clock divider (sets tempo)"));
86
        multiControl.add(new SIDSysexParameterControl(button,null,patch,139+offset,6,1,"reserved","Reserved"));
136
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
137
                139 + offset, 6, 1, "reserved", "Reserved"));
87
        multiControl.add(new SIDSysexParameterControl(button,null,patch,139+offset,7,1,"reserved","Reserved"));
138
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
139
                139 + offset, 7, 1, "reserved", "Reserved"));
-
 
140
        multiControl.add(new SIDSysexParameterControl(combo,
88
        multiControl.add(new SIDSysexParameterControl(combo,SIDSysexInfo.multiParams,patch,140+offset,0,8,"Assign","Parameter assignment"));
141
                SIDSysexInfo.multiParams, patch, 140 + offset, 0, 8, "Assign",
-
 
142
                "Parameter assignment"));
-
 
143
        multiControl
89
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,141+offset,0,7,"Start Pos","Start position in wavetable"));
144
                .add(new SIDSysexParameterControl(rotary, null, patch,
-
 
145
                        141 + offset, 0, 7, "Start Pos",
-
 
146
                        "Start position in wavetable"));
90
        multiControl.add(new SIDSysexParameterControl(button,null,patch,141+offset,7,1,"reserved","reserved flag"));
147
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
148
                141 + offset, 7, 1, "reserved", "reserved flag"));
91
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,142+offset,0,7,"End Pos","End position in wavetable"));
149
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
150
                142 + offset, 0, 7, "End Pos", "End position in wavetable"));
92
        multiControl.add(new SIDSysexParameterControl(rotary,null,patch,143+offset,0,7,"Loop Pos","Loop position in wavetable"));
151
        multiControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
152
                143 + offset, 0, 7, "Loop Pos", "Loop position in wavetable"));
93
        multiControl.add(new SIDSysexParameterControl(button,null,patch,143+offset,7,1,"Oneshot"));
153
        multiControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
154
                143 + offset, 7, 1, "Oneshot"));
94
               
155
95
        return multiControl;
156
        return multiControl;
96
    }
157
    }
97
       
158
98
    public static Vector createWTdata(Patch patch) {
159
    public static Vector createWTdata(Patch patch) {
99
        Vector wtControl = new Vector();       
160
        Vector wtControl = new Vector();
100
        // Wavetable data
161
        // Wavetable data
101
        for (int c = 0; c <128; c++) {
162
        for (int c = 0; c < 128; c++) {
102
            wtControl.add(new SIDSysexParameterControl(slider,createWTStr(),patch,384+c,0,8,Integer.toString(c)));
163
            wtControl.add(new SIDSysexParameterControl(slider, createWTStr(),
-
 
164
                    patch, 384 + c, 0, 8, Integer.toString(c)));
103
        }              
165
        }
104
        return wtControl;
166
        return wtControl;
105
    }
167
    }
106
   
168
107
    private static String[] createRateStr() {
169
    private static String[] createRateStr() {
108
        String[] rateStr = new String[256];    
170
        String[] rateStr = new String[256];
109
        for (int c = 0; c <rateStr.length; c++) {
171
        for (int c = 0; c < rateStr.length; c++) {
110
           
172
111
            if (c < 245) {
173
            if (c < 245) {
112
                rateStr[c] = Integer.toString(c);
174
                rateStr[c] = Integer.toString(c);
113
            }
-
 
114
            else {
175
            } else {
115
                rateStr[c] = SIDSysexInfo.rates[c-245];
176
                rateStr[c] = SIDSysexInfo.rates[c - 245];
116
            }
177
            }
117
        }
178
        }
118
        return rateStr;
179
        return rateStr;
119
    }
180
    }
120
   
181
121
    private static String[] createWTStr() {
182
    private static String[] createWTStr() {
122
        String[] wtStr = new String[256];
183
        String[] wtStr = new String[256];
123
        String[] notes = {"c-","c#","d-","d#","e-","f-","f#","g-","g#","a-","a#","b-"};
184
        String[] notes = { "c-", "c#", "d-", "d#", "e-", "f-", "f#", "g-",
-
 
185
                "g#", "a-", "a#", "b-" };
124
       
186
125
        for (int i = 0; i < 256; i++) {
187
        for (int i = 0; i < 256; i++) {
126
            if (i < 64) {              
188
            if (i < 64) {
127
                wtStr[i] = Integer.toString(i-64);             
189
                wtStr[i] = Integer.toString(i - 64);
128
            }
-
 
129
            else if (i < 128) {
190
            } else if (i < 128) {
130
                wtStr[i] = "+" + Integer.toString(i-64);
191
                wtStr[i] = "+" + Integer.toString(i - 64);
131
            }
-
 
132
            else if (i == 128) {
192
            } else if (i == 128) {
133
                wtStr[i] = "---";
193
                wtStr[i] = "---";
134
            }
-
 
135
            else if (i == 129) {
194
            } else if (i == 129) {
136
                wtStr[i] = "+++";
195
                wtStr[i] = "+++";
137
            }
-
 
138
            else if (i < 252) {
196
            } else if (i < 252) {
139
                int octave = (int) Math.floor((i-128)/12)-2;
197
                int octave = (int) Math.floor((i - 128) / 12) - 2;
140
                if (octave < 0) {
198
                if (octave < 0) {
141
                    wtStr[i] = notes[(i-128)%12] + Math.abs(octave);
199
                    wtStr[i] = notes[(i - 128) % 12] + Math.abs(octave);
-
 
200
                } else {
-
 
201
                    wtStr[i] = notes[(i - 128) % 12].toUpperCase()
-
 
202
                            + Math.abs(octave);
142
                }
203
                }
143
                else {
-
 
144
                    wtStr[i] = notes[(i-128)%12].toUpperCase() + Math.abs(octave);
-
 
145
                }
-
 
146
            }
-
 
147
            else if (i < 256) {
204
            } else if (i < 256) {
148
                wtStr[i] = "Ky" + Integer.toString(i-251);
205
                wtStr[i] = "Ky" + Integer.toString(i - 251);
149
            }
206
            }
150
        }
207
        }
151
        return wtStr;
208
        return wtStr;
152
    }
209
    }
153
}
210
}
154
-