frno7 / psgplay Goto Github PK
View Code? Open in Web Editor NEWPSG play is a music player and emulator for the Atari ST Programmable Sound Generator (PSG) YM2149.
PSG play is a music player and emulator for the Atari ST Programmable Sound Generator (PSG) YM2149.
Originally posted by rnjacobs May 7, 2022
I was hoping to listen to sndh files composed by !cube - http://cube.gfxile.net/t/index.php?page=journal&journal=YM2149F - but none of them work in psgplay. Am I doing something wrong? Is he doing something unusual? Should they work?
Thank you!
Error message:
psgplay % make V=1 all
lib/internal/Makefile:19: WARNING: Disassembler disabled: The C compiler does not support __attribute__((__scalar_storage_order__("big-endian")))
cc -shared -Wl,-soname,libpsgplay.so.0 -g -o lib/psgplay/libpsgplay.so lib/psgplay/ice.o lib/psgplay/version.o lib/psgplay/psgplay.o lib/psgplay/sndh.o lib/psgplay/bit.o lib/psgplay/fifo.o lib/psgplay/print.o lib/psgplay/string.o lib/psgplay/bus.o lib/psgplay/cpu.o lib/psgplay/device.o lib/psgplay/exception-vector.o lib/psgplay/fdc.o lib/psgplay/glue.o lib/psgplay/machine.o lib/psgplay/mfp.o lib/psgplay/mixer.o lib/psgplay/mmu.o lib/psgplay/mmu-trace.o lib/psgplay/psg.o lib/psgplay/ram.o lib/psgplay/rom.o lib/psgplay/shifter.o lib/psgplay/sound.o lib/psgplay/system-variable.o lib/psgplay/m68kops.o lib/psgplay/m68kcpu.o
ld: unknown options: -soname
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [lib/psgplay/libpsgplay.so] Error 1
It was just discovered that http://sndh.atari.org/sndh/sndh_lf/Mad_Max/Demos/So_Watt/S_O_S.sndh 's (https://demozoo.org/music/114761/) bass sounds wrong - maybe some envelope setting? Checked with native Linux wav renderer and also in the emscripten build. This is prbly a fix that might help alot of other songs, too.
Make a PSG play plugin for the Music Player Daemon (MPD).
Implement a driver for Core Audio in lib/out/core-audio.c
. PSG play for Mac OS is currently limited to saving WAVE format files. Linux, on the other hand, also has a driver for ALSA in lib/out/alsa.c
, which permits an interactive text mode user interface:
Starts playing nice, then after 23 seconds it exits violently with:
psgplay: error: (null): ALSA snd_pcm_writei failed: -32 Broken pipe
Also leaving the terminal in a bad state.
PS: Wondering how I can make it play without alsa. Maybe adding a feature that an output file of "-" means to dump the wav to stdout, then I can pipe it into any player. Asking psgplay to write to a named pipe does unfortunately not work "Illegal seek".
Have PSG play disassemble files in m68k Motorola syntax rather than MIT syntax.
Some SNDH files made for the Atari STE make use of the LMC1992 circuit for tone and volume control. Let PSG play emulate this piece of hardware:
The LMC1992 is a monolithic integrated circuit that providesfour stereo inputs, bass and treble tone controls, and volume, balance, and front-rear fader controls. These functions are digitally controlled through a three-wire communication interface.
Plan:
lib/atari/mixer.c
;As an option, a dual screen is displayed via the serial port of the Atari ST, for remote control using a null modem or similar. See also #6. PSG play for Atari ST currently displays a VT52 video screen:
I hit a little bump building psgplay. Here's the end of the output:
$ make ALSA=1
...
CC lib/m68k/m68kdasm.o
CC lib/m68k/softfloat.o
CC lib/psgplay/psgplay.o
CC lib/psgplay/sndh.o
script/version: 4: set: Illegal option -o pipefail
lib/psgplay/Makefile:15: recipe for target 'lib/psgplay/version.c' failed
make: *** [lib/psgplay/version.c] Error 2
I discovered that set -o pipefail
is a bashism, and that bash
is not the default shell on my machine.
I was able to fix the problem by changing the shebang of script/version
from #!/bin/sh
to #!/bin/bash
Happy to submit a PR if you like.
Emulate
For details, see #13 (comment).
TOS/libc in lib/toslibc
is a variant of a C standard library that can be used to build other C programs for Atari ST, and so it makes sense to create a new TOS/libc repository for it. Its main feature is that a normal unmodified m68k compiler can be used without applying any patches. Unlike traditional Atari ST compilers, C int
type integers are 32-bit rather than 16-bit.
The FreeMiNT libcmini package is similar, but it requires a special m68k-atari-mint compiler.
Building PSG play as a library allows other music players to link with it.
include/psgplay/psgplay.h
and have it read PSG samples in direct 250 kHz digital three channel form, to permit custom analogue filters and mixers.libpsgplay.a
and libpsgplay.so
build targets to Makefile
.install
target with PREFIX
parameter to Makefile
.lib/psgplay/example-info.c
to print SNDH information.lib/psgplay/example-play.c
to produce 16-bit 44.1 kHz stereo on standard output.Write a doc/psgplay.1
manual page describing how to use the PSG play program for Linux and Mac OS.
Some SNDH files made for the Atari STE make use of its sound DMA hardware. Let PSG play emulate this piece of hardware. Plan:
lib/atari/sound.c
;This track is playing too slow:
https://sndh.atari.org/?ID=1441
I am speculating that it's because of the 200Hz?
Checked with command line: same problem.
As an option, have PSG play on Atari ST accept MIDI commands in two forms:
As a variant, the standard MIDI file (SMF) file format could be supported.
In the SNDH archive, file Daglish_Ben/Footballer_of_the_Year_2.sndh
plays a couple of seconds then the rest is silent.
In interactive mode it shows that it is still playing track 1 although there is no sound.
Is it possible to get psgplay to move onto the next track when the first one has finished playing? --stop=auto
isn't working for this particular file.
Maybe silence detection is required?
Originally mentioned in #13 (comment)
While writing out the 3 single channels I stumbled upon:
Line 422 in 7a5b345
!pp->stereo_frequency
?This file is just playing a tone. I updated to the latest as I was a bit of of date, but no change:
Tao/TSD_STe/Intensity.sndh
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.