// ==ByteBeat== // ^ above line must be exactly like that and be first. // this header contains metadata for the song // specify fields with lines like "// @field-name field-value" // JSON strings are parsed. you can put in fields not recognized // by libbytebeat, in which case they will be passed to the library // user. fields from https://ffmpeg.org/doxygen/7.0/group__metadata__api.html // can be recognized by media players, for example. // all fields recognized by libbytebeat come with defaults, shown below // // // Playback mode. Possible values: // - bytebeat : 0..255 ints, wrapped // - sbytebeat : -128..127 ints, wrapped // - floatbeat : -1..1 floats, clamped // - funcbeat : floatbeat but you return a function(t, freq); statement mode // - chunkbeat : custom libbytebeat format. // statement mode just like funcbeat, but you return an object in this form: // { // // number of channels // channels: int, // // // // // write `t .. t + len` floatbeat samples to `buf` with channels // // interleaved // // // // return an optional data for use in `postproc` (which is run on a // // separate JS environment) // // // // this function will be run in a "parallelized" fashion across multiple // // separate JS environments, do not rely on continuity of t // // (unless @parallel no) // // // read: function( // t: int, freq: number, // buf: Float32Array, len: int, // // // // // instead of throwing, pass errors into this function as the msg // // argument // // // logger: function(msg: any, t: int) // ): Uint8Array|ArrayBuffer|nullish, // // // // // like `read`, but single-threaded. during normal playback you can rely on // // t being continuous. `udata` contains the data returned from `read` // // // postproc: function( // t: int, freq: number, // buf: Float32Array, len: int, // logger: function(msg: any, t: int), // udata: Uint8Array|nullish // } // // it is recommended that the object you return is also a function compatible // with funcbeat, so that other players can play your song too. // // @mode bytebeat // // // Sample rate // // @freq 8000 // // // Length of the song, in samples // // @len Infinity // // // Set this to "no" if your code depends on side effects from // previous samples, and doesn't work with constant jumps of // `t` well. // // @parallel yes // // // Set this to "no" if your code doesn't work with jumps of `t` // at all. For example "Time Is A Suggestion", where `t` is not // used at all and the song just guesses the correct value. // // @seekable yes // // // If enabled, upscales the song to 48kHz with nearest neighbor. // By default enabled if sample rate is below 44100. // // @f48k auto // // // If enabled passes the entire song through a high-pass filter // with a pass frequency of like 15 Hz. This ensures that the // wavefront is centered at the, well, center. You may disable // this if your song outputs a properly centered wave. // // @dcClean yes // // // If you output textual graphics by throwing errors, set this // to the dimensions of the virtual "screen", in characters, // e.g. 80x25 // // @term // // -- metadata of this song below -- // // @title "Combined xpansive's and varjohukka's stuff" // @artist viznut // @comment remix of Lost in Space by xpansive // ^^ these 3 tags are used by ffmpeg demuxer and mpv // // @len 524288 // // ==/ByteBeat== (t>>7|t|t>>6)*10+4*(t&t>>13|t>>6)