philburk / hmsl

Hierarchical Music Specification Language, Forth tools for experimental music from the 1980's
Apache License 2.0
91 stars 8 forks source link

HMSL for Amiga is unavailable #166

Open philburk opened 11 months ago

philburk commented 11 months ago

Some users are trying to run HMSL on the new Amigas and Amiga emulators. Files are scattered and some are missing.

JForth for the Amiga can be downloaded from: https://www.softsynth.com/jforth/download.html

Amiga source files are in https://github.com/philburk/hmsl/tree/master/hmsl/amiga

The "Amiga Supplement" mentioned in the main HMSL manual seems to be missing! The supplement was probably written on the Mac because we used Word and the Apple laser printer.

The file for loading HMSL on top of JForth is at https://github.com/philburk/hmsl/blob/master/hmsl/amiga/hostdep/load_hmsl.fth

Note that it does not have the ".fth" suffix on the file names.

It may be possible to recover HMSL on Amiga by:

  1. Run JForth on Amiga
  2. Expand the dictionary
  3. Update the load_hmsl.fth to use the ".fth" suffix. Maybe extend this load file.
  4. Compile HMSL
  5. SAVE-FORTH
znmeb commented 11 months ago

There are new Amigas? I knew about the emulators but I didn't know you could get newly-built hardware.

philburk commented 11 months ago

I think the new hardware is basically a turnkey dedicated emulator: http://www.a-eon.com/?page=x5000

320x200 commented 11 months ago

(follow-up to my email)

Hello!

So for now I'm just trying a couple of things just to see how far I can go, and I have a couple questions:

philburk commented 11 months ago

The files in "hmsl/amiga/hostdep" are designed to load on top of JForth. The files in "hmsl//fth" are designed to load on top of pForth. Those files need to be reconciled.

One problem is that the "hmsl/amiga/hostdep" is trying to load "hmsl//fth" files on top of JForth. JForth and pForth are very similar at a basic level. But there are a few differences, eg. DOS_LIB. You seem to be hitting those.

I have asked the HMSL list if anyone has old Amiga HMSL disks. Fingers crossed.

JForth does not know ?DO

I think the JForth was the same as ?DO. Try this in JForth:

0 0 DO i . cr LOOP ." yay"

If it hangs then I am wrong. If it prints "yay" then I am right. If so you can define an alias. Try:

: ?DO postpone do ; immediate

And what is/was ho:?

I think that was the ODE directory.

320x200 commented 11 months ago

And what is/was ho:?

I think that was the ODE directory.

Yes! It was the utils from ODE that was missing, not the one from HMSL. However further down the compilation, the ?DO issue appeared again via stacks.fth

0 0 DO i . cr LOOP ." yay"

This one : YAY 0 0 DO i . cr LOOP ." yay" ; worked. I do get a "yay" back. However:

: ?DO postpone do ; immediate

Does not work. POSTPONE does not seem to exist or be defined in JForth?

I have asked the HMSL list if anyone has old Amiga HMSL disks. Fingers crossed.

Thanks, fingers crossed indeed :)

philburk commented 11 months ago

POSTPONE does not seem to exist or be defined in JForth?

Right. I spent some time today installing an Amiga emulator. I managed to get JForth running. Try this:

ALIAS DO ?DO IMMEDIATE
: YAY 0 0 ?DO i . cr LOOP ." yay" ;
YAY

BTW, The word DO does not work in JForth outside of a colon definition. It works in pForth.

I will help to get HMSL running on the Amiga again.

320x200 commented 11 months ago

More progress:

philburk commented 11 months ago

JForth has .IF and .THEN pForth uses [IF] and [THEN], which are more standard. Unfortunately ALIAS does not work with [IF] because it scans for [THEN] by name. I will add a compatibility layer for JFortth.

In h:midi_globals.fth you can see that I had to move the variable into the host code.

\ As of 2021, the variable now resides in the Host code.
\ VARIABLE MIDI-PORT      \  Current port being used; 0=modem, 1=printer
: MIDI-PORT hostmidi_port() ;

You can reenable the old variable for now.

philburk commented 11 months ago

Could it be that h:midi_globals.fth is now only meant to work on Mac?

The new code does only work on the new Mac. But now I think we should preserve compatibility with JForth. I did not anticipate building HMSL on Amiga from this code base.

320x200 commented 11 months ago

The new code does only work on the new Mac. But now I think we should preserve compatibility with JForth. I did not anticipate building HMSL on Amiga from this code base.

I can imagine... and really appreciate your help to try bringing Amiga support back!

With the MIDI-PORT variable back, things moved further. However there were a lot of words used to initialize MIDI for JUCE... I think? I commented out these words in the hope they were not used at all on Amiga.

Now I am stuck here https://github.com/philburk/hmsl/blob/7a2925e1f052dcf8d81283fd0fe86d116c9a08c0/hmsl/amiga/hostdep/load_hmsl.fth#L121

and not quite sure how to solve this because this file does not seem to exist anymore.

philburk commented 11 months ago

Oh! That's not good. The event_buffer is code that would store CFAs and data in a time ordered buffer. This was used for scheduling MIDI and Amiga Local sound events in the near future to reduce jitter. Scheduling jitter was a big issue on 8 MHz CPUs.

The event buffer functionality in the current HMSL/JUCE is built in the native C code. See this host API:

https://github.com/philburk/hmsl/blob/7a2925e1f052dcf8d81283fd0fe86d116c9a08c0/native/juce/Source/hmsl_host.h#L98

So yeah, those mising files are not needed on the JUCE version but are needed on the Amiga. I will look again on my old drives. And I just thought of someone else who may have the HMSL Amiga disks!

philburk commented 11 months ago

Good news! I found some files that I got from Henry Lowengard. It seems to have the original HMSL source including "event_buffer" and others mixed in with some of Henry's stuff. It might even have an executable hmsl4th! I will figure out what I have and talk to Henry. I don't want to post his personal files without permission.