Subversion Repositories svn.mios

Rev

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