Guest User

Untitled

a guest
Sep 19th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System;
  4.  
  5. public class H2_Chroma : MonoBehaviour
  6. {
  7.     AudioSource notePlayer_src;
  8.     AudioClip notePlayer_clip;
  9.     int notePlayer_writeHead;
  10.    
  11.     float shepardVol = 1.0f;
  12.  
  13.     class ClockItem
  14.     {
  15.         public F4d_CombTidy combFilter;
  16.         public GameObject combCapsule;
  17.        
  18.         public G2a_Shepard shepardTone;
  19.         public GameObject tonemeCapsule;
  20.        
  21.         public float volRecent;
  22.        
  23.         public ClockItem( int noteIndex )
  24.         {
  25.             float freq_A4_Midi69 = 440.0f;
  26.             const int midiNote_A4 = 69;
  27.             const int midiNote_A1 = 33;
  28.             const int midiNote_C2 = midiNote_A1 + 3;
  29.             const int midiNote_C0 = midiNote_C2 - 24;
  30.             const int midiNote_FG2 = midiNote_A1 + 9;
  31.             int midiNote_lowest = midiNote_FG2;
  32.            
  33.             int clockPos;
  34.             float freq;
  35.             {
  36.                 int midiNote = midiNote_lowest + noteIndex;
  37.                
  38.                 clockPos = ( midiNote - midiNote_C0 ) % 12; // remember C is at 12 O'clock
  39.                 freq = freq_A4_Midi69 * Mathf.Pow( 2.0f, ( midiNote - midiNote_A4 ) / 12.0f );
  40.             }
  41.            
  42.             volRecent = 0.0f;
  43.            
  44.             // COMB FILTER
  45.             this.combFilter = new F4d_CombTidy( freq, 0.5f );
  46.            
  47.             // SHEPARD TONE
  48.             // error CS0038: Cannot access a nonstatic member of outer type `UnityEngine.Component' via nested type `H2_Chroma.ClockItem'
  49.             this.shepardTone = new G2a_Shepard( clockPos, transform );
Add Comment
Please, Sign In to add comment