Login
Tools - cRTED
Title:cRTED
Version:1.0
ActiveYes
Last updated:2023-03-08
CategoryAudio
Platform:Multiplatform
Created by:Hermit
Download: /dl/tools/crted/crted_1_0.zip
cRTED


Notes
The promised cross-platform (PC-based, both Windows and Linux) TED music player following the trails of Siz's TMF format improvements, based on discussions in this homepage's forum. The new format is the .ted (or .ted.prg), many tunes are included, see all in HVTC-ted.

The related HVTC-ted pack is the complete HVTC music collection converted to .TED format for the new cRTED music-player. Playtime, author/title, etc. metadata fields are filled. See HVTC-ted source package for more info.

Download the HVTC-ted (2023-03-08).
Download the HVTC-ted source files (2023-03-08).



cRTED
---------
cRTED is a music player for my new Commodore Plus4 music format based on the TMF format brought further by Siz. I made a music-collection based on Luca's HVTC (High Voltage TED collection) called HVTC-ted, including a tool to convert the .prg files to .ted.

cRTED has both Linux and Windows versions (just as my other tool cRSID has) and the Linux version has a .deb installer in this package which takes care of associating .ted, .tmf and .tel (playlist) music files to cRTED. (The only dependence of the program is the SDL library, SDL.dll is included for Win, and nothing else is essential from the program package, just the runnable).
Windows version doesn't have an installer so you need to associate the types manually if you want single-click playback. There's no file-open dialog in cRTED, you can't open files from within the app. That said, there are still many ways to open a list of files. Clicking on the '.tel' simple textfiles open the files/folders listed in it. The folders given as argument or in the playlist-file, are searched for music files recursively (including subfolders). If there's no argument given to crted it will try to open the
music/playlist files in the current folder, or if none found, it will play a nice multi-tune music by 4-mat and display a short help about the usage.
These possibilities can be combined so you can give more files/folders or playlist-files as arguments.

There's a GUI by default, but commandline -mode can be selected by giving '-cli' as an argument. Arguments can be added in any order btw but always the one coming later has the priority in case of clash. (Windows can't execute an app as both commandline and GUI app, so crted.exe is the GUI one crted.com is the commandline one. The .com app can still open the GUI if it's ran without the -cli argument, albeit with an accompanying console window. Only te .com version can output text to the console, the GUI app outputs nothing there.

The GUI must be straightforward, the buttons at the bottom restart/pause and fast-forward the tune, or select subtune/tune, or mute/unmute the channels.
Keys are still useable in the GUI:
Enter:restart, SPACE:pause/continue, TAB:fast-forward, 1..9,+/-: select subtune, cursor-up/down: adjust main volume, left/right: previous/next tune/subtune. The Page-Up/Down can scroll the playlist fast (by 1 page each time). The mouse-scrollwheel is usable to adjust the volume, in the playlist-area (when there are more then 1 tunes in the list) you can scroll the playlist with the wheels slowly or fast when moved over the scrollbar on the right. You can even drag the scrollbar to navigate through the playlist very fast. Clicking on a tune's title by the left button starts it. The scrollbar shows the display-position with a whitish rectangle, the playback-position with a blackish line.
There's a button to toggle Auto-advance in playlist. When you see 'rep' on it it will enable 'repeat'/'loop' of tunes (that loop) and won't go to the next tune/subtune when the playtime expires. When you see 'adv' on it, it will turn the auto-advance mode back to normal.

There's no config-file as such for the volume/stereo settings but the editable crted.sh file in Linux or the crted.bat starter scripts can be used to start crted with specific settings.

The '-info' argument can display TED-info just like selecting a subtune by giving it as a standalone number anywhere. (These parameters can be given after the linux script 'crteda' too, for example in a folder full of TEDs play them by: crteda - -info ). Buffersize can be set between 256..32768 by '-bufsize xx' argument. The '-volume xx' argument can be given to set main-volume between 0..255.

The app-name now contains the 'R' because now a RealTED-like environment-mode is supported more-or-less ('RealTEDmode' in source). There are still some RTED tunes that are not played properly, mainly the ones using ROM extensively, because due to the copyright restrictions I didn't include a complete Plus4 ROM, just some snippets needed to play the existing tunes. Only 1% of the tunes suffer (play too fast or a bit slow.) I don't feel like debugging these tunes too now, enough is enough...

This release also contains shared and static library forms for better inclusion in other TED-playback projects, maybe to port to RockBox later like the cRSID which is now the main SID-playback engine in RockBox.

I completely eliminated global variables and definitions, except a 'cRTED_CPlus4' instance which is for faster access of struct members. (Emulated CPlus4 memory accesses are made to this for faster operation.)

More info (the API for the library) is seen in the 'libcRTED.h' file.

To emulate the TED sound as best as possible I made measurements and recording during te development of TEDzakker and took a lot of ideas/facts from plus4emu, FPGATED projects. I reused my audio-code completely from the TEDzakker project. But this time it's open-sourced finally. The distortion which I assume based on oscilloscope-measurements at the direct output of the TED chip is disabled now (just as in the r3 version of TEDzakker) until further confirmation of the phenomenon. Essentially the volume must be a little bit more than twice of the individual channels' volumes when both channels are on (due to the stronger driving of the integrator on the output of the TED. But when I simply did this (seen commented out in CPlus4/TED.h) the distortion became too evident, maybe
I'm not right about this at all...or not in the right way and need to dwelve into this topic a bit more.

License is WTF: Do what the f*ck you want with this code, but it would be nice mentioning me as the original author.



HVTC-ted collection
------------------------------
This is a Commodore Plus4 computer music-collection based on the original one called HVTC, maintained by Luca. But my new TED format holds the additional info for needed for continuous playback as a music collection (playtime auto-advance, author, title, subtune-skipping, etc.).
The .ted music files in the HVTC-ted folder can be played by my new cRTED tool. The playlist file (HVTC-playlist.tel) is to be opened by cRTED to play the whole collection.



HVTC-ted converter
------------------------------
A tool to create HVTC-ted music collection from original HVTC folder and webpage html-information. (TED-format is an enhancement of TMF format with the possibility to have the header/metadata at the end of the file.)

Prior Art: Thanks to Luca for collecting and processing all these TED music PRG files over the years into the original HVTC, and thanks to Siz for the new TMF-format specification that includes subtune-playtimes (durations), see tedmusiccollection.html.

Prerequisites:
'player' folder extracted from hvtc zip-archive into the same folder as HVTCted
'player-new' folder contains saved tunes that aren't yet in the hvtc zip file (just downloadable one-by-one from the plus4world/hvtc page)
'html' folder containing saved .html files (one-by-one from plus4world/hvtc) containing the individual TED-tunes. The html files are not included in this archive as they adds up to 15MB. But the resulting 'info'folder is contained (up to info from 877.html), so you won't need them.

Usage:
-If 'html' is given as argument, it will process the 'html' folder content into formatted .txt files 'html/info' folders.
-If a foldername is used as argument, it will generate the target folders with .ted files (described below).
-If an individual tune-name (without path but having '.prg' extension) is given as 2nd argument, only that file will be found in the given folder, and gets converted to TED file.


Generated folders:
'html/info' contains available metadata-info in .txt files converted from 'html' folder files by 'HVTCted html' command.

'edits/missing-info' contains missing metadata-info not extracted from the html files and not found and filled in 'edit' folder's txt files either. If the Author-name or tune-title is missing for some reason, HVTCted takes this info from the foldername and filename.

'edits' can have the .txt files for manual edits/completions of the missing or incorrect metadata, format: 'FieldName: Value' (SPACE is essential). Processed together with 'info' folder but with priority over it, files from 'missing-field' folder can be used as a base for editing.
Field-names: "Title", "Author", "Tool", "Date", "Covers", "Notes",
"Channels", "FrameSpeed", "PlayTime", "Looping",
for subtunes: "Title1","Title2",..., "PlayTime2", "PlayTime3",...,
"Covers2",..., "Notes2",...
"Looping2",..., "FrameSpeed2",... "Channels2",...
"KeyDelay", "KeyPress1","KeyPress2",... (keys are 0..9,A..Z,F1,F2,F3,HELP,Esc,... see in source)
"InitAddress", "PlayAddress" (followed by 4-digit hexa addresses, to convert to subtune-selectable PlayTEDs instead of RealTEDs)

If a .prg file with the same name and subfolder is present in 'edits' folder, it will replace the original .prg file before conversion to TED format.

'HVTC-ted' holds the generated TED files, the essential TED music collection, created by 'HVTCted player' then 'HVTCted player-new' commands.

'HVTC-info' folder contains the extra information not contained in the generated .TED files (that doesn't have a field or wouldn't fit).

TED-fileformat Info:
I kept the new expanded TMF format specification by Siz as intact as possible, but these are some compatible additions:

-the BASIC line-number in the SYS starter command is the address of the header in the Plus4 memory (starting with "TEDMUSIC" signature). If the line-number is less than 4096 and the "TEDMUSIC" signature is found at file-offset 17 cRTED assumes the TMF format, otherwise it expects TED-format
-if the PlayAddress field is $0000 in the TED(TMF) header cRTED assumes RealTED-mode, which means executing from InitAddress without return (In RealTED mode a more complete machine emulation is needed with raster-timer-IRQ, KERNAL-ROM routines, etc.)
-if the InitAddress field is $0000 cRTED assumes BASIC SYS starter mode as a fallback (with RealTED-mode of course)
-if there's 0 in a 'duration'/'playtime' field for any subtune it should be played infinitely (instead of being skipped immediately)
-Character codes in info-fields are not PETSCII but ASCII plus latin codepage 8859-1 (or 8859-2?) for accented/extra characters
-FileFlags at offset $27 has a new bit (bit1) to tell if keypress-block is present. If it is, it comes right after duration-block, starting with a keypress-delay value (in 100ms units) to wait tune-startup. Then every subtune has a 1-byte key-value that tells which key should be pressed. The number of the key is its position in the FD30/FF08
matrix, if no info about the key to press, value $FF is there.
-What about default subtune field?
-If I forgot any detail you may take the cRTED player's source code as a basis.

Copyright © Plus/4 World Team, 2001-2024