Definition at line 19 of file MidiEncodingTests.cs.
◆ TestContinuousFilter()
void BGC.Tests.MidiEncodingTests.TestContinuousFilter |
( |
| ) |
|
|
inline |
Definition at line 177 of file MidiEncodingTests.cs.
References BGC.Audio.Calibration.Initialize(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
186 frequencyCount: 10000,
218 filterEnvelope:
new SineWave(1.0, 1.0),
229 filterEnvelope:
new SineWave(1.0, 50.0),
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
This implementation is based on a naive adaptation of the BiQuad filter in this pacakge, which is based on the one found in CSCore, which in turn was based on http://www.earlevel.com/main/2011/01/02/biquad-formulas/
Limited duration noise stream
Sine wave stream with specified amplitude, frequency, and initialPhase. One period is cached and the ...
Triangle wave stream with specified amplitude, frequency, and duty-cycle.
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestFlute()
void BGC.Tests.MidiEncodingTests.TestFlute |
( |
| ) |
|
|
inline |
Definition at line 155 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.Synth.InstrumentLookup.GetNote(), BGC.Audio.Calibration.Initialize(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
159 for (
int octave = 2; octave <= 8; octave++)
164 filepath: guitarFile,
167 note: (byte)(12 * octave + 4),
static IBGCStream GetNote(NoteMidiEvent noteEvent, byte set)
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
ReservedSoundSet
Offset to be 0-indexed Source: Complete MIDI Specs General MIDI System Level 1 - Pg 5 - Table 2 ...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestGuitar()
void BGC.Tests.MidiEncodingTests.TestGuitar |
( |
| ) |
|
|
inline |
Definition at line 112 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.Synth.InstrumentLookup.GetNote(), BGC.Audio.Calibration.Initialize(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
116 for (
int octave = 2; octave <= 4; octave++)
121 filepath: guitarFile,
124 note: (byte)(12 * octave + 4),
static IBGCStream GetNote(NoteMidiEvent noteEvent, byte set)
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
ReservedSoundSet
Offset to be 0-indexed Source: Complete MIDI Specs General MIDI System Level 1 - Pg 5 - Table 2 ...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestHiHat()
void BGC.Tests.MidiEncodingTests.TestHiHat |
( |
| ) |
|
|
inline |
Definition at line 298 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.Synth.InstrumentLookup.GetPercussion(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
303 filepath: closedFile,
static IBGCStream GetPercussion(PercussionMap percussion, byte velocity)
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
PercussionMap
Already correctly maps to Frequency Source: Complete MIDI Specs General MIDI System Level 1 - Pg 6 - ...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestLoadSaveMidiBare()
void BGC.Tests.MidiEncodingTests.TestLoadSaveMidiBare |
( |
| ) |
|
|
inline |
◆ TestLoadSaveMidiFull()
void BGC.Tests.MidiEncodingTests.TestLoadSaveMidiFull |
( |
| ) |
|
|
inline |
Definition at line 22 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.MidiEncoding.LoadFile(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.Midi.MidiEncoding.SaveFile().
32 Debug.Log($
"Format: {midiFile.headerInfo.format}");
33 Debug.Log($
"FramesPerSecond: {midiFile.headerInfo.framesPerSecond}");
34 Debug.Log($
"TicksPerFrame: {midiFile.headerInfo.ticksPerFrame}");
35 Debug.Log($
"TicksPerQuarter: {midiFile.headerInfo.ticksPerQuarter}");
36 Debug.Log($
"Tracks: {midiFile.headerInfo.tracks}");
38 Debug.Log($
"Samples Per Tick: {1E-6 * midiFile.tracks[0].Tempo * 44100 / midiFile.headerInfo.ticksPerQuarter}");
45 Assert.IsTrue(File.Exists(saveFile));
static bool SaveFile(string filePath, MidiFile midiFile, bool overwrite=false)
static bool LoadFile(string filePath, out MidiFile midiFile, bool retainAll=false)
Method to load a MIDI file an parse the data
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
◆ TestOrgan()
void BGC.Tests.MidiEncodingTests.TestOrgan |
( |
| ) |
|
|
inline |
Definition at line 133 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.Synth.InstrumentLookup.GetNote(), BGC.Audio.Calibration.Initialize(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
137 for (
int octave = 2; octave <= 7; octave++)
142 filepath: guitarFile,
145 note: (byte)(12 * octave + 4),
static IBGCStream GetNote(NoteMidiEvent noteEvent, byte set)
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
ReservedSoundSet
Offset to be 0-indexed Source: Complete MIDI Specs General MIDI System Level 1 - Pg 5 - Table 2 ...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestPulses()
void BGC.Tests.MidiEncodingTests.TestPulses |
( |
| ) |
|
|
inline |
Definition at line 93 of file MidiEncodingTests.cs.
References BGC.Audio.Calibration.Initialize(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
97 double[] dutyCycles =
new double[] { 0.1, 0.25, 0.5, 0.75, 0.9 };
99 foreach (
double dutyCycle
in dutyCycles)
105 stream:
new SquareWave(1.0, 400, dutyCycle: dutyCycle)
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestRenderMidi()
void BGC.Tests.MidiEncodingTests.TestRenderMidi |
( |
| ) |
|
|
inline |
Definition at line 49 of file MidiEncodingTests.cs.
References BGC.Audio.Calibration.Initialize(), BGC.Audio.Midi.MidiEncoding.LoadFile(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
67 Assert.IsTrue(File.Exists(saveFile));
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
This slow filter scans the whole sample and scales it between +1 and -1 so there is no clipping but m...
static bool LoadFile(string filePath, out MidiFile midiFile, bool retainAll=false)
Method to load a MIDI file an parse the data
Renders an underlying MidiFile
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestRenderToccataMidi()
void BGC.Tests.MidiEncodingTests.TestRenderToccataMidi |
( |
| ) |
|
|
inline |
Definition at line 71 of file MidiEncodingTests.cs.
References BGC.Audio.Calibration.Initialize(), BGC.Audio.Midi.MidiEncoding.LoadFile(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
89 Assert.IsTrue(File.Exists(saveFile));
Manages calibration values and processes
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
This slow filter scans the whole sample and scales it between +1 and -1 so there is no clipping but m...
static bool LoadFile(string filePath, out MidiFile midiFile, bool retainAll=false)
Method to load a MIDI file an parse the data
Renders an underlying MidiFile
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
◆ TestSnare()
void BGC.Tests.MidiEncodingTests.TestSnare |
( |
| ) |
|
|
inline |
Definition at line 283 of file MidiEncodingTests.cs.
References BGC.Audio.Midi.Synth.InstrumentLookup.GetPercussion(), BGC.IO.DataManagement.PathForDataFile(), and BGC.Audio.WaveEncoding.SaveStream().
static IBGCStream GetPercussion(PercussionMap percussion, byte velocity)
Operations for Loading and Saving WAV files Some documentation on the WAV format is available here: h...
PercussionMap
Already correctly maps to Frequency Source: Complete MIDI Specs General MIDI System Level 1 - Pg 6 - ...
static string PathForDataFile(string dataDirectory, string fileName)
Returns the full path for specified datafile in a data directory
static bool SaveStream(string filepath, IBGCStream stream, bool overwrite=false)
Save the samples passed in as a WAVE file with the specified filepath. Returns success.
The documentation for this class was generated from the following file: