6321N/A * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. 829N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 829N/A * This code is free software; you can redistribute it and/or modify it 829N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 829N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 829N/A * This code is distributed in the hope that it will be useful, but WITHOUT 829N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 829N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 829N/A * version 2 for more details (a copy is included in the LICENSE file that 829N/A * accompanied this code). 829N/A * You should have received a copy of the GNU General Public License version 829N/A * 2 along with this work; if not, write to the Free Software Foundation, 829N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 829N/A * Software Synthesizer MIDI channel class. 829N/A * @author Karl Helgason 829N/A // Controller Destination Settings 1991N/A // x = -1 means that there where no available voice 1991N/A // last time we called findFreeVoice 1991N/A // and it hasn't changed because no audio has been 1991N/A // rendered in the meantime. 1991N/A // Therefore we have to return -1. 829N/A // No free voice was found, we must steal one 829N/A // DLS Static Voice Allocation 829N/A // * priority ( 10, 1-9, 11-16) 829N/A // Search for channel to steal from 829N/A // Search for oldest voice in off state on steal_channel 829N/A // Search for oldest voice in on state on steal_channel 829N/A // Default Voice Allocation 829N/A // * Find voice that is on 829N/A // and Find voice which has lowest voiceID ( oldest voice) 829N/A // * Or find voice that is off 829N/A // and Find voice which has lowest voiceID ( oldest voice) 829N/A // Search for oldest voice in off state 829N/A // Search for oldest voice in on state 829N/A // Voice is active , we must steal the voice 1990N/A /* A special noteOn with delay parameter, which is used to 1990N/A * start note within control buffers. 829N/A SoftPerformer[] performers = current_instrument.getPerformers(); 829N/A for (int i = 0; i < performers.length; i++) { 829N/A SoftPerformer p = performers[i]; 829N/A if (p.keyFrom <= tunedKey && p.keyTo >= tunedKey) { 829N/A if (p.velFrom <= velocity && p.velTo >= velocity) { 829N/A if (p.exclusiveClass != 0) { 829N/A int x = p.exclusiveClass; 829N/A for (int j = 0; j < voices.length; j++) { 829N/A && voices[j].channel == channel 829N/A && voices[j].exclusiveClass == x) { 829N/A if (!(p.selfNonExclusive 829N/A && voices[j].note == noteNumber)) 829N/A voiceNo = findFreeVoice(voiceNo); 829N/A initVoice(voices[voiceNo], p, prevVoiceID, noteNumber, 1170N/A // We must also check stolen voices 829N/A // Try play back note-off triggered voices, 829N/A controlled parameter (pp)|range (rr)| Description |Default 829N/A -------------------------|----------|-------------------------|------- 829N/A 00 Pitch Control | 28H..58H | -24..+24 semitones | 40H 829N/A 01 Filter Cutoff Control | 00H..7FH | -9600..+9450 cents | 40H 829N/A 02 Amplitude Control | 00H..7FH | 0..(127/64)*100 percent | 40H 829N/A 03 LFO Pitch Depth | 00H..7FH | 0..600 cents | 0 829N/A 04 LFO Filter Depth | 00H..7FH | 0..2400 cents | 0 829N/A 05 LFO Amplitude Depth | 00H..7FH | 0..100 percent | 0 829N/A CC# | nn | Name | vv | default | description 829N/A-----|------|-------------------------|----------------|------------|------------------------------- 829N/A7 |07H |Note Volume |00H-40H-7FH |40H |0-100-(127/64)*100(%)(Relative) 829N/A10 |0AH |*Pan |00H-7FH absolute|Preset Value|Left-Center-Right (absolute) 829N/A33-63|21-3FH|LSB for |01H-1FH | | 829N/A72 |48H |Release Time |00H-40H-7FH |40H (???) | 829N/A73 |49H |Attack Time |00H-40H-7FH |40H (???) | 829N/A74 |4AH |Brightness |00H-40H-7FH |40H (???) | 829N/A75 |4BH |Decay Time |00H-40H-7FH |40H (???) | 829N/A76 |4CH |Vibrato Rate |00H-40H-7FH |40H (???) | 829N/A77 |4DH |Vibrato Depth |00H-40H-7FH |40H (???) | 829N/A78 |4EH |Vibrato Delay |00H-40H-7FH |40H (???) | 829N/A91 |5BH |*Reverb Send |00H-7FH absolute|Preset Value|Left-Center-Right (absolute) 829N/A93 |5DH |*Chorus Send |00H-7FH absolute|Preset Value|Left-Center-Right (absolute) 829N/A120 |78H |**Fine Tuning |00H-40H-7FH |40H (???) | 829N/A121 |79H |**Coarse Tuning |00H-40H-7FH |40H (???) | 829N/A Map<String, int[]>co_midi_rpn_rpn_i = new HashMap<String, int[]>(); 829N/A Map<String, double[]>co_midi_rpn_rpn = new HashMap<String, double[]>(); 829N/A Map<String, int[]>co_midi_nrpn_nrpn_i = new HashMap<String, int[]>(); 829N/A Map<String, double[]>co_midi_nrpn_nrpn = new HashMap<String, double[]>(); 829N/A // This produce asin-like curve 829N/A // as described in General Midi Level 2 Specification, page 6 829N/A case 64:
// Hold1 (Damper) (cc#64) 829N/A for (int i = 0; i < portamento_lastnote.length; i++) 829N/A portamento_lastnote[i] = -1; 829N/A case 66:
// Sostenuto (cc#66) 829N/A // Should only return lower 7 bits, 829N/A // even when controller is "boosted" higher. 829N/A System.out.println("(" + channel + ").nrpnChange(" 829N/A + Integer.toHexString(controller >> 7) 829N/A + " " + Integer.toHexString(controller & 127) 829N/A + ", " + Integer.toHexString(value >> 7) 829N/A + " " + Integer.toHexString(value & 127) + ")"); 829N/A System.out.println("(" + channel + ").rpnChange(" 829N/A + Integer.toHexString(controller >> 7) 829N/A + " " + Integer.toHexString(controller & 127) 829N/A + ", " + Integer.toHexString(value >> 7) 829N/A + " " + Integer.toHexString(value & 127) + ")"); 829N/A for (
int i =
0; i <
128; i++) {
829N/A for (
int i =
0; i <
128; i++) {
829N/A // see DLS 2.1 (Power-on Default Values) 829N/A // don't reset tuning settings 829N/A // Omni is not supported by GM2