Code Monkey home page Code Monkey logo

reaparser's Introduction

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

reaparser's People

Contributors

s95rob avatar

Stargazers

 avatar

Watchers

 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.