Hi, this is Klaus Hoffmann. I'm new to both Theremins in general and D-Lev in particular. I'm no musician either.
I started this weekend to dig into the subject and found https://d-lev.com/ an interresting project, especially as the device is played by real musicians in concerts.
The first step I reached is to build the Hive assembler on Windows 10 and with it build the *.spi and *.mif files from theremin.hal. I want to share my experience.
Build instructions for hive_sim.exe on Windows 10 using Cygwin g++.Preconditions:
- install Cygwin and here especially `gcc-g++`
- download and unzip https://d-lev.com/source/d-lev_sw_source_2024-01-08.zip
- delete hive_sim and hive_sim.o (obsolete executable and object file)
- backup 94e67227.spi, hive_0.mif, hive_1.mif, hive_2.mif, hive_3.mif (will be generated)
1) fix hive_pkg.cpp
In the function `str_trim()` replace these two lines:
Code:
while (ch_is_white(str.front())) { str.erase(str.begin()); }
while (ch_is_white(str.back())) { str.pop_back(); }
with these two lines:
Code:
while (str.length() && ch_is_white(str.front())) { str.erase(str.begin()); }
while (str.length() && ch_is_white(str.back())) { str.pop_back(); }
Without this fix, the program will terminate silently without writing the output files when the string `str` reaches zero bytes length.
2) build hive_sim.exe
open cygwin64 terminal
cd "\path\to\d-lev_sw_source_2024-01-08"
g++ hive_sim.cpp -o hive_sim.exe -std=gnu++11
Build instructions for the *.spi and *.mif files.
1) execute hive_sim.exe
It will read theremin.hal and recursively all included files: pkg_boot.hal, pkg_ch.hal, pkg_defs.hal, pkg_enc.hal, pkg_filter.hal, pkg_float.hal, pkg_hcl.hal, pkg_int.hal, pkg_lcd.hal, pkg_midi.hal, pkg_mod.hal, pkg_noise.hal, pkg_osc.hal, pkg_params.hal, pkg_pitch.hal, pkg_spi.hal, pkg_str.hal, pkg_tuner.hal, pkg_uart.hal, pkg_ui.hal, pkg_vol.hal, thd_0.hal, thd_1.hal, thd_2.hal, thd_3.hal, thd_4.hal, thd_5.hal, thd_6.hal, thd_7.hal.
It will write
- hive_0.mif, hive_1.mif, hive_2.mif, hive_3.mif
- 94e67227.spi
2) press any key to continue...
3) enter "quit" (without the quotes) and enter
Compare the written files with your backup. They shall be identical.
As I understand on the FPGA a soft processor core named Hive is implemented (https://d-lev.com/research/Hive_Design_2022-10-24.pdf).
I guess the .hal files are the "Hive assembly language" files and hive_sim.exe is both assembler and simulation of the Hive core.
If anyone can point me to the language description I'd be interrested.
I'm also interrested in the use of the generated .mif and .spi files. Where do they go to in the next step?