pulkomandy / Sawteeth

A sound synthetizer, tracker and replayer, similar to AHX.
22 stars 7 forks source link

Import AHX files #18

Open pulkomandy opened 10 years ago

pulkomandy commented 10 years ago

AHX is a fileformat used on amiga by AHX tracker (formerly known as THX).

Load this files in Sawteeth and add the missing features to replay them if applicable.

Fileformat spec : http://pulkomandy.lexinfo.fr/projects/sawteeth/wiki/AHX

APlayer has a player for it already. Also, HivelyTracker, which is now open source, can import AHX files. It uses the HVL fileformat internally, but the synth engine is also quite similar to Sawteeth with some extras (ring modulator, 2 effect columns in parts, etc.)

SamuraiCrow commented 2 years ago

Related question: Which would be more desirable between making a HVL importer for SawTeeth, merging them or going the other way with it? (Meaning making a SawTeeth to HVL converter and then using a merged player library?)

I'm asking because the Hollywood scripting language already has a player plugin for HVL and I started writing an editor to use it plus some getter and setter methods added. If the interfaces for the different OS's supported by Hollywood and Haiku could use the same player it might simplify matters.

pulkomandy commented 2 years ago

I am only interested in importing HVL files here.

If you want to use HVL files in other applications, you can compose them in HivelyTracker, which runs on Haiku just fine (I helped port it) and is available in HaikuDepot. And HivelyTracker already comes with a player that should also run on Haiku as far as I can tell. There is no point on involving Sawteeth there.

SamuraiCrow commented 2 years ago

Actually that is not what I'm after. I want to make the resultant player code from SawTeeth usable from HivelyEditor. I've only put together the GUI for HivelyEditor and adding SawTeeth compatibility should be easy once the Hively importer is added and any missing capabilities. The nature of my question is the approach that would be best.

pulkomandy commented 2 years ago

It won't work. Sawteeth is very different from HivelyTracker in many ways. Hively has two effects per instrument, Sawteeth has only one. Sawteeth patterns are independant per channel and each channel can have different pattern lengths, in Hively, all cannels must have the same length and change patterns at the same time. Sawteeth sound synthesis is based on floating point numbers, HivelyTracker uses only integers (so it can run realtime on a 68k based Amiga). And so on.

If you want to use HVL files, use HivelyTracker and the HVL player that goes with it.

If you want to use Sawteeth files, use the Sawteeth editor and Sawteeth player.

The import that may be possible here would be a destructive one. Songs will sound different and will need a lot of rework and manual finetunig after converting. The idea here is just to allow that: importing a song and then adapting it to make a Sawteeth version. Not just "convert and be done".

So, if you want to use HVL files, you have https://github.com/pete-gordon/hivelytracker (I don't see why you would be writing a new editor?) and that includes both a tracker to compose songs, and a player that's easily ported to any operating system.

If you want to use Sawteeth files, you use Sawteeth and libst (both available in this repository) to play them.

An unified player routine is not possible if you want accurate replay of songs composed in both tools.

SamuraiCrow commented 2 years ago

As for why I'm writing a new editor, the more you approach the 16 voice limit of the HVL format, the more the fixed 6 tracks shown on the display feels tight and restrictive and the fixed resolution on the window makes you wish you could use more screen real-estate. I've used HivelyTracker quite a bit on AmigaOS 4.1, MorphOS and Linux and they all have the same problem. The cheap SDL-based GUI doesn't take advantage of the underlying OS in any way. By using Hollywood's RapaGUI plugin for the UI, the source base becomes unified while leveraging wxWidgets on the mainstream OS families and MUI on the Amiga-like ones.