Skip to content

About

A headless runner for Roland SCVA for Linux and Windows

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

150 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

scva-headless

Written by an AI. No guarantee.

This project — the code, the documentation, and the reverse-engineering in docs/ENGINE-NOTES.md — was mainly generated by Claude. Expect some level of hallucination: a language model produces confident, plausible, wrong statements as readily as correct ones, and the claims here about the Roland core dlls rest on readings nobody has independently checked. Measurements quoted as fact may be measuring the wrong thing.

Use it knowing that. It is a hobby project, part of a personal exploration of LLMs' capabilities in reverse-engineering. It is offered as-is, with no warranty, no fitness for any purpose, and no support of any kind. Verify anything you intend to rely on, especially before using it as a reference for other work.

Roland's SOUND Canvas VA engine as a file renderer and a MIDI device for Linux, and Windows from 98 onwards.

The 32-bit tools and plugins can also play through the engine of Roland's older Virtual Sound Canvas 3.2: lighter, with the SC-55, SC-88 and SC-88Pro tone sets of its CD. See Virtual Sound Canvas 3.2.

You supply the required DLL and other optional files from your own installation.

Requirements

to build needs
Linux binaries a C compiler, alsa-lib (the renderers load it only for --play)
32-bit Linux binaries libc6-dev-i386; daemon32 also a 32-bit alsa-lib
LV2 lv2-dev, libX11 (32-bit: libX11.so.6 for i386)
CLAP the CLAP headers; Linux: libX11
Windows binaries mingw-w64, x86-64 and i686

wine only runs the Windows binaries on Linux.

Supply the engine

Copy into dll/, from your own SOUND Canvas VA installation:

Filenames Importance Notes
SCCore.dll required the actual Roland SC engine
SCVSC.tnf, SCVSC.drf, SCVSC.drk optional patch names for the plugins

Nothing else is used. The patch name files don't change the audio, it's only to select a patch when using this project as a plugin.

Cores that have been tested:

Version sha1 md5
1.1.6, 64-bit cf9dce5a0cabee06792e884673b8beef806f1aed dbd9a30c168efef577d40a28d9adf37d
1.1.2, 64-bit ba0d868fd55b3114ce2cfb7dec0a5f6314113791 80f1e673d249d1cda67a2936326f866b
1.0.6, 64-bit e87d9ae914a07b29a7bde4a0b7e2b9f1bea77b67 6abfbf61869fc436d76c93d1bc7e2735
1.0.6, 32-bit c2eb2369fe0884affd14c72cbdbc2c5aab515ce4 6588e6aa17a57ba874e8b675114214f0
1.0.3, 32-bit 41911c21d7e1d6da5574cb42c35c7ba96ea110e0 d44d1b8c9a6f956ca2324f2f5d348c44

1.0.6, both widths, and 1.1.2 render identically, byte for byte. 1.1.6 and 1.0.3 differ from them by at most one step in 16-bit output.

For --engine vsc, from your own Virtual Sound Canvas 3.2 CD (its Windows NT driver), into any directory:

Filenames Importance Notes
vsc.sys required the engine: a 32-bit NT kernel driver, run here as plain code
vsc88pro.dat required the SC-88Pro tone set, the default
vsc88.dat, vsc55.dat optional the SC-88 and SC-55 tone sets, for --set 88 and --set 55

The tone sets are read from beside vsc.sys.

Windows 9x is supported: vsc.sys needs no NT, it is loaded as plain code on every system. The CD's installer copies it only on NT, though; on 9x it installs VSC.vxd instead, which cannot be used as --core. Take vsc.sys from _user1.cab on the CD and the tone sets from data1.cab:

unshield x /path/to/cd/_user1.cab
unshield -g WaveSet x /path/to/cd/data1.cab

Files that have been tested:

File Version From sha1 md5
vsc.sys 3.2 VSC-88H3A CD (Windows & Macintosh) c393b218f254899015a0132ad009baa9bb2b8b26 ba2a4e26b1a5467ac0b8073460075cf2
vsc.sys 3.23 Roland's VSC323U updater, _user1.cab 21dfbf5aa2364f77ac247c4f9c5e468f4260a361 f7035815c23df5dad8a686c1cda20f3e
vsc88pro.dat 3.2 VSC-88H3A CD 767e0c60c169d3b76854dfd7ceeab53bc6e19c9b e49e69015be1a68e595323ec667c46f3
vsc88.dat 3.2 VSC-88H3A CD d58f7fc3ab802b836979d882a358c37af97a808f 10a892a8f481f25b7da47798882273f2
vsc55.dat 3.2 VSC-88H3A CD 340ecfee5d97f44874f396270ce12b06385f9e49 df7a9489e36cbb72a30be3b2b2eabcf4

Both vsc.sys render identically with these tone sets. The updater ships no tone sets.

Build

target builds core
make linux and windows 64-bit
make linux scva-render, scva-daemon 64-bit
make linux32 scva-render32 32-bit
make daemon32 scva-daemon32 32-bit
make windows scva-render.exe, scva-winmidi.exe 64-bit
make windows32 scva-render32.exe, scva-winmidi32.exe 32-bit
make lv2, make lv2-32 scva.lv2, scva32.lv2 64-bit, 32-bit
make clap scva.clap, scva-win64.clap 64-bit
make clap-32 scva32.clap 32-bit
make clap-win32 scva-win32.clap, scva-vsc-win32.clap 32-bit
make tones, make tones32 scva-tones, scva-tones32 64-bit, 32-bit

A binary's width must match the core's: a 64-bit SCCore.dll needs the 64-bit binaries, a 32-bit one the 32-bit binaries.

If you want to run on ARM, use the 32 bits binaries under box86 on 32-bit ARM; bear in mind that it may lead to poor performance. It is still untested.

Downloads

Every push to main replaces the latest pre-release on GitHub:

asset contents
scva-linux-x86_64.tar.gz scva-render, scva-daemon
scva-linux-i386.tar.gz scva-render32, scva-daemon32
scva-lv2-x86_64.tar.gz, scva-lv2-i386.tar.gz scva.lv2, scva32.lv2
scva-clap-linux-x86_64.tar.gz, scva-clap-linux-i386.tar.gz scva.clap, scva32.clap
scva-windows-x86_64.zip scva-render.exe, scva-winmidi.exe
scva-windows98-x86.zip scva-render32.exe, scva-winmidi32.exe
scva-clap-windows-x86_64.zip scva-win64.clap
scva-clap-windows-x86.zip scva-win32.clap, scva-vsc-win32.clap

None of them contains Roland's files.

Tone maps

The engine is an SC-8820 and holds four tone maps. They are not subsets of one another: the same program and bank is a different sound in each.

--map 55      SC-55       --map 88pro   SC-88Pro
--map 88      SC-88       --map 8820    SC-8820
--map default same as 8820

The default is the SC-8820 map. If you are using this as an SC-88 proxy, pass --map 88 or you are comparing against the wrong instrument.

Linux

Render a MIDI file

./build/scva-render --midi song.mid --out song.wav --map 88

--midi FILE      input Standard MIDI File        (required)
--out FILE       output stereo WAV                (required)
--map WHICH      default | 55 | 88 | 88pro | 8820   (default: default)
--core DLL       path to SCCore.dll
--rate HZ        sample rate                     (default 48000)
--tail SECONDS   silence after the last event    (default 3)
--bits 16|32     16 plays anywhere, 32 is float  (default 32)
--reset gs|gm|none                               (default gs)
--maxblock N     declared maximum block          (default 4096)
--flat-out       render as fast as possible rather than in real time
--init N         TG_initialize argument          (default 0)
--cfg A B        TG_XPsetSystemConfig fields     (default 1 1)
--dump N         print the first N samples
--play           straight to the sound card, no file and no MIDI
                 driver anywhere in the way
--pcm DEV        force one PCM device, as with the daemon below
--latency MS     delay before a note is heard, --play only (default 20)
--engine NAME    scva | vsc, vsc in 32-bit builds   (default scva)

--out and --play are not exclusive: give both to render a file and listen at the same time. Both renderers load ALSA's libasound.so.2 only for --play, so they build and render without ALSA; scva-render32 --play needs the 32-bit library, and says so when it is missing.

Run it as a MIDI device

./build/scva-daemon

--map WHICH      tone map, as above         (default: default)
--name NAME      port name                  (default SCVA)
--pcm DEV        output device              (default: wherever the system sends audio)
--list-pcm       show what is tried, and what works here
--latency MS     delay before a note sounds (default 20)
--rate HZ        sample rate                (default 48000)
--block N        frames per block           (default 256)
--core DLL       path to SCCore.dll

Creates an ALSA sequencer port called SCVA:

aconnect -l
aconnect 24:0 'SCVA':0
aplaymidi -p 'SCVA' song.mid

Audio goes where the system sends it: ALSA's default, then PipeWire, Pulse or JACK if a server holds the card and default therefore cannot open it. It reports which one it took. No named card is picked automatically, since that would play wherever the card happens to go - often an HDMI monitor.

--map sets the map at startup (55, 88, 88pro, 8820, default is 8820).

--name allows you to decide on the name that will be shown in your midi devices. It also names the control socket below, so several daemons started with different names never collide - scva-daemon --name SCVA-88 --map 88 and scva-daemon --name SCVA-55 --map 55 run side by side as two separate devices with two separate sockets, with nothing else to configure.

--pcm overrides all of that, so a device that will not open produces an error. Anything aplay -L lists should work.

--latency is then almost the whole delay before it is heard, since the engine should be barely noticeable on a modern computer. the default 20 ms works on a desktop; if the audio breaks up, raise it - the daemon counts dropouts and says so on exit.

--rate defaults to 48 kHz because that is what modern cards run; a mismatch makes the sound server resample every block. cat /proc/asound/card*/pcm*p/sub*/hw_params shows what yours is using while something plays.

--block cannot go below 256 frames. The engine corrupts its own heap during TG_activate below 255, so smaller values are refused rather than passed on.

--core to force a Roland core location. By default we look in the relative path for dll/SCCore.dll. $SCVA_DLL_DIR works too.

Changing the map while it runs

Type it in the terminal the daemon is running in:

88             every part
10 55          one part, channels numbered 1 to 16
<enter>        what each part is currently set to
q              stop

Case, an SC in front and any dashes, spaces or underscores are ignored, so 88, SC-88 and sc 88 are the same thing. The raw CC32 value works too, 0 to 4.

This changes the sound immediately, not just what the next instrument you select uses. The engine only re-resolves a part's tone on a program change - CC32 alone just latches which map that program change will read from - so this also re-sends each part's own last program right after CC32, rather than leaving the new map to sit unheard until something happens to send a fresh program change on its own.

This is the only way to change the map. A CC32 arriving on the wire - from whatever file or sequencer is playing - is never treated as a request to switch it, because that is ordinary Bank Select LSB, which real files send constantly as routine GM/GS housekeeping (0 alongside almost every program change) with no intent to touch the SC map at all. Honouring it would let a file's own bank-select traffic silently undo whatever was chosen here within seconds.

Under systemd there is no terminal to type into, so the same commands go over a control socket, which the daemon opens in $XDG_RUNTIME_DIR, named after --name (scva-daemon-SCVA.sock by default):

scva-daemon --send "88"
scva-daemon --send "10 55"
scva-daemon --send ""          # what each part is set to

Talking to a daemon started with --name SCVA-88 needs the same --name on the --send side too, so it finds that daemon's socket rather than the default one - order does not matter, --send "88" --name SCVA-88 and --name SCVA-88 --send "88" both work.

--control PATH puts it elsewhere, overriding the name-based default entirely. It is a plain Unix socket, so anything can drive it. socat - UNIX-CONNECT:..., or any programming language. --send is there so nothing extra has to be installed.

Or send CC32 on the channel you want to change - the idiomatic way to control a MIDI device is MIDI. The daemon adopts it for that part and uses it from then on, so any sequencer, controller or DAW switches map live. It is awkward only from a shell: aseqsend arrived in alsa-utils 1.2.10, and amidi talks to raw hw: ports rather than sequencer clients.

Launch at startup with systemd

scva-daemon can be launched at startup with this systemd service. Create /etc/systemd/system/scva-headless.service containing:

[Unit]
Description=SOUND Canvas VA
[Service]
ExecStart=/usr/local/bin/scva-daemon --map 88
Environment=SCVA_DLL_DIR=/opt/scva
[Install]
WantedBy=default.target

Then, reload systemd and enable the service:

sudo systemctl daemon-reload
sudo systemctl enable scva-headless.service

Start it, and check:

sudo systemctl start scva-headless.service
systemctl status scva-headless.service

Windows

Render to a file

build\scva-render.exe --midi song.mid --out song.wav --map 88
build\scva-render32.exe --midi song.mid --out song.wav --map 88

--midi FILE      input Standard MIDI File        (required)
--out FILE       output stereo WAV                (required)
--map WHICH      default | 55 | 88 | 88pro | 8820   (default: default)
--core DLL       path to SCCore.dll
--rate HZ        sample rate                     (default 48000)
--tail SECONDS   silence after the last event    (default 3)
--bits 16|32     16 plays anywhere, 32 is float  (default 32)
--reset gs|gm|none                               (default gs)
--maxblock N     declared maximum block          (default 4096)
--flat-out       render as fast as possible rather than in real time
--init N         TG_initialize argument          (default 0)
--cfg A B        TG_XPsetSystemConfig fields     (default 1 1)
--dump N         print the first N samples
--play           straight to the sound card, as below
--pcm DEV        output device, its number or any part of its name
                 (default: the system's choice)
--latency MS     audio buffered ahead, --play only (default 200)
--engine NAME    scva | vsc, vsc in 32-bit builds   (default scva)

The options are the Linux renderers'; only --pcm names a waveOut device rather than an ALSA one, and --latency defaults higher for older machines.

Play to the sound card

build\scva-render.exe --midi song.mid --play
build\scva-render32.exe --midi song.mid --play

The --play option sends audio directly to the sound card instead of writing a file. No driver, no virtual cable, no MIDI mapper.

Run it as a MIDI device

For live MIDI from a keyboard or another program, you need a virtual cable:

Windows cable ports
XP and later loopMIDI named when you create them
9x Hubi's LoopBack 2.51, mdlbk251.zip, installs from Control Panel LB1 to LB4

Whatever sends the MIDI writes to the cable's output; --midi-in reads its input.

build\scva-winmidi.exe --list
build\scva-winmidi.exe --midi-in "loopMIDI Port"

--list             the MIDI inputs this machine has
--midi-in          index, or any part of the name
--map WHICH        tone map, as above          (default: default)
--rate HZ          sample rate                 (default 48000)
--block N          frames per block            (default 256)
--latency MS       buffered ahead              (default 40)
--core DLL         path to SCCore.dll
--name NAME        window title                (default SCVA)

--name sets the window title, so running several of these side by side - one per --midi-in, for several devices on one machine - shows which is which. Unlike the daemon there is no socket to collide on: nothing here is addressable from outside its own console, so --name is only about telling the windows apart.

Changing the map while it runs

Type it in the console scva-winmidi is running in - the same commands as the daemon, above:

88             every part
10 55          one part, channels numbered 1 to 16
<enter>        what each part is currently set to
q              stop (Ctrl+C still works too)

This reads a keystroke at a time rather than a whole line, so it never blocks the audio loop behind the Enter key - the same reason the loop waits on the sound card rather than a timer.

It also takes effect immediately rather than sitting unheard: the engine only re-resolves a part's tone on a program change, so along with CC32 this re-sends each part's own last program too - otherwise typing a map here would show the confirmation line and change nothing you could hear until whatever is playing happened to send a fresh program change of its own.

This is the only way to change the map - a CC32 arriving over MIDI-in is never treated as one, since that is ordinary Bank Select LSB that real files send constantly as GM/GS housekeeping, not a request to switch it. Otherwise a file's own bank-select traffic would undo the console's choice within seconds.

The defaults suit a modern PC; an older one needs its own settings.

what it is when to raise it
--block audio rendered at a time first, if the sound breaks up. Small blocks interrupt the driver constantly, which old drivers handle badly
--latency how far ahead of the speaker only if a bigger block was not enough. It is the delay between key and sound

Timing does not suffer from a large --latency: each message plays where its arrival time says, to within one --block.

It runs at High priority, so a busy program next to it, such as a DOS game under NTVDM with VDMSound or VOPL3, does not starve its audio.

Athlon XP 2 GHz, Windows 98, Sound Blaster Live!: --block 1024 --latency 200.

Windows has no way for a program to put itself in the MIDI device list. That list comes from drivers, which is why the one soft-synth that appears in it ships a kernel driver. So this opens a port that already exists instead:

sending from needs
a USB or MIDI-interface keyboard nothing - it is already an input, pick it with --midi-in
a game, DOSBox, a media player a virtual cable such as loopMIDI
Reaper, Bitwig, Studio One nothing - use the CLAP plugin instead

With a virtual cable the game selects the cable's port, not this program:

game or DOSBox  ->  "loopMIDI Port"  ->  scva-winmidi  ->  speakers

Version requirements

What the system must provide

build how the core is loaded what the system must provide
32-bit pe_loader.c maps it, as on Linux nothing. Its own imports stop at Windows 95, plus msvcrt.dll, which ships with 98
64-bit LoadLibrary the Universal CRT, so Windows 10 or 11, or the VC++ redistributable

No Roland installer and no activation either way.

Windows 98

The 32-bit binaries target it: subsystem 4.0, and pe_loader.c maps the core, which the system loader would refuse twice over - MSVCR100.dll, and a declared subsystem of 5.1.

The processor decides, not the Windows version. The core is compiled for SSE3 and never asks cpuid, so on anything older it faults on the first note. sse3_shim.h and sse2_shim.h rewrite those instructions as the core loads, putting the floor at SSE1: a Pentium III or an Athlon XP. A plain Athlon, K6 or Pentium II has no SSE and will not run it. See docs/ENGINE-NOTES.md.

With --engine vsc the floor is lower:

needs floor
the 32-bit binaries i586, x87 Pentium
vsc.sys x87; MMX and SSE only when present Pentium

So a Pentium, Pentium MMX, K6 or Cyrix 6x86 should run VSC; Roland's own minimum for VSC 3.x is a Pentium MMX at 166 MHz. The few i686 instructions left in the binaries come from mingw's runtime and are reached only by SCCore.

Windows 95 is untested. The 32-bit binaries import nothing Windows 95 lacks except msvcrt.dll, which comes with IE4, OSR2.5 or the VC++ 6 runtime. Windows 95 never enables SSE, so SCCore cannot run there; VSC finds that out as it loads and takes its MMX or x87 path.

engine tested on real hardware tested otherwise
SCCore Windows 98 SE, Athlon XP, 947 and 6 shim sites applied: rendering to a file, --play, and live MIDI through Hubi's LoopBack at --block 1024 --latency 200
VSC not yet wine; the Linux build under emulation on a Pentium II, with --cpu auto and --cpu fpu; the binaries checked for instructions a Pentium lacks

Windows XP

Windows XP depends on the core, not on this program, which is built against the XP API and uses nothing newer. Check what your copy demands:

python3 -c "import struct,sys; d=open(sys.argv[1],'rb').read(); \
  pe=struct.unpack_from('<I',d,0x3c)[0]; \
  print('subsystem version', *struct.unpack_from('<HH',d,pe+24+48))" SCCore.dll

5.1 is XP and 6.0 is Vista. The 64-bit core tested here reports 6.0 and imports VCRUNTIME140.dll and the Universal CRT, so XP will refuse to load it however the host program is built.

Tested and works on Windows XP, rendering to a file and with --play to the sound card. May require tweaking --latency on older hardware.

DOSBox

Games in DOSBox can play through scva-winmidi using a virtual cable.

In dosbox.conf, configure MIDI to use loopMIDI:

[midi]
mididevice = win32
midiconfig = 1          ; the device number of loopMIDI Port

DOSBox-X and DOSBox Staging also accept the name: midiconfig = loopMIDI Port. Then choose General MIDI or Sound Canvas in the game's own setup program.

Audio goes out through waveOut in 16-bit stereo, which every Windows device should accept. Latency matters less here than on a keyboard, since a game is playing a score rather than responding to fingers.

DOSBox on Linux

Games in DOSBox on Linux can also play through scva-daemon using MIDI:

In dosbox.conf:

[midi]
mididevice = alsa
midiconfig = SCVA

Connect the scva-daemon MIDI input to the DOSBox MIDI output as usual:

aconnect -l
aconnect DOSBox-output 'SCVA':0

Then choose General MIDI or Sound Canvas in the game's own setup program.

Wine is no substitute for testing this. It ships its own msvcr100.dll, ignores the subsystem field, and reports success from midiInOpen then delivers nothing - it forgives exactly what an old Windows does not.

As an LV2 plugin

make lv2      # x86-64 bundle, for a 64-bit SCCore.dll
make lv2-32   # i386 bundle, for a 32-bit SCCore.dll

Copy build/scva.lv2 into ~/.lv2/. The plugin finds the core in $SCVA_DLL_DIR, or beside the bundle if you drop SCCore.dll in there. It needs patch names beside the core too - the install's SCVSC.tnf and SCVSC.drf, or a scva-tones.txt (see Patch names) - and will not load with the built-in General MIDI set.

MIDI in, stereo out, and an editor window (scva_ui.so, an X11 UI; Carla's GUI button on the plugin's strip):

in the editor what it does
Tone Map buttons every part, at once: each part's last program is re-sent under the new map
Instrument list part 1: the map's tones, 001 Piano 1, 001-008 Piano 1w
Drum Kit list part 10: the map's kits, 001 STANDARD 1

Default lists SC-8820's patches, which it renders. The lists scroll with the wheel or the scrollbar; a click picks. The editor needs only libX11 and draws with the X server's own fixed font.

Its controls are three plugin ports that hosts are asked not to draw (notOnGUI), and the plugin plays what they hold: Tone Map, Drum Kit (a GS program number; one the map lacks plays Standard) and Instrument (a position in the map's tones). A Tone Map change in the editor keeps the instrument - the same bank and program in the new map's list, as the CLAP editor does. Automation and saved projects set the same ports.

There is no program list: the editor is the one place to pick, as a host's drop-down could not follow the editor's picks.

Tested in Carla 2.5.8 (native) and 2.5.10 (flatpak), x86-64 bundle, core 1.1.2.

The plugin's architecture has to match the host's, and the Roland core's has to match the plugin's - a 64-bit host needs the 64-bit bundle and a 64-bit core. LV2 is a Linux format in practice, and the engine is x86 machine code, so there is no ARM build of this and no Windows one.

As a CLAP plugin

tested host core
scva-win32.clap SAVIHost CLAP x86 1.44, Wine 1.0.3, 32-bit
scva-win64.clap SAVIHost CLAP x64 1.44, Wine 1.1.2, 64-bit

SAVIHost needs the Visual C++ 2008 runtime of its own width.

make clap        # Linux .clap and 64-bit Windows .clap
make clap-win32  # 32-bit Windows .clap
make clap-32     # 32-bit Linux .clap

Needs the CLAP headers: make clap CLAP_DIR=/path/to/clap/include.

MIDI in, stereo out. The core and patch name files are found in $SCVA_DLL_DIR, or beside the .clap.

parameter values part
Tone Map Default, SC-55, SC-88, SC-88Pro, SC-8820 every part, at once
Instrument the Tone Map's tones, 001 Piano 1, 001-008 Piano 1w first
Drum Kit the Tone Map's kits, 001 STANDARD drum

Default lists SC-8820's patches, which it renders. A Tone Map change re-sends each part's last program under the new map, and moves Instrument and Drum Kit to the same patch in that map's lists where it has one. Their ranges are the longest map's; past a shorter list a value means its last entry.

map tones kits
SC-55 418 10
SC-88 418 14
SC-88Pro 774 25
SC-8820, Default 1262 37

The Linux build's editor is the LV2's (X11, the host's timer drives it). The Windows builds have one of their own: Tone Map and Drum Kit drop-downs and the Instrument list, refilled when the Tone Map changes. A host's generic slider cannot step through 1262 tones; SAVIHost shows the editor in place of its slider. The editor scales with the Windows DPI setting (Wine: winecfg, Graphics) and fills whatever window the host gives it.

in SAVIHost does
size grip, bottom right resizes, up to the editor's own size
View > Check Max Size, unchecked lifts that limit; the Instrument list grows
View > Resize fits the window to the editor, after a DPI change for instance
build how the core is loaded
Linux PE loader
64-bit Windows LoadLibrary
32-bit Windows PE loader, as scva-render32.exe: no MSVCR100.dll needed

For hosts with a preset browser, every map's patches are also presets, named like SC-88 001 Piano 1, through clap.preset-discovery (a LOCATION_PLUGIN provider) and clap.preset-load. clap.note-name names the loaded kit's keys.

Patch names

The engine cannot be asked what patches exist: its MIDI entry points are all input-only, and it sounds every bank whether named or not. Names come from one of three sources, in order:

source where patches
this project's format $SCVA_TONES, or scva-tones.txt beside the core as written
a SOUND Canvas VA install SCVSC.tnf, .drf, .drk beside the core 4257
General MIDI built in, no files 129

With only the built-in General MIDI set, the CLAP plays and lists those 129 patches; the LV2 refuses to load.

make tones writes a table from whatever this machine has the files available (make tones32 builds the same tool for i386):

./build/scva-tones --core /path/to/scva > scva-tones.txt

The format is documented at the top of src/scva_names.h.

What runs where

The engine is x86 machine code - the versions this project is based on are the Roland 32-bit and 64-bit Windows versions. So:

Linux x86-64 LV2, CLAP, renderer, --play, daemon
Linux i386 LV2, CLAP, renderer, --play, daemon
Windows x86-64 CLAP, renderer, --play, MIDI device via a virtual cable
Windows x86, 98 and up CLAP, renderer, --play, MIDI device via a virtual cable
ARM, any width only by emulating x86 - box86 or box64
macOS would need a Mach-O loader; not built here

The Virtual Sound Canvas engine is 32-bit code, so it is in the 32-bit tools and plugins only: scva-render32, scva-render32.exe, scva-daemon32, scva-winmidi32.exe, scva32.lv2, scva32.clap and scva-vsc-win32.clap.

32-part, two-port songs

The core has 16 parts. Roland's demo SMFs are 32-part performances that name their port in the track name (PartA / PartB); others carry FF 21. The renderers detect either and drive a second engine for port B. Nothing has to be passed, and single-port files are unaffected.

The daemon, scva-winmidi and the plugins are 16-part: they receive MIDI rather than read a file, so nothing tells them which port a note belongs to. Two instances, fed separately, is the way round it.

This is not our limitation alone - it is anyone's. PartA/PartB in a track name, or FF 21, is not something a generic MIDI player or the OS's own MIDI routing knows to look for. Windows Media Player, aplaymidi into scva-daemon, or any other player/sequencer that was not specifically taught this file's convention will merge both ports onto one 16-channel device - exactly the collapse the renderers exist to avoid - and can produce notes and instruments neither the hardware nor our own renderer plays. Unless the player you are using is known to honour this file's own port convention, play these songs with the renderer's --play (scva-render32.exe --midi ... --play on Windows, scva-render --midi ... --play on Linux), never with a generic player.

Virtual Sound Canvas 3.2

vsc.sys is the synthesizer of Roland's Virtual Sound Canvas 3.2, shipped as a Windows NT kernel driver. It is loaded here like SCCore.dll, without its driver half, and needs no Windows: the 32-bit renderers run it on Linux too.

./build/scva-render32 --engine vsc --core vsc/vsc.sys --set 88 \
    --midi song.mid --out song.wav --bits 16
build\scva-render32.exe --engine vsc --core vsc\vsc.sys --midi song.mid --play

With --engine vsc, --core names vsc.sys, and these replace --map:

--set 55|88|88pro      tone set, beside vsc.sys       (default 88pro)
--poly N               maximum voices, 1-128           (default 64)
--volume N             master volume, 0-100            (default 80)
--rev-gain G           reverb return gain              (default 1.26)
--cho-gain G           chorus return gain              (default 1.26)
--delay-gain G         delay return gain               (default 1.26)
--cpu auto|mmx|fpu     engine code path                (default auto)

The defaults are VSC 3.2's own. Where it differs from SOUND Canvas VA:

  • Rates: 11025, 22050 (the default) or 44100 Hz, nothing else. Another --rate is refused; nothing resamples for it.
  • Timing: the engine takes no timestamps. MIDI lands on its blocks of 125, 250 or 500 frames (about 11 ms), each event on the boundary nearest it, as VSC's own player does.
  • One tone set for every part, chosen with --set: no per-part maps, and --map is refused.
  • 16-bit output. --bits 32 writes it as float, unchanged.
  • --init, --cfg and --maxblock are SOUND Canvas VA's and do nothing here.

Renders are checked byte for byte against a reference renderer of the same engine, on Linux and in the Windows build under wine. The VSC engine has not been tested on real hardware yet; see Windows 98 for the CPU floor it should have.

scva-daemon32 takes --engine vsc too, with the same options:

./build/scva-daemon32 --engine vsc --core vsc/vsc.sys --set 88

A map typed at its console or sent with --send (55, 88, 88pro) changes the one tone set: the engine is reopened on the new set and reset, as VSC itself does. A map for one part alone, or 8820, is refused. --map at start-up names the set the same way.

scva-winmidi32.exe takes --engine vsc the same way, its console too:

build\scva-winmidi32.exe --engine vsc --core vsc\vsc.sys --midi-in loopMIDI

As a plugin

The plugin is SCVA: Virtual Sound Canvas 3.2.

file holds
scva32.lv2, scva32.clap SCVA and the VSC plugin
scva-win32.clap SCVA
scva-vsc-win32.clap the VSC plugin

On 32-bit Windows each .clap holds one plugin: SAVIHost refuses a file with several.

The VSC plugin loads vsc.sys and its tone sets from $SCVA_DLL_DIR, or from beside the bundle or .clap. A 64-bit host cannot load it: the engine is 32-bit code.

It plays at whatever rate the host runs. Where VSC has no such rate, it renders at the nearest one it has above it (44100 Hz for 48000 and up) and the plugin resamples, with a windowed sinc that keeps the audible band and removes what the new rate cannot carry.

parameter values
Tone Set Default (SC-88Pro), SC-55, SC-88, SC-88Pro
Instrument the set's tones, as the engine names them
Drum Kit the set's kits
set tones kits
SC-55 354 10
SC-88 546 15
SC-88Pro 902 26

A Tone Set change reopens the engine on the new set and resets it, as VSC itself does: a short gap in the sound, and every part back to its power-on state. The sets share the samples of the tones they have in common; they differ in their variations and drum kits. The names, the editor's lists and the CLAP's presets come from the engine itself, so no name files are needed.

Source layout

front ends scva_native.c and scva_render.c (renderers), scva_daemon.c, scva_winmidi.c, scva_lv2.c, scva_clap.c
shared by front ends render_loop.c (a song into engines, block by block), render_engines.c (the engines a song plays on), live_engine.c (the live tools' engine and its tone sets), scva_engine.c (the plugins' engine), plugin_names.c (the plugins' patch names, from files or the engine), map_policy.c (tone maps), console.c (the map console), live_sched.c (live MIDI timing), rt_priority.c, audio_waveout.c
engines synth.h, the interface every engine fills in; synth_registry.c, the engines a build has and their options; synth_scva.c (SOUND Canvas VA) and synth_vsc.c + vsc_engine.c (Virtual Sound Canvas); synth_resampled.c + resample.c, any of them at a rate it does not render at
SOUND Canvas VA scva_core_api.h (its exports), scva_core.h (its start-up order), scva_runtime.c (the Windows and C runtime calls it imports, and its SSE shims)
platform pe_loader.c: maps a PE image, binds its imports through a resolver the caller gives, patches its code through a hook, finds symbols by export or in its COFF table

Tests

make test-unit test-unit-win test-cli test-fake    # no engine needed
SCVA_TEST_DLL_DIR=dll make test-core test-perf      # your SCCore.dll
tests/checkpoint.sh                                 # every tier this machine can run
tier needs what
test-unit nothing module behaviour, 64- and 32-bit, including the PE loader on a test image built here
test-unit-win wine the same modules as the Windows builds compile them
test-cli wine for the .exe every binary's command line, up to where an engine is needed
test-fake wine, python3 every tool and plugin against a fake SCCore.dll that logs each call
test-core SCVA_TEST_DLL_DIR renders with your core match the recorded audio
test-perf SCVA_TEST_DLL_DIR instructions retired stay within 0.25% of the recorded count
test-vsc SCVA_TEST_VSC_DIR, SCVA_TEST_VSC_PLAY (a reference renderer), SCVA_TEST_CORPUS the VSC engine renders what the reference renders, byte for byte

SCVA_TEST_VSC_SYS, a vsc.sys, also lets the loader's unit test map the real driver. CI runs the tiers that need no engine. What only real hardware, real Windows or a DAW can show is in docs/MANUAL-CHECKS.md.

Driving the engine directly

Several exported functions fail silently if called wrongly. The signatures and the measurements are in docs/ENGINE-NOTES.md.

Remarks

This project loads the DLL and calls its exported entry points. None of Roland's code is redistributed here.

Audio produced this way is Roland's own plug-in output and is not a substitute for a physical Roland SC-8820 unit.

As it was AI generated, with only human supervision and review, our own code here is CC0. No copyright is claimed on AI generated code.

About

A headless runner for Roland SCVA for Linux and Windows

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages