Subversion Repositories svn.mios

Rev

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

Rev 505 Rev 628
Line 17... Line 17...
17
 * along with this application; if not, write to the Free Software
17
 * along with this application; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
19
 */
20
20
21
package org.midibox.sidedit;
21
package org.midibox.sidedit;
-
 
22
22
import java.util.Vector;
23
import java.util.Vector;
23
24
24
import org.midibox.sidlibr.Patch;
25
import org.midibox.sidlibr.Patch;
25
26
26
public class BasslineSpecs {
27
public class BasslineSpecs {
Line 35... Line 36...
35
    private static int simplerotary = 7;
36
    private static int simplerotary = 7;
36
    private static int radio = 8;
37
    private static int radio = 8;
37
   
38
38
    public static Vector createMSTR(Patch patch, int offset) {
39
    public static Vector createMSTR(Patch patch, int offset) {
39
        Vector basslineControl = new Vector();     
40
        Vector basslineControl = new Vector();
40
        basslineControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,0,1,"Legato"));
41
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
42
                112 + offset, 0, 1, "Legato"));
41
        basslineControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,2,1,"Fingered Portamento"));
43
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
44
                112 + offset, 2, 1, "Fingered Portamento"));
42
        basslineControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,1,1,"Manual/Seq","MIDI Note playing/Sequencer mode"));
45
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
46
                112 + offset, 1, 1, "Manual/Seq",
-
 
47
                "MIDI Note playing/Sequencer mode"));
43
        basslineControl.add(new SIDSysexParameterControl(button,null,patch,112+offset,3,1,"Osc Phase Sync","Oscillator phase synchronisation"));
48
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
49
                112 + offset, 3, 1, "Osc Phase Sync",
-
 
50
                "Oscillator phase synchronisation"));
44
        // OSC2
51
        // OSC2
45
        basslineControl.add(new SIDSysexParameterControl(waveselect,null,patch,96+offset,0,8,"Waveform","Select a waveform"));
52
        basslineControl.add(new SIDSysexParameterControl(waveselect, null,
-
 
53
                patch, 96 + offset, 0, 8, "Waveform", "Select a waveform"));
46
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,97+offset,0,12,"Pulse Width","Pulse Width"));
54
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
55
                97 + offset, 0, 12, "Pulse Width", "Pulse Width"));
47
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,99+offset,0,-3,"Octave"));
56
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
57
                99 + offset, 0, -3, "Octave"));
48
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,100+offset,0,7,"Static note"));
58
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
59
                100 + offset, 0, 7, "Static note"));
49
        //OSC3
60
        // OSC3
50
        basslineControl.add(new SIDSysexParameterControl(waveselect,null,patch,104+offset,0,8,"Waveform","Select a waveform"));
61
        basslineControl.add(new SIDSysexParameterControl(waveselect, null,
-
 
62
                patch, 104 + offset, 0, 8, "Waveform", "Select a waveform"));
51
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,105+offset,0,12,"Pulse Width","Pulse Width"));
63
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
64
                105 + offset, 0, 12, "Pulse Width", "Pulse Width"));
52
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,107+offset,0,-3,"Octave"));
65
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
66
                107 + offset, 0, -3, "Octave"));
53
        basslineControl.add(new SIDSysexParameterControl(rotary,null,patch,108+offset,0,7,"Static note"));
67
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
68
                108 + offset, 0, 7, "Static note"));
54
       
69
55
        return basslineControl;
70
        return basslineControl;
56
    }
71
    }
57
   
72
58
    public static Vector createLFO(Patch patch, int offset) {
73
    public static Vector createLFO(Patch patch, int offset) {
59
        Vector lfoControl = new Vector();
74
        Vector lfoControl = new Vector();
60
        // LFO1
75
        // LFO1
61
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,116+offset,0,1,"On/Off","Enable/disable LFO"));
76
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
77
                116 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
62
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,116+offset,1,1,"Key Sync","Key synchronisation"));   
78
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
79
                116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
-
 
80
        lfoControl
63
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,116+offset,2,1,"MIDI Sync","Global clock synchronisation"));     
81
                .add(new SIDSysexParameterControl(button, null, patch,
-
 
82
                        116 + offset, 2, 1, "MIDI Sync",
-
 
83
                        "Global clock synchronisation"));
64
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,116+offset,3,1,"Oneshot","Oneshot mode"));
84
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
85
                116 + offset, 3, 1, "Oneshot", "Oneshot mode"));
65
        lfoControl.add(new SIDSysexParameterControl(lfoselect,null,patch,116+offset,4,4,"Waveform"));
86
        lfoControl.add(new SIDSysexParameterControl(lfoselect, null, patch,
-
 
87
                116 + offset, 4, 4, "Waveform"));
66
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,117+offset,0,-8,"Pitch Depth","Pitch modulation depth"));    
88
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
89
                117 + offset, 0, -8, "Pitch Depth", "Pitch modulation depth"));
67
        lfoControl.add(new SIDSysexParameterControl(rotary,createRateStr(),patch,118+offset,0,8,"Rate"));   // Let op CSn flag!
90
        lfoControl.add(new SIDSysexParameterControl(rotary, createRateStr(),
-
 
91
                patch, 118 + offset, 0, 8, "Rate")); // Let op CSn flag!
68
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,119+offset,0,8,"Delay"));
92
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
93
                119 + offset, 0, 8, "Delay"));
69
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,120+offset,0,8,"Phase"));
94
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
95
                120 + offset, 0, 8, "Phase"));
70
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,121+offset,0,-8,"PWM depth","Pulse width modulation depth"));
96
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
97
                121 + offset, 0, -8, "PWM depth",
-
 
98
                "Pulse width modulation depth"));
71
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,122+offset,0,-8,"Cutoff depth","Filter cutoff modulation depth"));
99
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
100
                122 + offset, 0, -8, "Cutoff depth",
-
 
101
                "Filter cutoff modulation depth"));
72
        // LFO2
102
        // LFO2
73
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,123+offset,0,1,"On/Off","Enable/disable LFO"));
103
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
104
                123 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
74
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,116+offset,1,1,"Key Sync","Key synchronisation"));
105
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
106
                116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
-
 
107
        lfoControl
75
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,123+offset,2,1,"MIDI Sync","Global clock synchronisation"));     
108
                .add(new SIDSysexParameterControl(button, null, patch,
-
 
109
                        123 + offset, 2, 1, "MIDI Sync",
-
 
110
                        "Global clock synchronisation"));
76
        lfoControl.add(new SIDSysexParameterControl(button,null,patch,123+offset,3,1,"Oneshot","One shot mode"));
111
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
112
                123 + offset, 3, 1, "Oneshot", "One shot mode"));
77
        lfoControl.add(new SIDSysexParameterControl(lfoselect,null,patch,123+offset,4,4,"Waveform"));
113
        lfoControl.add(new SIDSysexParameterControl(lfoselect, null, patch,
-
 
114
                123 + offset, 4, 4, "Waveform"));
78
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,124+offset,0,-8,"Pitch Depth","Pitch modulation depth"));    
115
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
116
                124 + offset, 0, -8, "Pitch Depth", "Pitch modulation depth"));
79
        lfoControl.add(new SIDSysexParameterControl(rotary,createRateStr(),patch,125+offset,0,8,"Rate"));   // Let op CSn flag!
117
        lfoControl.add(new SIDSysexParameterControl(rotary, createRateStr(),
-
 
118
                patch, 125 + offset, 0, 8, "Rate")); // Let op CSn flag!
80
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,126+offset,0,8,"Delay"));
119
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
120
                126 + offset, 0, 8, "Delay"));
81
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,127+offset,0,8,"Phase"));
121
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
122
                127 + offset, 0, 8, "Phase"));
82
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,128+offset,0,-8,"PWM Depth","Pulse width modulation depth"));
123
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
124
                128 + offset, 0, -8, "PWM Depth",
-
 
125
                "Pulse width modulation depth"));
83
        lfoControl.add(new SIDSysexParameterControl(rotary,null,patch,129+offset,0,-8,"Cutoff Depth","Filter cutoff modulation depth"));
126
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
127
                129 + offset, 0, -8, "Cutoff Depth",
-
 
128
                "Filter cutoff modulation depth"));
84
        return lfoControl;
129
        return lfoControl;
85
    }
130
    }
86
   
131
87
    public static Vector createENV(Patch patch, int offset) {
132
    public static Vector createENV(Patch patch, int offset) {
88
        Vector envControl = new Vector();  
133
        Vector envControl = new Vector();
89
        // Envelope
134
        // Envelope
90
        envControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,4,1,"Curve to Attack","Curve assigned to Attack rate"));
135
        envControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
136
                130 + offset, 4, 1, "Curve to Attack",
-
 
137
                "Curve assigned to Attack rate"));
91
        envControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,5,1,"Curve to Decay","Curve assigned to Decay rate"));
138
        envControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
139
                130 + offset, 5, 1, "Curve to Decay",
-
 
140
                "Curve assigned to Decay rate"));
92
        envControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,6,1,"Curve to Sustain","Curve assigned to Sustain rate"));
141
        envControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
142
                130 + offset, 6, 1, "Curve to Sustain",
-
 
143
                "Curve assigned to Sustain rate"));
-
 
144
        envControl
93
        envControl.add(new SIDSysexParameterControl(button,null,patch,130+offset,7,1,"MIDI Sync","Global clock synchronisation"));
145
                .add(new SIDSysexParameterControl(button, null, patch,
-
 
146
                        130 + offset, 7, 1, "MIDI Sync",
-
 
147
                        "Global clock synchronisation"));
94
        envControl.add(new SIDSysexParameterControl(rotary,null,patch,131+offset,0,-8,"Depth Pitch","Pitch modulation depth"));
148
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
149
                131 + offset, 0, -8, "Depth Pitch", "Pitch modulation depth"));
95
        envControl.add(new SIDSysexParameterControl(rotary,null,patch,132+offset,0,-8,"Depth PWM","Pulse width modulation depth"));
150
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
151
                132 + offset, 0, -8, "Depth PWM",
-
 
152
                "Pulse width modulation depth"));
96
        envControl.add(new SIDSysexParameterControl(rotary,null,patch,133+offset,0,-8,"Depth Cutoff","Filter cutoff modulation depth"));
153
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
154
                133 + offset, 0, -8, "Depth Cutoff",
-
 
155
                "Filter cutoff modulation depth"));
97
        envControl.add(new SIDSysexParameterControl(slider,null,patch,134+offset,0,8,"Attack","Attack rate"));
156
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
157
                134 + offset, 0, 8, "Attack", "Attack rate"));
98
        envControl.add(new SIDSysexParameterControl(slider,null,patch,135+offset,0,8,"Decay","Decay rate"));
158
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
159
                135 + offset, 0, 8, "Decay", "Decay rate"));
99
        envControl.add(new SIDSysexParameterControl(slider,null,patch,136+offset,0,8,"Sustain","Sustain level"));
160
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
161
                136 + offset, 0, 8, "Sustain", "Sustain level"));
100
        envControl.add(new SIDSysexParameterControl(slider,null,patch,137+offset,0,8,"Release","Release rate"));
162
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
-
 
163
                137 + offset, 0, 8, "Release", "Release rate"));
101
        envControl.add(new SIDSysexParameterControl(rotary,null,patch,138+offset,0,-8,"Curve"));
164
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
165
                138 + offset, 0, -8, "Curve"));
102
        envControl.add(new SIDSysexParameterControl(rotary,null,patch,144+offset,0,8,"Accent Decay","Decay rate used on accented notes"));
166
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
167
                144 + offset, 0, 8, "Accent Decay",
-
 
168
                "Decay rate used on accented notes"));
103
        return envControl;
169
        return envControl;
104
    }
170
    }
105
   
171
106
    public static Vector createSEQ(Patch patch, int offset) {
172
    public static Vector createSEQ(Patch patch, int offset) {
107
        Vector seqControl = new Vector();          
173
        Vector seqControl = new Vector();
108
        // Sequencer
174
        // Sequencer
109
        seqControl.add(new SIDSysexParameterControl(rotary,null,patch,139+offset,0,6,"Clock Divider","Clock divider (sets tempo)"));
175
        seqControl.add(new SIDSysexParameterControl(rotary, null, patch,
-
 
176
                139 + offset, 0, 6, "Clock Divider",
-
 
177
                "Clock divider (sets tempo)"));
110
        seqControl.add(new SIDSysexParameterControl(button,null,patch,139+offset,7,1,"Pattern Sync","Pattern changes synchronised to measure"));
178
        seqControl.add(new SIDSysexParameterControl(button, null, patch,
-
 
179
                139 + offset, 7, 1, "Pattern Sync",
-
 
180
                "Pattern changes synchronised to measure"));
111
        seqControl.add(new SIDSysexParameterControl(combo,SIDSysexInfo.seq,patch,140+offset,0,4,"Sequence","Sequencer number"));
181
        seqControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.seq,
-
 
182
                patch, 140 + offset, 0, 4, "Sequence", "Sequencer number"));
112
        seqControl.add(new SIDSysexParameterControl(rotary,createSteps(),patch,141+offset,0,4,"Steps","Number of steps"));     
183
        seqControl.add(new SIDSysexParameterControl(rotary, createSteps(),
-
 
184
                patch, 141 + offset, 0, 4, "Steps", "Number of steps"));
113
        seqControl.add(new SIDSysexParameterControl(combo,SIDSysexInfo.basslineParams,patch,142+offset,0,8,"Assign"));
185
        seqControl.add(new SIDSysexParameterControl(combo,
-
 
186
                SIDSysexInfo.basslineParams, patch, 142 + offset, 0, 8,
-
 
187
                "Assign"));
114
        return seqControl;
188
        return seqControl;
115
    }
189
    }
116
   
190
117
    public static Vector createSEQData(Patch patch) {
191
    public static Vector createSEQData(Patch patch) {
118
        Vector seqDataControl = new Vector();  
192
        Vector seqDataControl = new Vector();
119
        // Sequencer data
193
        // Sequencer data
120
        for(int i=0;i<16*8;i++) {
194
        for (int i = 0; i < 16 * 8; i++) {
121
            seqDataControl.add(new SIDSysexParameterControl(simplerotary,SIDSysexInfo.notes,patch,256+i,0,4,"Note"));
195
            seqDataControl.add(new SIDSysexParameterControl(simplerotary,
-
 
196
                    SIDSysexInfo.notes, patch, 256 + i, 0, 4, "Note"));
-
 
197
            seqDataControl
122
            seqDataControl.add(new SIDSysexParameterControl(simplerotary,SIDSysexInfo.octaves,patch,256+i,4,2,"Oct","Octave"));
198
                    .add(new SIDSysexParameterControl(simplerotary,
-
 
199
                            SIDSysexInfo.octaves, patch, 256 + i, 4, 2, "Oct",
-
 
200
                            "Octave"));
123
            seqDataControl.add(new SIDSysexParameterControl(simplerotary,null,patch,384+i,0,7,"Par","Parameter value"));
201
            seqDataControl.add(new SIDSysexParameterControl(simplerotary, null,
-
 
202
                    patch, 384 + i, 0, 7, "Par", "Parameter value"));
124
            seqDataControl.add(new SIDSysexParameterControl(simplebutton,null,patch,256+i,6,1,"Glide"));           
203
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
-
 
204
                    patch, 256 + i, 6, 1, "Glide"));
125
            seqDataControl.add(new SIDSysexParameterControl(simplebutton,null,patch,384+i,7,1,"Acc","Accent"));
205
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
-
 
206
                    patch, 384 + i, 7, 1, "Acc", "Accent"));
126
            seqDataControl.add(new SIDSysexParameterControl(simplebutton,null,patch,256+i,7,1,"Gate"));
207
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
-
 
208
                    patch, 256 + i, 7, 1, "Gate"));
127
        }
209
        }
128
        return seqDataControl;
210
        return seqDataControl;
129
    }
211
    }
130
   
212
131
    private static String[] createRateStr() {
213
    private static String[] createRateStr() {
132
        String[] rateStr = new String[256];    
214
        String[] rateStr = new String[256];
133
        for (int c = 0; c <rateStr.length; c++) {
215
        for (int c = 0; c < rateStr.length; c++) {
134
           
216
135
            if (c < 245) {
217
            if (c < 245) {
136
                rateStr[c] = Integer.toString(c);
218
                rateStr[c] = Integer.toString(c);
137
            }
-
 
138
            else {
219
            } else {
139
                rateStr[c] = SIDSysexInfo.rates[c-245];
220
                rateStr[c] = SIDSysexInfo.rates[c - 245];
140
            }
221
            }
141
        }
222
        }
142
        return rateStr;
223
        return rateStr;
143
    }
224
    }
Line 148... Line 229...
148
            s[i] = Integer.toString(i+1);
229
            s[i] = Integer.toString(i + 1);
149
        }
230
        }
150
        return s;
231
        return s;
151
    }
232
    }
152
}
233
}
153
-