public ITI(string filename)
        {
            impi fil = new impi();
            // FIXME: Possible re-use
            this.noteName = MidiHelper.OctaveMacro();

            using (FileStream rop = new FileStream(
                filename,
                FileMode.Open,
                FileAccess.Read,
                FileShare.ReadWrite))
                using (BinaryReader bob = new BinaryReader(rop))
            {
                byte[] mal = bob.ReadBytes(Marshal.SizeOf(fil));
                this.iti_instrument = IOHelper.xread<impi>(fil,mal);
                // Get Samples
                {
                    impx[] samp = new impx[iti_instrument.impNumberOfSamples];
                    for (int i = 0; i < iti_instrument.impNumberOfSamples;i++)
                        samp[i] = IOHelper.xread<impx>(
                            samp[i],
                            bob.ReadBytes(Marshal.SizeOf(samp[i]))
                        );
                    this.ITI_SMPH = samp;
                }

                bob.Close();
                rop.Close();
                mal = null;
            }
        }
Exemple #2
0
        public ITI(string filename)
        {
            impi fil = new impi();

            // FIXME: Possible re-use
            this.noteName = MidiHelper.OctaveMacro();

            using (FileStream rop = new FileStream(
                       filename,
                       FileMode.Open,
                       FileAccess.Read,
                       FileShare.ReadWrite))
                using (BinaryReader bob = new BinaryReader(rop))
                {
                    byte[] mal = bob.ReadBytes(Marshal.SizeOf(fil));
                    this.iti_instrument = IOHelper.xread <impi>(fil, mal);
                    // Get Samples
                    {
                        impx[] samp = new impx[iti_instrument.impNumberOfSamples];
                        for (int i = 0; i < iti_instrument.impNumberOfSamples; i++)
                        {
                            samp[i] = IOHelper.xread <impx>(
                                samp[i],
                                bob.ReadBytes(Marshal.SizeOf(samp[i]))
                                );
                        }
                        this.ITI_SMPH = samp;
                    }

                    bob.Close();
                    rop.Close();
                    mal = null;
                }
        }
Exemple #3
0
 static public string GetSampleHeader(impx smp)
 {
     return(string.Format(
                iti_smp_header_fmt,
                smp.impsC5Speed, smp.impsCvt, smp.impsDfP,
                smp.impsFlag, smp.impsGlobalVolume,
                smp.impsLength, smp.impsLoopBegin, smp.impsSusLoopEnd,
                smp.impsVibDepth, smp.impsVibRate, smp.impsVibSpeed,
                smp.impsVibType
                ));
 }
Exemple #4
0
        public ITI(string filename)
        {
            impi fil = new impi();

            this.nn = octMac();
            FileStream   rop = new FileStream(filename, FileMode.Open, FileAccess.Read);
            BinaryReader bob = new BinaryReader(rop);

            byte[] mal = bob.ReadBytes(Marshal.SizeOf(fil));
            this.iti_instrument = (impi)mread(fil, mal);

            impx[] samp = new impx[] {};
            Array.Resize(ref samp, iti_instrument.impNumberOfSamples);
            for (int i = 0; i < iti_instrument.impNumberOfSamples; i++)
            {
                samp[i] = (impx)mread((impx)samp[i], bob.ReadBytes(Marshal.SizeOf(samp[i])));
            }
            this.ITI_SMPH = samp;
            bob.Close(); rop.Dispose();
            mal = null;
        }
 public static string GetSampleHeader(impx smp)
 {
     return string.Format(
         iti_smp_header_fmt,
         smp.impsC5Speed,		smp.impsCvt,		smp.impsDfP,
         smp.impsFlag,			smp.impsGlobalVolume,
         smp.impsLength,			smp.impsLoopBegin,	smp.impsSusLoopEnd,
         smp.impsVibDepth,		smp.impsVibRate,	smp.impsVibSpeed,
         smp.impsVibType
     );
 }