Subversion Repositories svn.mios

Rev

Rev 505 | Rev 696 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
213 tk 1
/*
2
 * @(#)SIDV2librarian.java  beta1   2008/01/21
3
 *
4
 * Copyright (C) 2008    Rutger Vlek (rutgervlek@hotmail.com)
5
 *
6
 * This application is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This application is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
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
19
 */
20
 
21
package org.midibox.sidedit;
628 adamjking 22
 
213 tk 23
import java.util.Vector;
24
 
25
import org.midibox.sidlibr.Patch;
26
 
27
public class BasslineSpecs {
28
    // Control types:
29
    private static int rotary = 0;
30
    private static int button = 1;
31
    private static int simplebutton = 2;
628 adamjking 32
    private static int slider = 3;
33
    private static int waveselect = 4;
213 tk 34
    private static int lfoselect = 5;
35
    private static int combo = 6;
36
    private static int simplerotary = 7;
505 rutgerv 37
    private static int radio = 8;
628 adamjking 38
 
213 tk 39
    public static Vector createMSTR(Patch patch, int offset) {
628 adamjking 40
        Vector basslineControl = new Vector();
41
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
42
                112 + offset, 0, 1, "Legato"));
43
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
44
                112 + offset, 2, 1, "Fingered Portamento"));
45
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
46
                112 + offset, 1, 1, "Manual/Seq",
47
                "MIDI Note playing/Sequencer mode"));
48
        basslineControl.add(new SIDSysexParameterControl(button, null, patch,
49
                112 + offset, 3, 1, "Osc Phase Sync",
50
                "Oscillator phase synchronisation"));
505 rutgerv 51
        // OSC2
628 adamjking 52
        basslineControl.add(new SIDSysexParameterControl(waveselect, null,
53
                patch, 96 + offset, 0, 8, "Waveform", "Select a waveform"));
54
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
55
                97 + offset, 0, 12, "Pulse Width", "Pulse Width"));
56
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
57
                99 + offset, 0, -3, "Octave"));
58
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
59
                100 + offset, 0, 7, "Static note"));
60
        // OSC3
61
        basslineControl.add(new SIDSysexParameterControl(waveselect, null,
62
                patch, 104 + offset, 0, 8, "Waveform", "Select a waveform"));
63
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
64
                105 + offset, 0, 12, "Pulse Width", "Pulse Width"));
65
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
66
                107 + offset, 0, -3, "Octave"));
67
        basslineControl.add(new SIDSysexParameterControl(rotary, null, patch,
68
                108 + offset, 0, 7, "Static note"));
69
 
213 tk 70
        return basslineControl;
71
    }
628 adamjking 72
 
213 tk 73
    public static Vector createLFO(Patch patch, int offset) {
74
        Vector lfoControl = new Vector();
75
        // LFO1
628 adamjking 76
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
77
                116 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
78
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
79
                116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
80
        lfoControl
81
                .add(new SIDSysexParameterControl(button, null, patch,
82
                        116 + offset, 2, 1, "MIDI Sync",
83
                        "Global clock synchronisation"));
84
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
85
                116 + offset, 3, 1, "Oneshot", "Oneshot mode"));
86
        lfoControl.add(new SIDSysexParameterControl(lfoselect, null, patch,
87
                116 + offset, 4, 4, "Waveform"));
88
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
89
                117 + offset, 0, -8, "Pitch Depth", "Pitch modulation depth"));
90
        lfoControl.add(new SIDSysexParameterControl(rotary, createRateStr(),
91
                patch, 118 + offset, 0, 8, "Rate")); // Let op CSn flag!
92
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
93
                119 + offset, 0, 8, "Delay"));
94
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
95
                120 + offset, 0, 8, "Phase"));
96
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
97
                121 + offset, 0, -8, "PWM depth",
98
                "Pulse width modulation depth"));
99
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
100
                122 + offset, 0, -8, "Cutoff depth",
101
                "Filter cutoff modulation depth"));
213 tk 102
        // LFO2
628 adamjking 103
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
104
                123 + offset, 0, 1, "On/Off", "Enable/disable LFO"));
105
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
106
                116 + offset, 1, 1, "Key Sync", "Key synchronisation"));
107
        lfoControl
108
                .add(new SIDSysexParameterControl(button, null, patch,
109
                        123 + offset, 2, 1, "MIDI Sync",
110
                        "Global clock synchronisation"));
111
        lfoControl.add(new SIDSysexParameterControl(button, null, patch,
112
                123 + offset, 3, 1, "Oneshot", "One shot mode"));
113
        lfoControl.add(new SIDSysexParameterControl(lfoselect, null, patch,
114
                123 + offset, 4, 4, "Waveform"));
115
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
116
                124 + offset, 0, -8, "Pitch Depth", "Pitch modulation depth"));
117
        lfoControl.add(new SIDSysexParameterControl(rotary, createRateStr(),
118
                patch, 125 + offset, 0, 8, "Rate")); // Let op CSn flag!
119
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
120
                126 + offset, 0, 8, "Delay"));
121
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
122
                127 + offset, 0, 8, "Phase"));
123
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
124
                128 + offset, 0, -8, "PWM Depth",
125
                "Pulse width modulation depth"));
126
        lfoControl.add(new SIDSysexParameterControl(rotary, null, patch,
127
                129 + offset, 0, -8, "Cutoff Depth",
128
                "Filter cutoff modulation depth"));
213 tk 129
        return lfoControl;
130
    }
628 adamjking 131
 
213 tk 132
    public static Vector createENV(Patch patch, int offset) {
628 adamjking 133
        Vector envControl = new Vector();
213 tk 134
        // Envelope
628 adamjking 135
        envControl.add(new SIDSysexParameterControl(button, null, patch,
136
                130 + offset, 4, 1, "Curve to Attack",
137
                "Curve assigned to Attack rate"));
138
        envControl.add(new SIDSysexParameterControl(button, null, patch,
139
                130 + offset, 5, 1, "Curve to Decay",
140
                "Curve assigned to Decay 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
145
                .add(new SIDSysexParameterControl(button, null, patch,
146
                        130 + offset, 7, 1, "MIDI Sync",
147
                        "Global clock synchronisation"));
148
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
149
                131 + offset, 0, -8, "Depth Pitch", "Pitch modulation depth"));
150
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
151
                132 + offset, 0, -8, "Depth PWM",
152
                "Pulse width modulation depth"));
153
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
154
                133 + offset, 0, -8, "Depth Cutoff",
155
                "Filter cutoff modulation depth"));
156
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
157
                134 + offset, 0, 8, "Attack", "Attack rate"));
158
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
159
                135 + offset, 0, 8, "Decay", "Decay rate"));
160
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
161
                136 + offset, 0, 8, "Sustain", "Sustain level"));
162
        envControl.add(new SIDSysexParameterControl(slider, null, patch,
163
                137 + offset, 0, 8, "Release", "Release rate"));
164
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
165
                138 + offset, 0, -8, "Curve"));
166
        envControl.add(new SIDSysexParameterControl(rotary, null, patch,
167
                144 + offset, 0, 8, "Accent Decay",
168
                "Decay rate used on accented notes"));
213 tk 169
        return envControl;
170
    }
628 adamjking 171
 
213 tk 172
    public static Vector createSEQ(Patch patch, int offset) {
628 adamjking 173
        Vector seqControl = new Vector();
213 tk 174
        // Sequencer
628 adamjking 175
        seqControl.add(new SIDSysexParameterControl(rotary, null, patch,
176
                139 + offset, 0, 6, "Clock Divider",
177
                "Clock divider (sets tempo)"));
178
        seqControl.add(new SIDSysexParameterControl(button, null, patch,
179
                139 + offset, 7, 1, "Pattern Sync",
180
                "Pattern changes synchronised to measure"));
181
        seqControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.seq,
182
                patch, 140 + offset, 0, 4, "Sequence", "Sequencer number"));
183
        seqControl.add(new SIDSysexParameterControl(rotary, createSteps(),
184
                patch, 141 + offset, 0, 4, "Steps", "Number of steps"));
185
        seqControl.add(new SIDSysexParameterControl(combo,
186
                SIDSysexInfo.basslineParams, patch, 142 + offset, 0, 8,
187
                "Assign"));
213 tk 188
        return seqControl;
189
    }
628 adamjking 190
 
213 tk 191
    public static Vector createSEQData(Patch patch) {
628 adamjking 192
        Vector seqDataControl = new Vector();
213 tk 193
        // Sequencer data
628 adamjking 194
        for (int i = 0; i < 16 * 8; i++) {
195
            seqDataControl.add(new SIDSysexParameterControl(simplerotary,
196
                    SIDSysexInfo.notes, patch, 256 + i, 0, 4, "Note"));
197
            seqDataControl
198
                    .add(new SIDSysexParameterControl(simplerotary,
199
                            SIDSysexInfo.octaves, patch, 256 + i, 4, 2, "Oct",
200
                            "Octave"));
201
            seqDataControl.add(new SIDSysexParameterControl(simplerotary, null,
202
                    patch, 384 + i, 0, 7, "Par", "Parameter value"));
203
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
204
                    patch, 256 + i, 6, 1, "Glide"));
205
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
206
                    patch, 384 + i, 7, 1, "Acc", "Accent"));
207
            seqDataControl.add(new SIDSysexParameterControl(simplebutton, null,
208
                    patch, 256 + i, 7, 1, "Gate"));
213 tk 209
        }
210
        return seqDataControl;
211
    }
628 adamjking 212
 
213 tk 213
    private static String[] createRateStr() {
628 adamjking 214
        String[] rateStr = new String[256];
215
        for (int c = 0; c < rateStr.length; c++) {
216
 
213 tk 217
            if (c < 245) {
218
                rateStr[c] = Integer.toString(c);
628 adamjking 219
            } else {
220
                rateStr[c] = SIDSysexInfo.rates[c - 245];
213 tk 221
            }
222
        }
223
        return rateStr;
224
    }
628 adamjking 225
 
213 tk 226
    public static String[] createSteps() {
227
        String[] s = new String[16];
628 adamjking 228
        for (int i = 0; i < s.length; i++) {
229
            s[i] = Integer.toString(i + 1);
213 tk 230
        }
231
        return s;
232
    }
233
}