Giter Site home page Giter Site logo

dsp56300 / gearmulator Goto Github PK

View Code? Open in Web Editor NEW
338.0 22.0 41.0 143.07 MB

Emulation of classic VA synths of the late 90s/2000s that are based on Motorola 56300 family DSPs

Home Page: https://dsp56300.wordpress.com/

License: GNU General Public License v3.0

CMake 1.58% Shell 5.37% Batchfile 0.12% C++ 33.49% C 54.39% Makefile 2.10% Python 0.86% M4 0.12% Java 1.31% HTML 0.06% Common Lisp 0.26% Inno Setup 0.03% Rich Text Format 0.01% QMake 0.02% Awk 0.04% Cython 0.27%
access dsp56300 emulation synthesizers virus waldorf

gearmulator's Introduction

Motorola DSP 56300 family emulator

CMake GPLv3

Emulation of the Motorola/Freescale/NXP 56300 family DSP

This DSP has been used in plenty of virtual analogue synthesizers and other musical gear that was released after around the mid 90s, such as Access Virus A, B, C, TI / Clavia Nord Lead 3 / Waldorf Q, Microwave II / Novation Supernova, Nova and many others.

The emulator should compile just fine on any platform that supports C++17, no configure is needed as the code uses C++17 standard data types. For performance reasons, it makes excessive use of C++17 features, for example to parse opcode definitions at compile time and to create jump tables of template permutations, so C++17 is a strong requirement.

The build system used is cmake.

Development

Please note that this project is a generic DSP emulator and outputs nothing but a static library after building. To use it, you need to create a project on your own, which can be a command line app, a VST plugin or whatever and instantiate the DSP class and feed data into it.

Minimal example:

#include "../dsp56300/source/dsp56kEmu/dsp.h"

int main(int argc, char* argv[])
{
	// Create DSP memory
	constexpr TWord g_memorySize = 0x040000;

	const DefaultMemoryValidator memoryMap;
	Memory memory(memoryMap, g_memorySize);

	// External SRAM starts at 0x20000
	memory.setExternalMemory(0x020000, true);

	// TODO: Load useful data into memory like this
	// Example: write a nop to P memory at address $100
	// memory.set(MemArea_P, 0x100, 0x000000);

	// Use 56362 peripherals: ESAI, HDI08
	Peripherals56362 periph;

	// Instantiate DSP
	DSP dsp(memory, &periph, &periph);

	// set starting address
	dsp.setPC(0x100); 

	while(true)
	{
		// run forever
		dsp.exec();
	}
}

gearmulator's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gearmulator's Issues

Parameter crosstalk between filter and vocoder section!

Hello :)

First this is a really great project. Sold my Virus C some years ago, so this is very welcome. Thanks for the hard work and making this available.

Here are a few things I noticed when playing around with the plugin and Virus C emulation:

Filter and vocoder crosstalk between parameters:

  • Filter balance affects source balance in the vocoder section.
  • Filter envelope sustain time affects spectral balance in the vocoder section.
  • Filter envelope release affects vocoder bands in the vocoder section.
  • Filter envelope attack affects vocoder attack in the vocoder section.
  • Filter envelope decay affects vocoder decay in the vocoder section.
  • Cutoff 1 parameter affects center frequency in the vocoder section.
  • Resonance 1 parameter affects q factor in the vocoder section.
  • Keytrack 1 parameter affects spread in the vocoder section.

And vice versa, the crosstalk goes both ways.

Just thought I'd mention it.

Best wishes,
Jakob

<@492052246079733761>,<#841809045505703956>,I think I figured it out: If I select my midi input in the “Instrument Track”, which is by default all. It sets it in the VST window as well. If I disconnect it in the Instrument Track it keeps connected in the VST window. So if I trigger my specific midi controller (using a Akai Mpk mini Mk2 for this) and play another Instrument Track it sends the midi notes into the emulator. Presume that this option should be a standalone option and somehow disabled and linked to host automatically. I know how to bypass it atm, so no hurry, but maybe it is something to consider,[Jump To](https://discordapp.com/channels/829099347975208970/841809045505703956/944119729822519316)

<@492052246079733761>,<#841809045505703956>,I think I figured it out:
If I select my midi input in the “Instrument Track”, which is by default all.
It sets it in the VST window as well. If I disconnect it in the Instrument Track it keeps connected in the VST window.
So if I trigger my specific midi controller (using a Akai Mpk mini Mk2 for this) and play another Instrument Track it sends the midi notes into the emulator.
Presume that this option should be a standalone option and somehow disabled and linked to host automatically.

I know how to bypass it atm, so no hurry, but maybe it is something to consider,Jump To

Sysex implementation issues

Hi everyone!

I'm working on editor/librarian on Lemur app (ipad/android devices) and i found some wrong responses to midi sysex received on emulator or not found parameters. Here is the list of pb :

  • filter keytrack base : show "no choice", no reaction to incoming midi sysex parameter changes

  • filter select (f1, f2, f1+f2) no reaction to incoming midi sysex parameter changes

  • filter : env pos/neg polarity, no selection of "-" button to incoming midi sysex parameter changes for 0 (for + it's good)

  • osc1 et osc 2 wave selection is wav 3 to wav64. not starting from wav2...

  • fx common : "input RIngModulator" parameter not found in emulator editor

  • fx : in reverb mode "clock" parameter not found in emulator editor, 'feedback should not be present in this mode)

  • input select changes crash cubase 11 in win10

  • sub osc show a saw symbol, it's a triangle symbol and showing inversion selection to incoming midi sysex parameter changes (it's 0 for sqr, 1 for tri)

  • for lfo 1, 2 & 3, "poly/ mono" parameter, it's inverted response to incoming midi sysex to change emulator parameter (it's 0 for poly, 1 for mono)

  • arp clock : there is no off position on OS manual (range 1->17)

  • bend up parameter and band down range is -64 -> 63 values and not showing to react correctly on sysex midi in changes for this parameters.

  • name 'slot 1'/ assign 1 inverted with name 'slot 3'/ assign 3, and

  • wrong response on sysex messages to changes parameters for section assigns:

  • send sysex to change source assign 3 changes source assign2.

  • send sysex to change dest1 assign 3 changes dest1 assign2.
    (same with amount dest1 ass3 changes amount dest1 assign2)

  • send sysex to change dest2 assign 3 changes dest2 assign2.
    (same with amount dest2 assign3 changes amount dest2 assign2)

  • send sysex to change source assgn2 change source asssign3.

  • send sysex to change dest1 assgn2 change dest1 asssign3.

  • send sysex to change dest2 assgn2 change dest2 asssign3.

Hope this can help.

https://discord.com/channels/829099347975208970/889619013817217034/936966492573028402

libDSP* is not recognized by DAW

Tried this in reaper 6.47 and ardour 6.

In ardour6, the plugin manager has a loading console to see loading messages of plugins. With libDSP*, it starts loading the voices and reaches VSTPluginMain, then at__libc_start_main it says Scan Failed

This is with 1.2.4_alpha_testing-89-gbe5dbe3

Amp Env broken after using INPUT preset

Describe the issue

Amp envelope stops working. Release flops at ends of long notes

To reproduce

  1. Load the preset ">>INPUT<<".
  2. Load any other preset and check Amp Attack/Release behavior.

Touching "Input Mode" in the settings returns the amp to its normal state.

Configuration

  • DSP563xx Emulator Virus Edition v1.2.5 AU
  • MacBook Air M1
  • macOS Monterey 12.0.1
    (I had experienced the issue in Win as well)

// comments in parameterDescriptions_C.json cause crashes on Mac

Thanks for the great work!

I compiled the sources, which went smoothly, but running
the app or loading the AU, VST, … in a DAW caused crashes.
I debugged on Mac with Xcode/lldb and found out that the crashes
occur inside the routine that loads

source/jucePlugin/parameterDescriptions_C.json

since there are C++ comments (// …) in the json file.
Removing all // comments (which I think are not allowed in json)
solves the problem and then everything works fine.

Thus, I suggest to remove the // comments from the json file.

Leaked UI Object

Tested on macOS

*** Leaked objects detected: 16 instance(s) of class DrawableText
JUCE Assertion failure in juce_LeakedObjectDetector.h:92
*** Leaked objects detected: 16 instance(s) of class Drawable
JUCE Assertion failure in juce_LeakedObjectDetector.h:92
*** Leaked objects detected: 32 instance(s) of class Font
JUCE Assertion failure in juce_LeakedObjectDetector.h:92
*** Leaked objects detected: 16 instance(s) of class Component
JUCE Assertion failure in juce_LeakedObjectDetector.h:92
*** Leaked objects detected: 16 instance(s) of class MouseCursor
JUCE Assertion failure in juce_LeakedObjectDetector.h:92
Program ended with exit code: 0

<@234355837009657857>,<#841809045505703956>,When you have a MIDI Track with GM Prog selected, Emu selects this PROG for u, but GUI is not updated, nor you know which preset is used? This sounds like a BUG for me?,[Jump To](https://discordapp.com/channels/829099347975208970/841809045505703956/952197601602732072)

<@234355837009657857>,<#841809045505703956>,When you have a MIDI Track with GM Prog selected, Emu selects this PROG for u, but GUI is not updated, nor you know which preset is used?

This sounds like a BUG for me?,Jump To

When saving and loading a single preset, semitone is off-by-one

When saving a patch with the save button on top, and then loading the patch, the semitone of -1 for some of the osc (might be all). I suspect there might be more off-by-one issues with saving/loading patches.

I think it is in the saving stage, not loading.

Version: v1.2.10
Platform: MacOS and Windows (Linux not tested)
DAW: Bitwig
ROM: Virus C 6v6

<@935213446394437642>,<#841809045505703956>,thank you very much for v.1.2.8 . just for the record, with this version, receiving midi cc generated by controllers constantly fails. it's not about lag, but in a movement of a knob, sometimes the dsp stops receiving the messages,[Jump To](https://discordapp.com/channels/829099347975208970/841809045505703956/947552103230996500)

<@935213446394437642>,<#841809045505703956>,thank you very much for v.1.2.8 . just for the record, with this version, receiving midi cc generated by controllers constantly fails. it's not about lag, but in a movement of a knob, sometimes the dsp stops receiving the messages,Jump To

Live 11.0.10 - Plugin stops working on reload, track duplication, or loading from .vstpreset

I've found that the latest 1.2.0 build posted by lol_catz on the Discord on 10/1 has several conditions under which the plugin appears to stop working in Live. I'm running Windows 10 and using the VST3 with the Virus C 6.5 ROM, although I did not find that using the VST2 produced any different behavior.

All of these tests resulted in a situation where the plugin output no audio (although it used CPU) - switching patches had no effect. Every test was in Single Mode, although switching to Multi Mode after loading doesn't change the behavior either.

  1. Duplicating a track with the plugin
  2. Loading the plugin via a .vstpreset file
  3. Reloading a project with the plugin on a track

I don't recall number 3 being an issue in the past but it's occurring repeatedly for me now. I once had the plugin load from an Instrument Rack preset successfully but playing 50 cents flat - I have been unable to reproduce that behavior, though, as it simply doesn't play after loading.

The first project has three tracks; one where the track had the plugin loaded directly (worked before project reload), one where the track was duplicated (never worked), and one where the track was loaded from a .vstpreset (never worked). The second project only has one track in which the plugin was loaded directly.

Test projects

Feel free to let me know if there's anything else I can test or any further detail I can provide.

<@898585638507532379>,<#841809045505703956>,Hi guys! After closing the window and opening it again, the list of presets disappears and it is not visible which bank is loaded and which preset from this bank is currently active. It is very inconvenient, you do not understand where you are now. Can you make it remember what is currently selected and show it?,[Jump To](https://discordapp.com/channels/829099347975208970/841809045505703956/943205625029099530)

<@898585638507532379>,<#841809045505703956>,Hi guys! After closing the window and opening it again, the list of presets disappears and it is not visible which bank is loaded and which preset from this bank is currently active. It is very inconvenient, you do not understand where you are now. Can you make it remember what is currently selected and show it?,Jump To

Unstable behavior

Describe the issue

Voices are muted. When a preset is complex with FX etc. this sounds like extra non-switchable LFO

To reproduce

  1. Prepare any midi clip with fast arpeggio for midi input.
  2. Load the preset "- START -".
  3. Set the Amp Release parameter to 65 (middle)
  4. Click to unison voices for change key focus.
  5. Change unison voices by the arrow keys, keeping keys pressed for a quick change.
  6. Keep changing until half of notes disappears.

Unstable behavior persists even when switching presets. Only reloading the plugin fixes this.

Configuration

  • DSP563xx Emulator Virus Edition v1.2.5 AU
  • MacBook Air M1
  • macOS Monterey 12.0.1
    (I had experienced the issue in Win as well)

Stereo output is inverted

<@929683873640620043>,<#841809045505703956>,I've also noticed that when I use the FX plugin on a sound, it changes the polarity of the stereo,Jump To

VST presets not always loaded correctly

Repro:

  • Cubase 11, VST2
  • Save some presets, mix multi and single modes
  • Open Cubase preset browser and switch presets
  • notice that sounds are not always as expected

Parameter State is not getting saved in single mode

The parameter state is not getting saved in single mode. It appears to work in multi mode, however in single mode this functionality is broken..

Reproduce:
Open new project, load plugin, switch to single mode, load init patch, tweak patch, close and save project.
Open project, init patch comes up, but tweaks are lost.

Standalone cannot play in Multi Mode

Not sure if a known issue, but the Standalone build (which for me is by far the most stable, no xruns) is unable to produce audio when switched to Multi Mode.

Single works great.

When changing parameter value via knob for the first time after changed preset, it always sound like a jump from a value that was set by the previous preset

<@931542171235004426>,<#841809045505703956>,Bug: When changing parameter value via knob for the first time after changed preset, it always sound like a jump from a value that was set by the previous preset.
Please confirm that i explained it clear
For example if i turn the filter 100% down in the current preset, then change the preset where filter is set to 50% and trying to adjust it, it will sound like a jump from 100% to 50%
like a fast sweep,Jump To

Don't use `lxvst` path on Linux

The VST2 packages for Linux contain the path /usr/local/lib/lxvst which no other distro or packagers use.
(exception is flathub which are somehow unwilling to use any common standards)

Please just use the standard /usr/local/lib/vst.

NKS save only recalling the first preset.

Recalling an NKS preset that was saved only loads the first preset regardless of which preset was active when the NKS preset was saved. In other words, the plugin does not seem to save the complete state of itself. I think this may referred to as "making all the parameters visible to the instrument/vst." I understand this isn't really an issue when using the plugin alone, but it probably presents itself in other situations like recalling a saved song from a DAW where you expect the same configuration/presets on your plugins to recalled.

I plan on making an NKS bank with sound previews available for the public at the NKS User Forums for the virus_cl_061_release.bin if this is able to be implemented.

fix parameters cutoff 2

cutoff2 has two modes: (B 41 (0x29))

  • 0-127 (unlinked)
  • -64 <0> +64 (linked)

based on the cutoff2 link mode (B 32 (0x20))

potential VST3 packaging issues

I spent some time getting all of this working under Linux with Reaper (also Ardour and Carla) and ran into what I think are some issues with the way the VST3 plugin is being packaged and distributed. By simply installing the .deb package on my Debian testing system for the VST3 version of the Linux native plugin, none of my VST hosts were seeing the VST3 version of the plugin. However, once I created a similar directory structure I've seen used in other VST3 plugins under Linux, I was able to successfully load the VST3 plugin, albeit with some additional weirdness, which I will clarify below.

The working layout I finally stumbled upon combined the installed Debian package with pieces in my home directory. I imagine that creating a similar layout directly under /usr/local/lib/vst3 would probably work as well. Either way, simply specifying /usr/local/lib/vst3 immediately after installing the VST3 package wasn't working without doing the rest of this.

I did the following:

mkdir -p ~/.vst3/DSP56300Emu.vst3/Contents/x86_64-linux
ln -s /usr/local/lib/vst3/DSP56300Emu.so ~/.vst3/DSP56300Emu.vst3/Contents/x86_64-linux

This got me a working plugin, but missing the ROM files. The weirdness I mentioned earlier was that I finally discovered that I needed to put either of my available B or C .bin ROM files in ~/.vst3 directly for them to be discovered, rather than placing them anywhere under ~/.vst3/DSP56300Emu.vst3 or even ~/DSP56300 Emulator as I might have expected. Related to that, there was also no immediately obvious way to swap between the two through the user interface. And since they only seem to load correctly when placed in ~/.vst3, swapping between the two requires some manual intervention to move those files around in that directory, which seems less than ideal (and also seems to prevent the ability to load both at the same time potentially).

Past that, I also saw some rather heavy idle CPU usage from both the VST2 and VST3 versions. I saw MIPS numbers being spit out at one point when trying to debug all of the above, so I'm guessing that's the actual emulated DSP being run which is eating up CPU even when "idle". Not sure if this is something that can be improved or will always be an issue with the way this is being emulated.

Anyway, thought I'd at least report this here in case anyone else stumbles across any of this. Maybe I'm just doing something entirely wrong. If not, maybe some of this can be addressed moving forward.

Regardless, this sounds FANTASTIC!

LV2 plugin format

You could've expected this coming :)

LV2 is a liberally licensed open-source plugin format that is extensible to application specific features and there has seen an increase of cross-platform hosts that support it over the last years.
Could be quite useful for an emulator I'd say: https://lv2plug.in/pages/why-lv2.html

<@333677567100059649>,<#841809045505703956>,saving a preset in multimode seems to reliably crash the VST (midi stalls on sequencer side, every chan, and no sound output, until i fully restart the sequencer),[Jump To](https://discordapp.com/channels/829099347975208970/841809045505703956/956871667991347271)

<@333677567100059649>,<#841809045505703956>,saving a preset in multimode seems to reliably crash the VST (midi stalls on sequencer side, every chan, and no sound output, until i fully restart the sequencer),Jump To

gcc11 build failure

It would seem that the headers have changed between gcc versions (as confirmed by Hurlitzer on discord) and an #include <cstddef> is missing in certain places.

Namely, synthLib/audiobuffer.h:

cd /home/user/Documents/Dev/gearmulator/temp/cmake_linux/source/synthLib && /usr/bin/c++ -DRELEASE -I/home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/.. -I/home/user/Documents/Dev/gearmulator/source/dsp56300/source/asmjit/src -msse -O3 -fPIC -pthread -DASMJIT_STATIC -std=gnu++17 -MD -MT source/synthLib/CMakeFiles/synthLib.dir/audiobuffer.cpp.o -MF CMakeFiles/synthLib.dir/audiobuffer.cpp.o.d -o CMakeFiles/synthLib.dir/audiobuffer.cpp.o -c /home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.cpp
In file included from /home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.cpp:1:
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:12:30: error: ‘size_t’ has not been declared
   12 |                 void reserve(size_t _capacity);
      |                              ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:13:29: error: ‘size_t’ has not been declared
   13 |                 void resize(size_t _capacity);
      |                             ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:15:44: error: ‘size_t’ has not been declared
   15 |                 void append(float** _data, size_t _size);
      |                                            ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:17:29: error: ‘size_t’ has not been declared
   17 |                 void remove(size_t _count);
      |                             ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:19:54: error: ‘size_t’ has not been declared
   19 |                 void fillPointers(float** _pointers, size_t _offset = 0);
      |                                                      ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:20:17: error: ‘size_t’ does not name a type
   20 |                 size_t size() const;
      |                 ^~~~~~
/home/user/Documents/Dev/gearmulator/source/synthLib/audiobuffer.h:3:1: note: ‘size_t’ is defined in header ‘<cstddef>’; did you forget to ‘#include <cstddef>’?
    2 | #include <vector>
  +++ |+#include <cstddef>
    3 | 

And opcodeinfo.h, but that I will report to the other project in a second:

cd /home/user/Documents/Dev/gearmulator/temp/cmake_linux/source/dsp56300/source/dsp56kEmu && /usr/bin/c++ -DRELEASE -I/home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/.. -I/home/user/Documents/Dev/gearmulator/source/dsp56300/source/asmjit/src -msse -O3 -fPIC -pthread -DASMJIT_STATIC -std=gnu++17 -MD -MT source/dsp56300/source/dsp56kEmu/CMakeFiles/dsp56kEmu.dir/disasm.cpp.o -MF CMakeFiles/dsp56kEmu.dir/disasm.cpp.o.d -o CMakeFiles/dsp56kEmu.dir/disasm.cpp.o -c /home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/disasm.cpp
In file included from /home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/opcodes.h:6,
                 from /home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/disasm.cpp:1:
/home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/opcodeinfo.h: In function ‘constexpr uint32_t dsp56k::createMask(const char (&)[25], char, char)’:
/home/user/Documents/Dev/gearmulator/source/dsp56300/source/dsp56kEmu/opcodeinfo.h:14:21: error: ‘size_t’ was not declared in this scope; did you mean ‘std::size_t’?
   14 |                 for(size_t i=0; i<len; ++i)
      |                     ^~~~~~
      |                     std::size_t

No errors are reported when using gcc10 instead.
Adding includes in these two places makes the build pass on gcc11, and it still works on gcc10.

If that looks good to you I can submit a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.