flat assembler
Message board for the users of flat assembler.
Index
> MenuetOS > Midi synth/sequencer |
| Author |
|
|
bzt 08 Dec 2025, 17:39
MenuetOS always amazes me! Awesome. I have a question though.
Ville wrote: You can use upto 256 instruments But my real question is, how do you generate the PCM waveforms for these instruments? I can see on the left screenshot that wave banks are tweakable, but how do you get them in the first place? Do you use a sound font? Or did you also port some synthetizer like fluidsynth or an OPL emulator? Or did you just wrote an arbitrary wave generator with customizable parameters? Either way, very very impressive! MIDI playback without a dedicated hardware is quite some feat! (Actually my Linux box with the latest MuseScore and Rosegarden software is not up to the task of playing MIDI files... I had to grab a quick-and-dirty player source with built-in OPL emulator from github and compile that myself) |
|||
|
|
Ville 09 Dec 2025, 14:56
There are different ways to map the synthesizers instrument from the midi track.
1) By midi channel and note position (keyboard split). 2) By tracks instrument setting and note position. 3) Using General Midi mapping, where drum midi channel 10 instruments (35 bass drum - 81 triangle) are mapped to synth instruments 135-181, so you dont have to worry about splitting the keyboard for each drum. You can select which mapping to use from the drop-down menu. The audio-wave is generated from 1) Waveform generator, which generates waves from preset options, like basic sine, square, sawtooth etc. with additive synthesis. 2) Waveform file from usb stick or hd. Parameters (envelope, wave settings, phase, pan, etc) are set by user for each instrument. Playing the notes is pretty straight forward. Notes are just fetched in time order and the synth/sampler instrument is selected based on the above rules. The wave-form is written to the audio buffer according to instruments pan, volume, phase, envelope settings, etc. This happens in real-time, writing the notes to audio buffer a few seconds ahead of current play position, so you can modify the synth/mixer settings in real-time while playing. (I wrote all code.) btw, I wish they would have kept the easy to approach protocol for Midi 2.0 and simply multiplied the bit-widths and added new features as system exclusive messages. But I quess thats a different conversation |
|||
|
|
bzt 10 Dec 2025, 10:20
Ville wrote: Waveform generator, which generates waves from preset options, like basic sine, square, sawtooth etc. with additive synthesis. 1. Soundfont is a collection of parameters for a standardized set of synth methods (typical example fluidsynth) 2. OPL is a software emulation of the YM3812 / YM262 / etc. chips, so here an instrument is a set of register values (for example, but ymfmidi reads the actual register values from this file) 3. Custom waveform generator (for example like this player) With all these, you have some kind of "presets" to combine and transform basic waveforms. The difference is how this is implemented. For 1. you have some high level abstraction and variable length parameter records, for 2. you have fixed sized records with register values, and for 3. well, custom, so whatever. (FYI IMHO option 1. is unnecessarily overcomplicated should be avoided, 2. is the best compromise between quality and complexity, but only needed if recreating that old Adlib/SoundBlaster vibe is the aim, therefore most of the time option 3. is more than sufficient.) Ville wrote: Waveform file from usb stick or hd. |
|||
|
|
Ville 11 Dec 2025, 18:05
The waveform generator is a custom synthesizer, which is likely closest to OPL. The synthesizer reads parameters from user definable registers, which control how oscillators and all other wave properties behave. And the parameters are saved as fixed length record for all instruments.
bzt wrote: 2. is the best compromise between quality and complexity So yes, Ive came to the same conclusion |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.