Expand description
ยง๐๐๐๐๐๐๐๐๐๐
๐ฎ ptcow ๐ฎ
๐๐๐๐๐๐๐๐๐๐
Library for editing and playback of PxTone (.ptcop) music.
Based on the PxTone C++ source code available here.
ยงโ Goals / โNon-goals
-
โ Support V5 (and newer) versions of PxTone.
-
โ No support for V4 and earlier. Maybe read support in the future, but no export support planned.
-
โ Rendering that sounds faithful to the original PxTone rendering
-
โ No sample-by-sample accuracy. There can be minor differences as long as it sounds (almost) indistinguishable.
ยงLimitations
- Currently, ptcow only supports little endian architectures. There may be big endian support added in the future, but itโs not a focus right now.
ยงGetting Started
To get started, load a .ptcop or .pttune file into a Vec<u8>, and call read_song on it.
You can also check out crates/ptmoo for a command line player that writes samples to stdout.
Re-exportsยง
pub use timing::Meas;pub use timing::SampleT;pub use timing::SamplesPerTick;pub use timing::Tick;pub use timing::Tick16;pub use timing::Timing;
Modulesยง
- timing
- Timing related definitions and utilities
Structsยง
- Delay
- A delay (reverb) effect
- EnvPt
- An envelope point
- Envelope
Src - Describes an envelope for a
Voice. - EveList
- List of
Events. - Event
- Song event
- FmtInfo
- Information about what format the song is
- Group
Idx - A group index.
- Herd
- The glorious cows that are going to moo your song
- Loop
Points - Where the song ends and starts repeating from, as defined by the song.
- Master
- Timing and loop points
- MooInstructions
- How to moo the song
- MooPlan
- Plan for the cows on how to moo the song
- Noise
Data - Noise generated with a waveform generator
- Noise
Design Oscillator - An oscillator for generating different kinds of noise waveforms.
- Noise
Design Unit - Describes how to generate a noise design waveform
- Noise
Design Unit Flags - What attributes of
NoiseDesignUnitto serialize - Noise
Table - Contains wave tables for generating different kinds of noises.
- OggV
Data - Ogg/Vorbis voice data
- Osci
Args - Oscillator arguments
- OsciPt
- 2d point for
coordandovertonebased wave generation. - Overdrive
- Overdrive effect that amplifies and cuts the samples of a sample group
- PcmData
- Describes PCM (Pulse Code Modulation) voice data
- Song
- A PxTone song
- Text
- Song name and comment
- Unit
- A ๐ cow that moos a channel of your song, otherwise known as a unit.
- UnitIdx
- Unit index
- Voice
- Audio data that gives
Units a voice. In other words, an instrument. - Voice
Flags - Different attributes a voice can have
- Voice
Idx - Voice index
- Voice
Instance - Contains the precomputed sample and envelope data for a voice
- Voice
Tone - Data keeping track of play state of a voice
- Voice
Unit - Data required to generate and play voice samples
Enumsยง
- Bps
- Bits per sample
- ChNum
- Channel number (mono or stereo)
- Delay
Unit - What unit should the delay frequency be treated as
- Event
Payload - Payload of an event
- FmtKind
- Kind of PxTone format we are dealing with
- FmtVer
- PxTone format version
- Noise
Type - Types of waves for noise generation
- Project
Read Error - Error that can happen when reading a PxTone project
- Start
PosPlan - Start position that can be given in different units
- Voice
Data - The data used for the voice waveform
- Wave
Data - What kind of wave to generate
Constantsยง
- DEFAULT_
KEY - The default
Keyunits start out with - NATIVE_
SAMPLE_ RATE - The sample rate
PxToneinternally works with
Functionsยง
- coord
- Get the amplitude of sample at
indexfor a coordinate based wave. - current_
tick - Get the current
Tickthe playback is at. - do_
event - Do a single event
- moo_
prepare - Prepare to
moo. - noise_
to_ pcm - Build PCM data out of
NoiseData. - overtone
- Get the amplitude of sample at
indexfor an Overtone based wave. - read_
song - Read a PxTone song from a byte array.
- rebuild_
tones - Adjust voice and effect tones to output sample rate
- serialize_
project - Serialize the project into the PxTone file format
Type Aliasesยง
- Key
- 1/256 of a semitone.
- PanTime
Buf - Buffer to store a
Unitโs audio samples before applying the pan time effect. - PanTime
Off - Pan-time offset.
- Read
Result - Result of attempting to read a PxTone project
- Sample
Rate - Wide enough to represent 48 Khz
- Source
Sample Rate - Some sources (Ogg/Vorbis) can have high sample rates (96 khz for example)