Commit Graph

151 Commits

Author SHA1 Message Date
Dale Whinham
3630dc4c17 Combine HD44780 level drawing into single function 2020-11-22 23:16:44 +00:00
Dale Whinham
ae84562702 Show SoundFont name on startup 2020-11-22 23:16:44 +00:00
Dale Whinham
553db85046 Move spinlock and samplerate to SynthBase 2020-11-22 23:16:44 +00:00
Dale Whinham
b5f60b2bbc Extract and store names from SoundFonts 2020-11-22 23:16:44 +00:00
Dale Whinham
896db9e39a Make MT32Synth vars private instead of protected 2020-11-22 23:16:44 +00:00
Dale Whinham
b711b89e74 Add SoundFontSynth LCD update stub method 2020-11-22 23:16:44 +00:00
Dale Whinham
59d978a666 Move SynthLCD pointer/method up into Synth class 2020-11-22 23:16:44 +00:00
Dale Whinham
78db034a9a Rename MT32LCD class to SynthLCD 2020-11-22 23:16:44 +00:00
Dale Whinham
5da2eca00e Add ability to configure default synth 2020-11-22 23:16:44 +00:00
Dale Whinham
2705788391 Add ability to switch between multiple SoundFonts 2020-11-22 23:16:44 +00:00
Dale Whinham
0068cf648d Add templated Quicksort algorithm 2020-11-22 23:16:44 +00:00
Dale Whinham
4f42b42494 Cleanup includes in rommanager.h 2020-11-22 23:16:44 +00:00
Dale Whinham
f5cc7a1b24 Minor cleanups in utility.h 2020-11-22 23:16:44 +00:00
Dale Whinham
a5e1cf4068 Add ability to configure FluidSynth polyphony 2020-11-22 23:16:44 +00:00
Dale Whinham
61759d278c Add FluidSynth synthesizer 2020-11-22 23:16:44 +00:00
Dale Whinham
4c61f66f17 Add power save timeout config option 2020-11-22 23:16:44 +00:00
Dale Whinham
a5fc1a9b79 Enable LCD backlight off on power save mode 2020-11-10 20:18:09 +00:00
Dale Whinham
f1de26bd5c Add basic power management/throttle detection 2020-11-10 20:18:09 +00:00
Dale Whinham
5d9b85bfcf Add missing virtual specifier to mt32synth funcs 2020-11-08 18:24:32 +00:00
Dale Whinham
3e754b6ba4 Minor cleanups to MIDI parser 2020-11-08 18:24:32 +00:00
Dale Whinham
16f0f7db22 Improve layout of 4-line HD44780 LCD 2020-11-08 18:24:32 +00:00
Dale Whinham
588adbf658 Allow LCDs to show temporary system messages
Improve status/error logging on the LCD.

Also fix clearing the screen on reboot by moving the call to Clear() to
the UI core and waiting for the UI core to be done before rebooting.
2020-11-08 18:24:32 +00:00
Dale Whinham
ff060caabe Add ability to set I2C baud rate/clock speed 2020-11-08 18:24:32 +00:00
Dale Whinham
a6e94126e9 Remove prefixes from config variables 2020-11-08 18:24:32 +00:00
Dale Whinham
c4cf9a62c4 Allow deferred SSD1306 framebuffer write on clear 2020-11-08 18:24:32 +00:00
Dale Whinham
aad39d4716 Use timer delay loops for HD44780
Now that the LCD updates are done from a secondary core, the scheduler
is unavailable for implementing timing delays.

Replace them with simple delay loops from the CTimer class.
2020-11-08 18:24:32 +00:00
Dale Whinham
1479f29f56 Protect mt32synth with a spinlock
As multiple cores will now be accessing the synth object, we need to
protect critical sections to avoid crashes.
2020-11-08 18:24:32 +00:00
Dale Whinham
6a61981968 Cleanup includes in mt32synth 2020-11-08 18:24:32 +00:00
Dale Whinham
f5fdd09e30 Remove unneeded FileSystem param from mt32pi.cpp 2020-11-08 18:24:32 +00:00
Dale Whinham
000348b6e7 Remove duplicate NullDevice 2020-11-08 18:24:32 +00:00
Dale Whinham
16b42f10e7 Move audio rendering to another CPU core
Refactor synth code to decouple it from the audio driver and instead use
the drivers' Write() methods to insert rendered audio into a queue from
CPU core 2.
2020-11-08 18:24:32 +00:00
Dale Whinham
aa73c3e5dd Bring up additional CPU cores 2020-11-08 18:24:32 +00:00
Dale Whinham
6e4e0abab3 Remove unneeded FileSystem param from ROM manager 2020-11-08 18:24:32 +00:00
Dale Whinham
e7a8a70fe1 Add support for 64 pixel high SSD1306 displays
Changes to the velocity scaling logic were also made; mt32lcd now
normalizes the MT-32 part velocity to a floating point number between 0
and 1. The LCD driver can then translate this into a bar pixel height as
required.
2020-11-08 18:24:32 +00:00
Dale Whinham
e79897eb9a Add ability to invert display on SSD1306 2020-11-08 18:24:32 +00:00
Dale Whinham
2f7b5bf91f Update font to match real MT-32 (Sanyo DM2011) 2020-10-14 19:34:58 +01:00
Dale Whinham
d530e8e258 Fix missing "none" option for i2c_dac_init 2020-10-11 16:52:49 +01:00
Dale Whinham
8ba9c8a06a General code cleanup
Rename enums, functions parameters and class member variables so that
they match the Circle coding style more closely.

Replace /* ... */ comments with // comments.

Fixup some indentation issues/trailing whitespace.

Remove undefined functions and unused #defines.
2020-10-04 23:28:40 +01:00
Dale Whinham
3ddd9ac7ca Refactor config file parser
Reduce code duplication significantly by employing macros and templates
for parsing strings into enums.

Increase efficiency by adding {BEGIN|END}_SECTION markers in config.def
so that we can avoid unnecessary calls to strcmp() with the section name.
2020-10-04 23:28:40 +01:00
Dale Whinham
97962dd09b Add ability to switch between multiple ROM sets
Introduce a ROM manager that scans a 'roms' directory on startup for all
valid ROMs that mt32emu supports.

If none are found in this directory, fall back on searching for
MT32_{CONTROL|PCM}.ROM in the root of the SD card as before.

Add a custom SysEx command that allows the user to switch ROM sets on
the fly.

Add a new config file option for setting the default ROM set.

Closes #18.
2020-10-04 23:28:40 +01:00
Dale Whinham
86be95e103 Move level meters to upper row of LCD
Closes #15.
2020-10-03 18:53:32 +01:00
Dale Whinham
20c9e5f402 Add ability to configure GPIO MIDI baud rate 2020-10-03 18:23:42 +01:00
Dale Whinham
749bd244d7 Add override keyword to derived GetChunk() funcs 2020-10-03 18:22:29 +01:00
Dale Whinham
03bbdf57bb Fix inverted channels on PWM output
The PWM audio device on most Raspberry Pis expects to receive samples in
R-L order rather than L-R.

We use the AreChannelsSwapped() function of Circle to determine the
correct sample order, although this is not really necessary; currently
all of the models of Pi we support will require R-L sample order.
2020-09-23 21:42:01 +01:00
Dale Whinham
2b7c0e9ca7 Add ability to configure MIDI channel assignment
Closes #31.
2020-09-22 20:59:38 +01:00
Dale Whinham
95d2ad52e4 Fix some cppcheck recommendations 2020-09-22 00:31:41 +01:00
Dale Whinham
c3c38c9ac9 Rename LCD class function parameters
Try to follow the Circle coding style more closely with regards to
function parameter names.
2020-09-19 21:53:43 +01:00
Dale Whinham
061ececf1e Refactor LCD code, add patch change/volume updates 2020-09-19 21:53:21 +01:00
Dale Whinham
f5b51e2b70 Factor out and rewrite MIDI parser
This is a significant rewrite of the MIDI stream parsing code. USB and
serial MIDI streams now both use a common parsing class that maintains
its own state and dispatches valid MIDI events as they arrive.

Some more major fixes for devices that send using Running Status like
the UM-ONE MkII have also been made, and support for all valid MIDI 1.0
messages has been added, even though mt32emu may not use all of them.

Fixes #25 and fixes #26.
2020-09-19 14:56:39 +01:00
Dale Whinham
982933174e Add serial MIDI "thru" for debugging purposes 2020-09-02 22:55:45 +01:00