Example #1
0
  timeToQuantizedBar(time) {
    return this.quantizeBar(this.timeToBar(time));
  },

  // Beat Scale
  // domain is time [s]
  // range is beats [b]
  beatScaleDomain: Ember.computed('duration', function() {
    return [0, this.get('duration')];
  }),
  beatScaleRange: Ember.computed('firstBarOffset', 'beatCount', function() {
    let { firstBarOffset, beatCount } = this.getProperties('firstBarOffset', 'beatCount');
    return [-firstBarOffset, beatCount - firstBarOffset];
  }),
  beatScale: computedObject(LinearScale, {
    'domain': 'beatScaleDomain',
    'range': 'beatScaleRange',
  }),
  quantizeBeatScaleRange: Ember.computed('beatScaleRange', function() {
    let beatScale = this.get('beatScale');
    let [rangeMin, rangeMax] = beatScale.get('range');
    // return d3.range(Math.ceil(rangeMin), Math.floor(rangeMax), 1);
    return [Math.ceil(rangeMin), Math.floor(rangeMax)];
  }),
  quantizeBeatScale: computedObject(QuantizeScale, {
    'domain': 'beatScaleRange',
    'range': 'quantizeBeatScaleRange',
  }),

  // Bar Scale
  // domain is time [s]
  // range is bars [ba]
Example #2
0
  //
  // Web Audio Nodes
  //
  // TODO(REFACTOR): how to distinguish between track gain, fx gain, arrangement gain?
  // TODO(REFACTOR): set GainControl.defaultValue based on track.audioMeta.loudness
  // that might mean making a specific TrackGainNode?
  // trackSourceNode: computedObject(TrackSourceNode, {
  //   'audioContext': 'audioContext',
  //   'track': 'track',
  //   'outputNode': 'outputNode.content',
  // }),

  soundtouchNode: computedObject(SoundtouchNode, {
    'audioContext': 'audioContext',
    'audioBuffer': 'audioBinary.audioBuffer',
    'outputNode': 'trackGainNode.content',
  }),

  trackGainNode: computedObject(GainNode, {
    'value': 'gain',
    'audioContext': 'audioContext',
    'outputNode': 'trackVolumeNode.content',
  }),

  trackVolumeNode: computedObject(GainNode, {
    'audioContext': 'audioContext',
    'outputNode': 'lowBandEqNode.content',
  }),

  lowBandFilterType: 'lowshelf',