<commit_before>/* -*- Mode: C++ ; c-basic-offset: 8 -*- */
#ifndef LIBSFZ_SFZ_H
#define LIBSFZ_SFZ_H

// SFZ 1.0
// Copyright (c) 2008, <NAME>
//
// Contact: <EMAIL>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#include <fstream>
#include <vector>
#include <string>

#define TRIGGER_ATTACK  ((unsigned char) (1 << 0)) // 0x01
#define TRIGGER_RELEASE ((unsigned char) (1 << 1)) // 0x02
#define TRIGGER_FIRST   ((unsigned char) (1 << 2)) // 0x04
#define TRIGGER_LEGATO  ((unsigned char) (1 << 3)) // 0x08

namespace sfz 
{

	// Forward declarations
	class Group;
	class Region;
	class Instrument;
	class File;

	// Enumerations
	enum sw_vel_t   { VEL_CURRENT, VEL_PREVIOUS };
	enum off_mode_t { OFF_FAST, OFF_NORMAL };

	typedef unsigned char trigger_t;
	typedef unsigned char uint8_t;

	/////////////////////////////////////////////////////////////
	// class Region

	/// Defines Region information of an Instrument
	class Region
	{
	public:
		Region();
		virtual ~Region();

		/// Return true if region is triggered by key
		bool OnKey(uint8_t chan, uint8_t key, uint8_t vel,
			   int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,
			   uint8_t prog, float rand, trigger_t trig, uint8_t* cc,
			   float timer, uint8_t seq, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);

		/// Return true if region is triggered by control change
		bool OnControl(uint8_t chan, uint8_t cont, uint8_t val,
			       int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,
			       uint8_t prog, float rand, trigger_t trig, uint8_t* cc,
			       float timer, uint8_t seq, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);

// 		Articulation* GetArticulation(int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft, uint8_t cc*);

		// unique region id
		int id;

		// sample definition
		std::string sample;

		// input controls
		int   lochan;    int   hichan;
		int   lokey;     int   hikey;
		int   lovel;     int   hivel;
		int   locc[128]; int   hicc[128];
		int   lobend;    int   hibend;
		int   lobpm;     int   hibpm;
		int   lochanaft; int   hichanaft;
		int   lopolyaft; int   hipolyaft;
		int   loprog;    int   hiprog;
		float lorand;    float hirand;
		float lotimer;   float hitimer;

		int seq_length;  
		int seq_position;
		
		int start_locc[128]; int start_hicc[128];
		int stop_locc[128];  int stop_hicc[128];

		int sw_lokey;    int sw_hikey;  
		int sw_last;
		int sw_down;
		int sw_up;
		int sw_previous; 
		sw_vel_t sw_vel;

		trigger_t trigger;

		int group;
		int off_by;
		off_mode_t off_mode;

		int on_locc[128]; int on_hicc[128];

		// sample player
		int count;
		float delay; float delay_random; float delay_oncc[128];
		int delay_beats; itn stop_beats;
		int delay_samples; int delay_samples_oncc[128];
		int end;
		int loop_crossfade;
		int offset; int offset_random; int offset_oncc[128];
		loop_mode_t loop_mode;
		int loop_start; int loop_end;
		int sync_beats;
		itn sync_offset;
		
		// amplifier
		int volume;
		int pan;
		int width;
		int position;
		int amp_keytrack; int amp_keycenter; int amp_veltrack; _nt amp_velcurve_N; int amp_random;
		int rt_decay;
		int gain_oncc[128];
		int xfin_lokey; int xfin_hikey;
		int xfout_lokey; int xfout_hikey;
		int xf_keycurve;
		int xfin_lovel; int xfin_hivel;
		int xfout_lovel; int xfout_hivel;
		int xf_velcurve;
		int xfin_locc; int xfin_hicc;
		int xfout_locc; int xfout_hicc;
		int xf_cccurve;

		// pitch
		int traspose;
		int tune;
		int pitch_keycenter; int pitch_keytrack; int pitch_veltrack; int pitch_random;
		int bend_up; int bend_down; int bend_step;
	};

	/////////////////////////////////////////////////////////////
	// class Instrument<commit_msg>Fixed some typos and omitted stuff from last commit.<commit_after>/* -*- Mode: C++ ; c-basic-offset: 8 -*- */
#ifndef LIBSFZ_SFZ_H
#define LIBSFZ_SFZ_H

// SFZ 1.0
// Copyright (c) 2008, <NAME>
//
// Contact: <EMAIL>
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

#include <fstream>
#include <vector>
#include <string>

#define TRIGGER_ATTACK  ((unsigned char) (1 << 0)) // 0x01
#define TRIGGER_RELEASE ((unsigned char) (1 << 1)) // 0x02
#define TRIGGER_FIRST   ((unsigned char) (1 << 2)) // 0x04
#define TRIGGER_LEGATO  ((unsigned char) (1 << 3)) // 0x08

namespace sfz 
{

	// Forward declarations
	class Group;
	class Region;
	class Instrument;
	class File;

	// Enumerations
	enum sw_vel_t    { VEL_CURRENT, VEL_PREVIOUS };
	enum off_mode_t  { OFF_FAST, OFF_NORMAL };
	enum loop_mode_t { NO_LOOP, ONE_SHOT, LOOP_CONTINOUS, LOOP_SUSTAIN };

	typedef unsigned char trigger_t;
	typedef unsigned char uint8_t;

	/////////////////////////////////////////////////////////////
	// class Region

	/// Defines Region information of an Instrument
	class Region
	{
	public:
		Region();
		virtual ~Region();

		/// Return true if region is triggered by key
		bool OnKey(uint8_t chan, uint8_t key, uint8_t vel,
			   int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,
			   uint8_t prog, float rand, trigger_t trig, uint8_t* cc,
			   float timer, uint8_t seq, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);

		/// Return true if region is triggered by control change
		bool OnControl(uint8_t chan, uint8_t cont, uint8_t val,
			       int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft,
			       uint8_t prog, float rand, trigger_t trig, uint8_t* cc,
			       float timer, uint8_t seq, bool* sw, uint8_t last_sw_key, uint8_t prev_sw_key);

// 		Articulation* GetArticulation(int bend, uint8_t bpm, uint8_t chanaft, uint8_t polyaft, uint8_t cc*);

		// unique region id
		int id;

		// sample definition
		std::string sample;

		// input controls
		int   lochan;    int   hichan;
		int   lokey;     int   hikey;
		int   lovel;     int   hivel;
		int   locc[128]; int   hicc[128];
		int   lobend;    int   hibend;
		int   lobpm;     int   hibpm;
		int   lochanaft; int   hichanaft;
		int   lopolyaft; int   hipolyaft;
		int   loprog;    int   hiprog;
		float lorand;    float hirand;
		float lotimer;   float hitimer;

		int seq_length;  
		int seq_position;
		
		int start_locc[128]; int start_hicc[128];
		int stop_locc[128];  int stop_hicc[128];

		int sw_lokey;    int sw_hikey;  
		int sw_last;
		int sw_down;
		int sw_up;
		int sw_previous; 
		sw_vel_t sw_vel;

		trigger_t trigger;

		int group;
		int off_by;
		off_mode_t off_mode;

		int on_locc[128]; int on_hicc[128];

		// sample player
		int count;
		float delay; float delay_random; float delay_oncc[128];
		int delay_beats; int stop_beats;
		int delay_samples; int delay_samples_oncc[128];
		int end;
		int loop_crossfade;
		int offset; int offset_random; int offset_oncc[128];
		loop_mode_t loop_mode;
		int loop_start; int loop_end;
		int sync_beats;
		int sync_offset;
		
		// amplifier
		int volume;
		int pan;
		int width;
		int position;
		int amp_keytrack; int amp_keycenter; int amp_veltrack; int amp_velcurve_N; int amp_random;
		int rt_decay;
		int gain_oncc[128];
		int xfin_lokey; int xfin_hikey;
		int xfout_lokey; int xfout_hikey;
		int xf_keycurve;
		int xfin_lovel; int xfin_hivel;
		int xfout_lovel; int xfout_hivel;
		int xf_velcurve;
		int xfin_locc; int xfin_hicc;
		int xfout_locc; int xfout_hicc;
		int xf_cccurve;

		// pitch
		int traspose;
		int tune;
		int pitch_keycenter; int pitch_keytrack; int pitch_veltrack; int pitch_random;
		int bend_up; int bend_down; int bend_step;
	};

	/////////////////////////////////////////////////////////////
	// class Instrument
{'fraction_non_alphanumeric': 0.11308432630614115, 'fraction_numerical': 0.022685609532538956, 'mean_word_length': 2.973145197997269, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '39169', 'n_tokens_mistral': 3459, 'n_tokens_neox': 3078, 'n_words': 1021}