Subversion Repositories svn.mios

Rev

Rev 628 | Rev 712 | 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;
22
 
23
import java.util.Vector;
24
 
25
import org.midibox.sidlibr.Patch;
26
 
27
public class LeadSpecs {
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;
628 adamjking 36
 
213 tk 37
    public static Vector createMSTR(Patch patch) {
628 adamjking 38
        Vector leadControl = new Vector();
696 rutgerv 39
        leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 0, 1, "Legato"));
40
        leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 2, 1, "Fingered Portamento"));
41
        leadControl.add(new SIDSysexParameterControl(button, null, 0, patch, 80, 1, 1, "Wavetable only"));
42
        leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 81, 0, 8, "Detune", "Detune oscillators"));
43
        leadControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 83, 0, 8, "Phase Offset", "Oscillators phase offset "));
213 tk 44
        return leadControl;
45
    }
628 adamjking 46
 
213 tk 47
    public static Vector createLFO(Patch patch) {
48
        Vector lfoControl = new Vector();
49
        // LFO
628 adamjking 50
        for (int c = 0; c < 6; c++) {
696 rutgerv 51
            lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 0, 1, "On/Off", "Enable/disable LFO"));
52
            lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 2, 1, "MIDI Sync", "Global clock synchronisation"));
53
            lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 192 + (5 * c), 3, 1, "Oneshot", "Oneshot mode"));
54
            lfoControl.add(new SIDSysexParameterControl(lfoselect, null, 0, patch, 192 + (5 * c), 4, 4, "Waveform", "Select a waveform"));
55
            lfoControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 193 + (5 * c), 0, 8, "Depth"));
56
            lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 194 + (5 * c), 0, 8, "Rate"));
57
            lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 195 + (5 * c), 0, 8, "Delay"));
58
            lfoControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 196 + (5 * c), 0, 8, "Phase"));
59
            lfoControl.add(new SIDSysexParameterControl(button, null, 0, patch, 321, (2 + c), 1, "Key Sync", "Reset LFO at key press"));
628 adamjking 60
        }
213 tk 61
        return lfoControl;
62
    }
628 adamjking 63
 
213 tk 64
    public static Vector createENV(Patch patch, int offset) {
628 adamjking 65
        Vector envControl = new Vector();
213 tk 66
        // Envelope
696 rutgerv 67
        envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop, 0, patch, 224 + offset, 0, 3, "Loop Begin", "Envelope loop begin point"));
68
        envControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.loop, 0, patch, 224 + offset, 4, 3, "Loop End", "Envelope loop end point"));
69
        envControl.add(new SIDSysexParameterControl(button, null, 0, patch, 224 + offset, 7, 1, "MIDI Sync", "Global clock synchronisation"));
70
        envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 225 + offset, 0, 8, "Depth"));
71
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 226 + offset, 0, 8, "Delay"));
72
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 227 + offset, 0, 8, "Attack1", "Attack1 Rate"));
73
        envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 228 + offset, 0, 8, "Attack Lvl", "Attack Level"));
74
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 229 + offset, 0, 8, "Attack2", "Attack2 Rate"));
75
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 230 + offset, 0, 8, "Decay1", "Decay1 Rate"));
76
        envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 231 + offset, 0, 8, "Decay Lvl", "Decay Level"));
77
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 232 + offset, 0, 8, "Decay2", "Decay2 Rate"));
78
        envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 233 + offset, 0, 8, "Sustain Lvl", "Sustain Level"));
79
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 234 + offset, 0, 8, "Release1", "Release1 Rate"));
80
        envControl.add(new SIDSysexParameterControl(slider, null, 0, patch, 235 + offset, 0, 8, "Release Lvl", "Release Level"));
81
        envControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 236 + offset, 0, 8, "Release2", "Release2 Rate"));
82
        envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 237 + offset, 0, 8, "Att.Curve", "Attack Curve"));
83
        envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 238 + offset, 0, 8, "Dec.Curve", "Decay Curve"));
84
        envControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 239 + offset, 0, 8, "Rel.Curve", "Release Curve"));
213 tk 85
        return envControl;
86
    }
628 adamjking 87
 
213 tk 88
    public static Vector createMOD(Patch patch) {
628 adamjking 89
        Vector modControl = new Vector();
213 tk 90
        // Modulation paths
628 adamjking 91
        for (int c = 0; c < 8; c++) {
696 rutgerv 92
            modControl.add(new SIDSysexParameterControl(combo, createSrcStr(), 0, patch, 256 + (8 * c), 0, 8, "Source 1"));
93
            modControl.add(new SIDSysexParameterControl(combo, createSrcStr(), 0, patch, 257 + (8 * c), 0, 8, "Source 2"));
94
            modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.operatorNames, 0, patch, 258 + (8 * c), 0, 4, "Operator"));
95
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 258 + (8 * c), 6, 1, "Invert 1/L", "Invert target 1/L"));
96
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 258 + (8 * c), 7, 1, "Invert 2/R", "Invert target 2/R"));
97
            modControl.add(new SIDSysexParameterControl(rotary, null, -128, patch, 259 + (8 * c), 0, 8, "Depth"));
98
            modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.tgtNames, 0, patch, 262 + (8 * c), 0, 8, "Target 1"));
99
            modControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.tgtNames, 0, patch, 263 + (8 * c), 0, 8, "Target 2"));
100
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 0, 1, "V1 Pitch", "Direct assignment to pitch of left OSC1"));
101
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 1, 1, "V2 Pitch", "Direct assignment to pitch of left OSC2"));
102
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 2, 1, "V3 Pitch", "Direct assignment to pitch of left OSC3"));
103
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 3, 1, "V1 PWM", "Direct assignment to pulse width of left OSC1"));
104
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 4, 1, "V2 PWM", "Direct assignment to pulse width of left OSC2"));
105
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 5, 1, "V3 PWM", "Direct assignment to pulse width of left OSC3"));
106
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 6, 1, "Cutoff L", "Direct assignment to filter cutoff of left SID"));
107
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 260 + (8 * c), 7, 1, "Volume L", "Direct assignment to volume of left SID"));
108
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 0, 1, "V4 Pitch", "Direct assignment to pitch of right OSC1"));
109
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 1, 1, "V5 Pitch", "Direct assignment to pitch of right OSC2"));
110
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 2, 1, "V6 Pitch", "Direct assignment to pitch of right OSC3"));
111
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 3, 1, "V4 PW", "Direct assignment to pulse width of right OSC1"));
112
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 4, 1, "V5 PW", "Direct assignment to pulse width of right OSC2"));
113
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 5, 1, "V6 PW", "Direct assignment to pulse width of right OSC3"));
114
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 6, 1, "Cutoff R", "Direct assignment to filter cutoff of right SID"));
115
            modControl.add(new SIDSysexParameterControl(button, null, 0, patch, 261 + (8 * c), 7, 1, "Volume R", "Direct assignment to volume of right SID"));
213 tk 116
        }
117
        return modControl;
118
    }
628 adamjking 119
 
213 tk 120
    public static Vector createTRIG(Patch patch) {
628 adamjking 121
        Vector trigControl = new Vector();
213 tk 122
        // Trigger matrix
628 adamjking 123
        for (int c = 0; c < 14; c++) {
696 rutgerv 124
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 0, 1, "OSC1 Left Ch"));
125
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 1, 1, "OSC2 Left Ch"));
126
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 2, 1, "OSC3 Left Ch"));
127
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 3, 1, "OSC1 Right Ch"));
128
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 4, 1, "OSC2 Right Ch"));
129
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 5, 1, "OSC3 Right Ch"));
130
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 6, 1, "ENV1 Attack"));
131
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 320 + (3 * c), 7, 1, "ENV2 Attack"));
132
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 0, 1, "ENV1 Release"));
133
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 1, 1, "ENV2 Release"));
134
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 2, 1, "LFO1 Reset"));
135
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 3, 1, "LFO2 Reset"));
136
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 4, 1, "LFO3 Reset"));
137
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 5, 1, "LFO4 Reset"));
138
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 6, 1, "LFO5 Reset"));
139
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 321 + (3 * c), 7, 1, "LFO6 Reset"));
140
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 0, 1, "WT1 Reset"));
141
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 1, 1, "WT2 Reset"));
142
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 2, 1, "WT3 Reset"));
143
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 3, 1, "WT4 Reset"));
144
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 4, 1, "WT1 Step"));
145
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 5, 1, "WT2 Step"));
146
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 6, 1, "WT3 Step"));
147
            trigControl.add(new SIDSysexParameterControl(simplebutton, null, 0, patch, 322 + (3 * c), 7, 1, "WT4 Step"));
213 tk 148
        }
149
        return trigControl;
150
    }
628 adamjking 151
 
213 tk 152
    public static Vector createWT(Patch patch) {
628 adamjking 153
        Vector wtControl = new Vector();
213 tk 154
        // Wavetable sequencer
628 adamjking 155
        for (int c = 0; c < 4; c++) {
696 rutgerv 156
            wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 364 + (5 * c), 0, 6, "Clock Divider", "Clock divider (sets tempo)"));
157
            wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,  364 + (5 * c), 6, 1, "To Left Ch", "Parameter forwarded to left channel"));
158
            wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,  364 + (5 * c), 7, 1, "To Right Ch", "Parameter forwarded to right channel"));
159
            wtControl.add(new SIDSysexParameterControl(combo, SIDSysexInfo.leadParams, 0, patch, 365 + (5 * c), 0, 8, "Assign", "Parameter assignment"));
160
            wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch,  366 + (5 * c), 0, 7, "Start Pos", "Start position in wavetable"));
161
            wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,  366 + (5 * c), 7, 1, "Pos Ctrl by MP", "Position controlled by modulation path"));
162
            wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 367 + (5 * c), 0, 7, "End Pos", "End position in wavetable"));
163
            wtControl.add(new SIDSysexParameterControl(rotary, null, 0, patch, 368 + (5 * c), 0, 7, "Loop Pos", "Loop position in wavetable"));
164
            wtControl.add(new SIDSysexParameterControl(button, null, 0, patch,  368 + (5 * c), 7, 1, "Oneshot"));
628 adamjking 165
        }
213 tk 166
        // Wavetable data
628 adamjking 167
        for (int c = 0; c < 128; c++) {
696 rutgerv 168
            wtControl.add(new SIDSysexParameterControl(slider, null, 0, patch,  384 + c, 0, 8, Integer.toString(c)));
628 adamjking 169
        }
213 tk 170
        return wtControl;
171
    }
628 adamjking 172
 
213 tk 173
    private static String[] createSrcStr() {
174
        String[] srcStr = new String[256];
628 adamjking 175
        String[] srcNames = SIDSysexInfo.srcNames;
176
        for (int c = 0; c < srcStr.length; c++) {
213 tk 177
            if (c < srcNames.length) {
178
                srcStr[c] = srcNames[c];
628 adamjking 179
            } else if (c > 127) {
180
                srcStr[c] = Integer.toString(c - 128);
181
            } else {
213 tk 182
                srcStr[c] = "";
183
            }
184
        }
185
        return srcStr;
186
    }
187
}