<commit_before>"use strict";

import React from 'react';

class WaveFormSelector extends React.Component {
  constructor(props) {
    super(props);

    this.setWaveFormValue = this.setWaveFormValue.bind(this);
  };

  setWaveFormValue(e) {
    this.props.setWaveFormValue(e.target.value);
  };

  render() {
    return <span className="control">
      <label className="control-label indented">Waveform:</label>
      <span className="flex waveformOptionsContainer">
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Sine"} value="sine" type="radio" checked={this.props.waveFormValue === "sine"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Sine"} className="radioLabel">Sine</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Square"} value="square" type="radio" checked={this.props.waveFormValue === "square"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Square"} className="radioLabel">Square</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Sawtooth"} value="sawtooth" type="radio" checked={this.props.waveFormValue === "sawtooth"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Sawtooth"} className="radioLabel">Saw</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Triangle"} value="triangle" type="radio" checked={this.props.waveFormValue === "triangle"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Triangle"} className="radioLabel">Triangle</label>
        </span>
      </span>
    </span>;
  };
};


class SampleInstrumentEditor extends React.Component {
  constructor(props) {
    super(props);

    this.handleSubmit = this.handleSubmit.bind(this);
    this.setFilterCutoff = this.setFilterCutoff.bind(this);
    this.setFilterResonance = this.setFilterResonance.bind(this);
    this.setFilterModulator = this.setFilterModulator.bind(this);
    this.setFilterLFOAmplitude = this.setFilterLFOAmplitude.bind(this);
    this.setFilterLFOFrequency = this.setFilterLFOFrequency.bind(this);
    this.setFilterLFOWaveForm = this.setFilterLFOWaveForm.bind(this);
    this.setFilterEnvelopeAttack = this.setFilterEnvelopeAttack.bind(this);
    this.setFilterEnvelopeDecay = this.setFilterEnvelopeDecay.bind(this);
    this.setFilterEnvelopeSustain = this.setFilterEnvelopeSustain.bind(this);
    this.setFilterEnvelopeRelease = this.setFilterEnvelopeRelease.bind(this);
    this.setEnvelopeAttack = this.setEnvelopeAttack.bind(this);
    this.setEnvelopeDecay = this.setEnvelopeDecay.bind(this);
    this.setEnvelopeSustain = this.setEnvelopeSustain.bind(this);
    this.setEnvelopeRelease = this.setEnvelopeRelease.bind(this);
  };

  handleSubmit(e) {
    e.preventDefault();
    this.props.setBufferFromFile(this.props.instrument.id, this.fileInput.files[0]);
  };

  setFilterCutoff(e) {<commit_msg>File upload input reset after file is successfully uploaded<commit_after>"use strict";

import React from 'react';

class WaveFormSelector extends React.Component {
  constructor(props) {
    super(props);

    this.setWaveFormValue = this.setWaveFormValue.bind(this);
  };

  setWaveFormValue(e) {
    this.props.setWaveFormValue(e.target.value);
  };

  render() {
    return <span className="control">
      <label className="control-label indented">Waveform:</label>
      <span className="flex waveformOptionsContainer">
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Sine"} value="sine" type="radio" checked={this.props.waveFormValue === "sine"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Sine"} className="radioLabel">Sine</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Square"} value="square" type="radio" checked={this.props.waveFormValue === "square"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Square"} className="radioLabel">Square</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Sawtooth"} value="sawtooth" type="radio" checked={this.props.waveFormValue === "sawtooth"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Sawtooth"} className="radioLabel">Saw</label>
        </span>
        <span className="radioContainer">
          <input id={this.props.idPrefix + "Triangle"} value="triangle" type="radio" checked={this.props.waveFormValue === "triangle"} onChange={this.setWaveFormValue} />
          &nbsp;<label htmlFor={this.props.idPrefix + "Triangle"} className="radioLabel">Triangle</label>
        </span>
      </span>
    </span>;
  };
};


class SampleInstrumentEditor extends React.Component {
  constructor(props) {
    super(props);

    this.handleSubmit = this.handleSubmit.bind(this);
    this.setFilterCutoff = this.setFilterCutoff.bind(this);
    this.setFilterResonance = this.setFilterResonance.bind(this);
    this.setFilterModulator = this.setFilterModulator.bind(this);
    this.setFilterLFOAmplitude = this.setFilterLFOAmplitude.bind(this);
    this.setFilterLFOFrequency = this.setFilterLFOFrequency.bind(this);
    this.setFilterLFOWaveForm = this.setFilterLFOWaveForm.bind(this);
    this.setFilterEnvelopeAttack = this.setFilterEnvelopeAttack.bind(this);
    this.setFilterEnvelopeDecay = this.setFilterEnvelopeDecay.bind(this);
    this.setFilterEnvelopeSustain = this.setFilterEnvelopeSustain.bind(this);
    this.setFilterEnvelopeRelease = this.setFilterEnvelopeRelease.bind(this);
    this.setEnvelopeAttack = this.setEnvelopeAttack.bind(this);
    this.setEnvelopeDecay = this.setEnvelopeDecay.bind(this);
    this.setEnvelopeSustain = this.setEnvelopeSustain.bind(this);
    this.setEnvelopeRelease = this.setEnvelopeRelease.bind(this);
  };

  handleSubmit(e) {
    e.preventDefault();
    this.props.setBufferFromFile(this.props.instrument.id, this.fileInput.files[0]);
    this.fileInput.value = "";
  };

  setFilterCutoff(e) {
{'fraction_non_alphanumeric': 0.14088090316425506, 'fraction_numerical': 0.0003180155827635554, 'mean_word_length': 4.469565217391304, 'pattern_counts': {'":': 0, '<': 55, '<?xml version=': 0, '>': 55, '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': '4920725', 'n_tokens_mistral': 1970, 'n_tokens_neox': 1914, 'n_words': 267}