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 * A SoundFont 2.04 soundbank reader. 829N/A * Based on SoundFont 2.04 specification from: 829N/A * @author Karl Helgason 829N/A // version of the Sound Font RIFF file 829N/A // Sound Font Bank Name 829N/A // Date of Creation of the Bank 829N/A // Sound Designers and Engineers for the Bank 829N/A // Product for which the Bank was intended 829N/A // The SoundFont tools used to create and alter the bank 829N/A // The Sample Data loaded from the SoundFont 829N/A "Input stream is not a valid RIFF stream!");
829N/A "Input stream is not a valid SoundFont!");
829N/A //chunk.read(sampleData); 829N/A //chunk.read(sampleData24); 829N/A // Preset Header / Instrument 829N/A // Preset Zones / Instruments splits 829N/A // Offset should be 0 (but just case) 829N/A // Preset Modulators / Split Modulators 829N/A // Preset Generators / Split Generators 829N/A // Instrument Header / Layers 829N/A // Instrument Zones / Layer splits 829N/A // Offset should be 0 (but just case) 829N/A // Instrument Modulators / Split Modulators 829N/A // Instrument Generators / Split Generators 829N/A sample.data = new ModelByteBuffer(sampleData, (int)(start*2), 829N/A (int)((end - start)*2)); 829N/A if (sampleData24 != null) 829N/A sample.data24 = new ModelByteBuffer(sampleData24, 829N/A (int)start, (int)(end - start)); 829N/A smpl_chunk.write(data.array(), 829N/A sm24_chunk.write(data.array(), 829N/A // One generator is used to reference to instrument record 829N/A // One generator is used to reference to instrument record