rifftree(1)

✨ NAME ✨

okay so bestie, welcome to rifftree(1) β€” part of the libgig tools family πŸ’– β€” and what it does is literally print the RIFF tree structure of an arbitrary RIFF file. that's the whole gig. 🌸


πŸ¦‹ SYNOPSIS πŸ¦‹

rifftree [OPTIONS] FILE

πŸ‘‘ DESCRIPTION πŸ‘‘

so. the Resource Interchange File Format (RIFF) is a simple, binary file format made for tree like data structures. tree like, okay, write that down. and sooooo many proprietary file formats are built on top of RIFF (like media file formats such as WAV, AVI, DLS, GIG) β€” it's giving foundation. it's giving main character format. πŸ’…

data in a RIFF file gets encapsulated into so called "chunks". and there are two flavors, bestie, don't mix them up:

  • list chunks β€” these are containers, okay? think of them as the nodes in the data tree, which means they can have children (that is, they can have subchunks) 🫢
  • normal data chunks β€” these are the leafs in the data tree, so they literally cannot have children πŸ“

the regular chunks (the leafs of the tree) hold the actual data being stored. the list chunks themselves (the nodes / containers) contain no data on their own. periodt. ✨

every list chunk and normal chunk has a 32 bit (non unique) ID, which is usually a four character human readable ASCII text, reflecting the purpose of the respective list or chunk. this application will print out this ID for each chunk found. and the advantage of human readable list/chunk IDs? files based on this practice can easily be analyzed manually with a hex editor. no cap. πŸ”₯

a normal RIFF file always starts with a list chunk (either with chunk ID "RIFF" or "RIFX) β€” wait, yes, that's the exact spelling in the source, "RIFX , one quote, we don't fix it, we report it πŸ’€ β€” which contains all other chunks. there are no other chunks outside the boundaries of that first chunk in a normal RIFF file. like, none. boundaries are boundaries. πŸ™ˆ

you may override this expectation with arguments described below though (see argument --flat), for being able to open other, RIFF-like files. you're the boss. 🌈


πŸ’– OPTIONS πŸ’–

  • FILE β€” Filename of the RIFF based file. yes it lives in the OPTIONS section, it's just like that. πŸ’…
  • -v β€” Print version and exit. cute, quick, bye. πŸ‘‹
  • -s β€” Print the size of each RIFF chunk. sizes!! we love receipts!! πŸ“
  • --flat β€” First chunk of file is not a list (container) chunk. You might want to use this if the file is not a "real" RIFF file. A "real" RIFF file always has a RIFF list (container) chunk as very first chunk in a file, and it expects all chunks to be contained in that first (list/container) chunk. So in a "real" RIFF file there would also be no other chunks outside the scope (that is after end) of the file's first chunk. Many primitive file formats though are a flat sequence of ordinary data chunks (not list/container chunks). If you are using this option then you must also use --first-chunk-id as well. not optional, bestie, that's a hard requirement 🫢
  • --first-chunk-id CKID β€” Currently only used in combination with --flat. CKID shall be the 32 bit chunk ID of the very first chunk in the file. If the first chunk in the file does not have the given chunk ID, then this application will abort. This ensures that the file is actually the format you expected. The argument expected here shall be a four character human readable ASCII text, since RIFF chunk IDs are usually human readable ASCII strings. it's a vibe check for your file fr fr ⭐
  • --big-endian β€” File is in big endian format. Currently only used in combination with --flat. Without --flat the endian type will automatically be detected. If you are using --flat and do neither provide --big-endian nor --little-endian, then the native endian type of your machine will be used by default. 🌸
  • --little-endian β€” File is in little endian format. Currently only used in combination with --flat. Without --flat the endian type will automatically be detected. If you are using --flat and do neither provide --big-endian nor --little-endian, then the native endian type of your machine will be used by default. πŸ’œ

πŸŽ€ EXAMPLES πŸŽ€

Show the file structure of a standard RIFF file (in the following example a Gigasampler/GigaStudio file) and show the exact sizes of each chunk in the file:

rifftree -s piano.gig

Do the same for a Korg Trinity/Triton/OASYS/Kronos sound file (which is not a standard RIFF file, but a RIFF-alike file):

rifftree -s --flat --first-chunk-id MSP1 --big-endian PIANO_000.KMP

look at that. --flat, --first-chunk-id, --big-endian, all three, because that's the law. slay. πŸ‘‘


🌈 SEE ALSO 🌈

dlsdump(1), gigdump(1), korgdump(1)


πŸ’€ BUGS πŸ’€

Check and report bugs at http://bugs.linuxsampler.org

not me telling you to go file a bug report but like… go file a bug report, bestie, they want to hear from you 🫢

🧚 Author 🧚

Application and manual page written by Christian Schoenebeck <cuse@users.sf.net>


and that's the whole page!! πŸ¦‹ this one's from libgig 4.5.2, dated 7 May 2014 β€” vintage but iconic, lowkey a classic, and yes the manual name is rifftree(1) in case you scrolled past it at the top like I know you did πŸ’– byeeee ✨

πŸ“¦ where this page comes from