public TractUI(Trombone trombone, Tract tract) { this.trombone = trombone; this.tract = tract; SetRestDiameter(); for (var i = 0; i < this.tract.n; i++) { this.tract.diameter[i] = this.tract.targetDiameter[i] = this.tract.restDiameter[i]; } tongueLowerIndexBound = this.tract.bladeStart + 2; tongueUpperIndexBound = this.tract.tipStart - 3; tongueIndexCentre = 0.5f * (tongueLowerIndexBound + tongueUpperIndexBound); }
// Use this for initialization void Start() { // Hook up trombone components sampleRate = AudioSettings.outputSampleRate;// / downsampling; bufferSize = AudioSettings.GetConfiguration().dspBufferSize; glottis = new Glottis(this); tract = new Tract(this, glottis); tractUI = new TractUI(this, tract); aspirateFilter = BiQuadFilter.BandPassFilterConstantSkirtGain(sampleRate, 500, 0.5f); fricativeFilter = BiQuadFilter.BandPassFilterConstantSkirtGain(sampleRate, 1000, 0.5f); SetDownsamplingLevel(downsamplingLevel); // Dispatch thread if requested if (DO_THREADING) { _thread = new Thread(ThreadedWork); _thread.IsBackground = true; _thread.Start(); } }