Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

最近の作業部屋活動履歴

2023-08-20
2023-08-19
2023-08-18
2023-06-15
2023-06-05

最近のWikiの更新 (Recent Changes)

No changes on this wiki.

Wikiガイド(Guide)

サイドバー (Side Bar)

SatouSynth

VGM playback library for Common Lisp

Release Files

No download files.

Recent Commits

Révisionl'heureAuteurMessage: RSS
7d8ca9422023-08-20 16:47:44Remilia ScarletAdd a note that the repo has moved to https://chiselapp.c...
102459d02023-08-19 22:51:56Remilia ScarletFix a few typos, clean up some lines
223b236c2023-08-19 22:51:32Remilia ScarletDATA should always be 8-bit
6cc221fe2023-08-19 22:51:14Remilia ScarletChange fill-buffers so that it matches YunoSynth's behavior
1c7f18f22023-08-19 22:50:50Remilia ScarletQuit playing when the VGM has ended
8c1a80832023-08-18 19:06:44Remilia ScarletAdd a very simple example player.
fa90ff7c2023-08-18 19:06:35Remilia ScarletAdd missing exports
399f30022023-08-18 19:06:13Remilia ScarletAdd T/CHIP->NAME, T/CHIP->LONG-NAME, SUPPORTED-CHIPS, and...
bbcf16772023-08-18 19:05:08Remilia ScarletRender to float32
7e2489942023-08-18 19:04:52Remilia ScarletExport some more thing

SatouSynth

NOTE: Moved to https://chiselapp.com/user/MistressRemilia/repository/satou/

SatouSynth is a high-performance VGM playback library written entirely in Common Lisp. The goal is to provide native VGM playback in Common Lisp without bindings, a cleaned-up version of VGMPlay's code, and performance on par with my YunoSynth library.

Wanna support me? Buy me a coffee on Ko-Fi, or support me through Liberapay.

Buy Me a Coffee at ko-fi.com Donate using Liberapay

Example videos

Comming soon.

Features

  • Rendering of VGM files to PCM.
  • High quality resampling.
  • Compressed (gzip) VGM loading, as well as a mechanism to extend this with additional compression methods. New methods include:
    • BZip2 compressed VGMs
    • ZStandard compressed VGMs.
  • Full GD3 tag support.
  • DAC support.

Implemented Chips

More chips will be added as time goes on.

  • Hudson HuC6280 (two different cores)
  • Namco C352
  • Sega SegaPCM
  • Sega MultiPCM
  • Yamaha YM2151

Known Issues

  • The DAC code is not yet completely ported and, right now, does nothing.

Usage

This currently only supports SBCL.

Most dependencies can be installed using QuickLisp (though this hasn't been tested). The exception is the CL-SDM library, which can be obtained here.

Place this library (and the CL-SDM dependency) somewhere where ASDF can find them, then run this in your REPL:

(asdf:load-system :satou)

Example Player

This uses the CL-PortAudio for playback.

(defun play-vgm (filename)
  (let* ((buf-l (cl-sdm:new-array 1024 cl-sdm:t/int16))
         (buf-r (cl-sdm:new-array 1024 cl-sdm:t/int16))
         (buf (cl-sdm:new-array 2048 single-float 0.0))

         ;; Read VGM, then make a player.
         (vgm (satou:read-vgm-file filename))
         (player (satou:make-vgm-player vgm)))

    ;; Start PortAudio
    (pa:with-audio
      (pa:with-default-audio-stream (out 0 2 :sample-rate 44100.0d0
                                             :sample-format :float
                                             :frames-per-buffer 1024)
        ;; Start playback
        (satou:vgm-player-play player)
        (sdm:gc t)

        ;; Render loop
        (loop until (or (satou:vgm-player-at-end-p player)
                        (>= (satou:vgm-player-times-played player) 2))
              do ;; Render
                 (satou:vgm-player-render player buf-l buf-r)

                 ;; Interleave the buffers and convert to float32 for PortAudio
                 (loop for i fixnum from 0 below 1024
                       for j fixnum from 0 by 2
                       do (setf (aref buf j) (/ (aref buf-l i) 32768.0)
                                (aref buf (1+ j)) (/ (aref buf-r i) 32768.0)))

                 ;; Write to putput
                 (pa:write-stream out buf))))))

(play-vgm #P"/path/to/your/song.vgm")

Development

Flags for *FEATURES*

SatouSynth supports a few flags that can be put into *FEATURES* prior to compiling it.

  • :SATOU-DEBUG: Print various debug information to the console.
  • :SATOU-SUPER-DEBUG: Print even more debug information to the console.
  • :SATOU-WD40: Enable various micro-optimizations that may possibly do unsafe things in exchange for some small speed boosts.

File Names

In the chips folder, all files should follow this scheme:

  • chip-[CHIPNAME].lisp: This is the public interface for the chip. Replace [CHIPNAME] with the name of the chip (e.g. chip-ym2151.lisp).
  • emu-[CHIPNAME]-[BASE].lisp: This is the private emulator for the chip. Replace [CHIPNAME] with the name of the chip, and [BASE] with the code that the emulator is based on (e.g. emu-ym2151-mame.lisp).

Style info

I use a slightly unorthodox style for my code. Aside from these differences, please use normal Lisp formatting.

  • Keep lines 118 characters or shorter. Obviously sometimes you can't, but please try. Use 115 characters for Markdown files, though.
  • I mark types using the form T/..... For example, T/SOME-NEAT-TYPE. For predicates on these, use SOME-NEAT-TYPE-P.
  • No tabs. Only spaces.

How do I contribute?

  1. Go to https://osdn.net/users/yukiraven/pf/satousynth/ and clone the Mercurial repository.
  2. Create a new branch for your feature.
  3. Push locally to the new branch
  4. Create a ticket.

Contributors

Links and Licenses

SatouSynth itself is under the GNU Affero General Public License version 3.

The emulation cores, which were all ported by hand to Common Lisp, have various other licenses, which can be found in the docs/licenses folder in this repository. Most of them are from the MAME project.

Much of the playback code is indirectly based on heavily modified code from VGMPlay by Valley Bell, et al. via my YunoSynth library.

Latest updated Tickets

No tickets

About Chamber Wiki

Welcome to OSDN Wiki system. Here is your chamber Wiki space.

Check Wiki Guide (English) to refer syntax and functions.