ER-301 Emulator for Linux and macOS

Those scripts will definitely be helpful! Thank you!

How is the encoder on the emulator supposed to work. I was using my mouse scroll wheel but it seemed pretty coarse. Is there a modifier key?

Not so easy to get rid of Gandalf. Even shadow and flame only took him out temporarily. :joy:

Hmm. I wonder if different mice will give different scroll speeds? The arrow keys are also mapped. Also, I assume you are referring more to when you are wiggling parameters and not when you are scrolling around in the GUI? If so, the fine/coarse/super fine/super coarse behaviors work:

When focused on a parameter:

  1. Use A to toggle between fine/coarse modes.
  2. Hold the N key (SHIFT) while turning your mouse wheel (or using the arrow keys) to activate the super fine (or super coarse) mode.
1 Like

Let me know if that works. Your console log from the debian attempt is certainly looking odd. Errors in places that are known to work…:thinking:

I am interested in trying github’s issues. So, yes!

Correct, seems normal enough when navigating. When wiggling, for example, the phase control on the Sine Osc in coarse mode, I get values of

0.0
0.11
0.25
0.39
0.53
0.67
etc.

Same values on the fdbk control. Going back the other direction in coarse mode I don’t land on 0.0 but on -0.03. Seems like on the hardware in coarse mode I get 0.1 increments.

However, now that I see supercoarse/coarse/fine/superfine work the same way as on the hardware, I can get to the values I need to.

1 Like

I see the same behavior. I’ll see if I can improve the situation.

1 Like

Vagrant VM might just be the way to go, I tried running the emulator in docker but for the life of me could not get the window to display in OSX.

Edt: Running Ubuntu in VirtualBox is brutally slow on my machine… might have to give docker another shot.

Edit2: YISS

fonts not working but hey it’s a start

1 Like

So no one runs Linux natively? :cry:

I should have expected that :laughing:

The emulator is built on the excellent Simple DirectMedia Layer (SDL2) which is cross-platform and works on Linux, OS X, and Windows as well many other platforms. It abstracts away all of the window creation, mouse/keyboard events, audio, threading etc. We would just need someone (not me!) to add another ER-301 hardware abstraction layer (HAL) for their target architecture. In fact, the HAL written for Linux is pretty generic POSIX so minimal changes possibly for OS X and Windows?

5 Likes

It tries to load the FreeSans.ttf font from

/usr/share/fonts/truetype/freefont/FreeSans.ttf

So I guess you don’t have that file installed. I pushed a commit that allows the emulator to try to load the font from er-301 project tree when the above doesn’t work. So pull and try again, please.

1 Like

Nice thanks!

Yea maybe I should focus on just building it on OSX instead of jumping through the X11 forwarding hoops :slight_smile:

Oh my…

1 Like

That was my initial experience but turns out I was resource starving it with only 1 vCPU and 1Gb of RAM. Increasing these helped a lot.

1 Like

I thought so as well, but even with 4gb and 4vCPUs it was struggling. At least this docker approach is running smoothly, it’s just hard to configure correctly. Might be my specific machine/display or something, I think I read that retina displays cause issues.

1 Like

Could be - using Win10 here. With 4 vCPUs, 8Gb of RAM, and 16Mb of video RAM, it seems to be running pretty well now.

1 Like

Can you please add this to your docker and try again?

sudo apt install libsdl2-image-dev libsdl2-mixer-dev
1 Like

Never had much reason to but it’s actually kind of nice now that you’ve given me a reason to load it up again.

No change unfortunately

Darn…

FYI, I’ve been getting my hints from this:

https://www.computers.wtf/posts/caac-container-as-a-condom/

This blog post is targeting the exact same case of running an SDL2-based graphical application in docker through an X server. Unfortunately, it is not on OS X.

Ah good source, here’s two that I found:

https://fredrikaverpil.github.io/2016/07/31/docker-for-mac-and-gui-applications/

The big gotcha is that indirect GLX is disabled by default in xQuartz. Took a while to figure that one out.

Actually, I’ve been looking through the emulator source with an eye towards how specific it is to Linux and I don’t see anything at all…

Could someone on OS X, please try following the instructions for compiling the emulator as-is and report back? You will need to do the OS X equivalent things for the sudo apt install ... stuff but other than that it might just work.

1 Like

The first roadblock is:

[lua.mk linux testing] LINK testing/linux/libs/liblua54.a
make[1]: gcc-ar: No such file or directory

but it’s easy enough to just update the AR value in scripts/linux.mk. Trying to see how deep I can get…

Edit: hal/pump/rfifo4.c complains about the missing malloc header. Updating to stdlib.h gives:

[emu.mk linux testing] C hal/pump/rfifo4.c
clang: warning: argument unused during compilation: '-fmax-errors=5' [-Wunused-command-line-argument]
hal/pump/rfifo4.c:13:33: error: implicit declaration of function 'memalign' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  fifo->buffer = (float32x4_t *)memalign(CACHELINE_SIZE_MAX, bytes);
                                ^
hal/pump/rfifo4.c:13:18: warning: cast to 'float32x4_t *' (aka '__m128 *') from smaller integer type 'int' [-Wint-to-pointer-cast]
  fifo->buffer = (float32x4_t *)memalign(CACHELINE_SIZE_MAX, bytes);
                 ^
1 warning and 1 error generated.

So probably need a different version of gcc or something