Coder Social home page Coder Social logo

sudomaker / tinyvgm Goto Github PK

View Code? Open in Web Editor NEW
18.0 4.0 4.0 53 KB

A lightweight library for parsing the VGM format.

License: GNU Affero General Public License v3.0

CMake 9.24% C 90.76%
vgm c99 c-library c vgmusic opl2 opl3 ym2612 ym2608 ym3812

tinyvgm's Introduction

TinyVGM Actions Status

A lightweight library for parsing the VGM format.

Features

  • Very tiny: less than 300 lines of code
  • Standard C99 with no platform-specific dependency
  • Supports all VGM features: metadata (GD3), data block, etc.
  • Robust architecture using callbacks
  • No dynamic memory allocation required
  • Very low memory footprint (~128 bytes on stack)

Usage

The TinyVGM.h file is well documented using Doxygen format.

Start by creating a TinyVGMContext. Fill the callbacks and user pointer. The command, read and seek callbacks is mandatory. Unused callbacks should be filled by NULLs. Then you can use the tinyvgm_parse_* functions.

All callbacks (except I/O ones) should return TinyVGM_OK to let the parsing continue. Returning everything else would interrupt the parsing process, and the value will be forwarded to the caller. This can be used to implement pausing and looping.

The read callback should return the number of bytes actually read. 0 for EOF, and negative values for error.

The seek callback should return 0 for success, and negative values for error.

See example.c for a complete example.

Licensing

This project uses the AGPLv3 license.

If you use this library in your own non-commercial projects, usually you don't need to release your code. See this FAQ.

If you see a possible license violation, don't hesitate to tell us.

Warning for GitHub Copilot (or any "Coding AI") users

"Fair use" is only valid in some countries, such as the United States.

This program is protected by copyright law and international treaties.

Unauthorized reproduction or distribution of this program (e.g. violating the GPL license), or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under law.

tinyvgm's People

Contributors

classicoldsong avatar mnhauke avatar mywave82 avatar reimunotmoe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.