Skip to content

Latest commit

 

History

History
94 lines (83 loc) · 2.67 KB

README.md

File metadata and controls

94 lines (83 loc) · 2.67 KB

ReaParser

Single file header-only C++11 file parser for Reaper project files.

Reverse engineering of Reaper project files is done empirically. ReaParser is experimental, some results may be unexpected.

Features

ReaParser can extract the following information from a Reaper project file:

Projects:

  • Name
  • Reaper version and OS saved with
  • Sample Rate
  • Master tempo and time signature

Tracks:

  • Name
  • Numeric ID
  • GUID
  • Volume/Pan
  • Mute/Solo
  • Phase
  • Media Items
  • FX Chain

Media Items:

  • Name
  • Associated filepath and file format
  • Start and end positions
  • Length

FX Plugins:

  • Name
  • Associated filepath and file format
  • Data string

Usage

Load project in memory

ReaParser::ReaProject project;
ReaParser::ReaOptions options;
options.NormalizePan = false;

try {
  project = ReaParser::LoadProjectFile("TestProject/TestProject.rpp", options);
}
catch (ReaParser::Exception& e) {
  std::cout << e.What() << std::endl;
}

Access project properties

std::cout << "Reaper project: " << project.Name << std::endl;
std::cout << "Reaper version: " << project.Version.ToString() << std::endl;
std::cout << "Sample rate: " << project.SampleRate << std::endl;
std::cout << "Tempo: " << project.Tempo.BPM << " bpm " << project.Tempo.Beats << "/" << project.Tempo.Bars << std::endl << std::endl;

Access tracks from project

if (project.Tracks.size() > 0) {
  for (auto& track : project.Tracks) {
    std::cout << track.NumericID << ") " << track.Name << " (" << track.GUID << ")\n";
    std::cout << "Volume: " << track.Volume << "dB Pan: " << track.Pan << "%\n";
    std::cout << "Muted: " <<
      (track.Muted ? "Yes" : "No") << std::endl;
    std::cout << "Phase: " <<
      (track.PhaseInverted ? "Flipped" : "Normal") << std::endl;
  }
}

Access media items from track

for (auto& track : project.Tracks) {
  if (track.MediaItems.size() > 0) {
    std::cout << "Items: ---------------------" << std::endl;
    for (auto& item : track.MediaItems) {
      std::cout << "\"" << item.Name << "\"" << std::endl;
      if (item.Type == ReaParser::ReaMediaType::Sample)
          std::cout << "FILE  : " << item.Filepath << std::endl;
      std::cout << "START : " << item.Start << "s" << std::endl;
      std::cout << "END   : " << item.End << "s" << std::endl;
      std::cout << "LENGTH: " << item.Length << "s" << std::endl;
    }
  }
}

(See Test.cpp for more functionality)

Todo

  • Project preferences
  • Automation
  • Regions
  • More Media Item details