Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanza3D committed Aug 25, 2020
1 parent e77bbcc commit d085a82
Show file tree
Hide file tree
Showing 14 changed files with 296 additions and 235 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ ehthumbs.db
[Tt]humbs.db
[Dd]esktop.ini

[Bb]uilds

# Visual Studio / MonoDevelop generated
# =====================================
[Ee]xported[Oo]bj/
Expand Down
Binary file modified .vs/osu-trigen/v16/.suo
Binary file not shown.
155 changes: 22 additions & 133 deletions Assets/Scenes/osu!trigen.unity
Original file line number Diff line number Diff line change
Expand Up @@ -890,11 +890,11 @@ GameObject:
- component: {fileID: 12961585}
m_Layer: 5
m_Name: ResetTri (3)
m_TagString: textcol
m_TagString: ColourUI
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &12961584
RectTransform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -2818,7 +2818,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Report Bug
m_Text: Source Code
--- !u!222 &147887450
CanvasRenderer:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -6298,7 +6298,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &352276160
MonoBehaviour:
Expand Down Expand Up @@ -7896,7 +7896,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &462535010
GameObject:
Expand Down Expand Up @@ -10367,7 +10367,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: Source Code
m_Text: Report a Bug
--- !u!222 &621373154
CanvasRenderer:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -11209,7 +11209,7 @@ PrefabInstance:
- target: {fileID: 5048106504107860607, guid: 6b6180b695f54a04089874ac3a0b828c,
type: 3}
propertyPath: m_RootOrder
value: 11
value: 10
objectReference: {fileID: 0}
- target: {fileID: 5048106504107860607, guid: 6b6180b695f54a04089874ac3a0b828c,
type: 3}
Expand Down Expand Up @@ -12178,7 +12178,7 @@ MonoBehaviour:
m_GameObject: {fileID: 761925103}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3bbbc8d6ebc12d04ea17c53fea98f66b, type: 3}
m_Script: {fileID: 0}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &764327574
Expand Down Expand Up @@ -12501,7 +12501,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 47.599003, y: 0, z: 0}
--- !u!1 &782119943
GameObject:
Expand Down Expand Up @@ -15671,7 +15671,7 @@ RectTransform:
m_Children:
- {fileID: 857853786}
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
Expand Down Expand Up @@ -16953,7 +16953,7 @@ GameObject:
- component: {fileID: 1101708476}
m_Layer: 5
m_Name: ResetTri
m_TagString: textcol
m_TagString: ColourUI
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -17280,7 +17280,7 @@ GameObject:
- component: {fileID: 1138033871}
m_Layer: 5
m_Name: ResetTri (1)
m_TagString: textcol
m_TagString: ColourUI
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -18559,7 +18559,7 @@ GameObject:
- component: {fileID: 1277258995}
m_Layer: 5
m_Name: TX_Header (2)
m_TagString: textcol
m_TagString: ColourText
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand All @@ -18580,7 +18580,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 167.75998, y: -116.540016}
m_AnchoredPosition: {x: 167.75998, y: -108.11}
m_SizeDelta: {x: 266.89, y: 61.67}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1277258995
Expand Down Expand Up @@ -18794,7 +18794,7 @@ GameObject:
- component: {fileID: 1295040095}
m_Layer: 5
m_Name: ResetTri (2)
m_TagString: textcol
m_TagString: ColourUI
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down Expand Up @@ -23620,117 +23620,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1650635385}
m_CullTransparentMesh: 0
--- !u!1 &1653453002
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1653453006}
- component: {fileID: 1653453005}
- component: {fileID: 1653453004}
- component: {fileID: 1653453007}
- component: {fileID: 1653453003}
m_Layer: 0
m_Name: Cube
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 1
m_IsActive: 1
--- !u!65 &1653453003
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1653453002}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1, y: 1, z: 1}
m_Center: {x: 0, y: 0, z: 0}
--- !u!23 &1653453004
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1653453002}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_MotionVectors: 2
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: bc7178f404a41c442b1e62a08fb9fa7d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!33 &1653453005
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1653453002}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!4 &1653453006
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1653453002}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -206.6, y: 251.4, z: 16.37}
m_LocalScale: {x: 86.002, y: 82.13, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1653453007
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1653453002}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ffe04ecf2f96f9c45bab5a2f39e0d8c9, type: 3}
m_Name:
m_EditorClassIdentifier:
fcp: {fileID: 2130943086509520274}
material: {fileID: 2100000, guid: d112ae29b7bc7a94aa540893494ed830, type: 2}
externalColor: {r: 1, g: 1, b: 1, a: 0}
--- !u!1 &1658649185
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -24669,7 +24558,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1746745271
MonoBehaviour:
Expand Down Expand Up @@ -24829,7 +24718,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1776548429
GameObject:
Expand Down Expand Up @@ -27344,7 +27233,7 @@ Transform:
m_LocalScale: {x: 283.29602, y: 137.9273, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1949589357
MonoBehaviour:
Expand Down Expand Up @@ -28037,7 +27926,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: a9bd4cb1c682b404c955a3ae3fc10896, type: 3}
m_Name:
m_EditorClassIdentifier:
_defaultBG: {fileID: 1653453002}
_defaultBG: {fileID: 0}
_bg: {fileID: 1021005035}
resetbutt: {fileID: 306449034}
--- !u!1 &2011145932
Expand Down Expand Up @@ -29599,9 +29488,9 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 58.27002, y: 61.98001}
m_AnchoredPosition: {x: 83.9, y: 51.9}
m_SizeDelta: {x: 110.2, y: 16.11}
m_Pivot: {x: 0.5, y: 0.5}
m_Pivot: {x: 0.6160283, y: 0.18251877}
--- !u!114 &2132618542
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -29635,7 +29524,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: osu!trigen r1.4
m_Text: osu!trigen v1.5
--- !u!222 &2132618543
CanvasRenderer:
m_ObjectHideFlags: 0
Expand Down
34 changes: 23 additions & 11 deletions Assets/Scripts/Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@

using NAudio;
using NAudio.Wave;
using System;

public class AudioManager : MonoBehaviour
{


public AudioSource audioSource;
public AudioSource _source; //Audio source refernce
private string _audioLoc; //Audio file location string
Expand All @@ -25,9 +24,6 @@ public class AudioManager : MonoBehaviour
private float clipLoudness;
private float[] clipSampleData;




public void Start()
{
Debug.Log("start");
Expand Down Expand Up @@ -108,15 +104,31 @@ public void Update()
if (currentUpdateTime >= updateStep)
{
currentUpdateTime = 0f;
audioSource.clip.GetData(clipSampleData, audioSource.timeSamples); //I read 1024 samples, which is about 80 ms on a 44khz stereo clip, beginning at the current sample position of the clip.
try
{
audioSource.clip.GetData(clipSampleData, audioSource.timeSamples); //I read 1024 samples, which is about 80 ms on a 44khz stereo clip, beginning at the current sample position of the clip.
}
catch(Exception e)
{
Debug.Log("Try Failed: " + e);
}

clipLoudness = 0f;
foreach (var sample in clipSampleData)

try
{
foreach (var sample in clipSampleData)
{
clipLoudness += Mathf.Abs(sample);
}
clipLoudness /= sampleDataLength; //clipLoudness is what you are looking for
trivars.songvol = 1.2f * (1 + clipLoudness * 5);
Debug.Log("aftercalc: " + trivars.songvol);
}
catch
{
clipLoudness += Mathf.Abs(sample);

}
clipLoudness /= sampleDataLength; //clipLoudness is what you are looking for
trivars.songvol = 1.2f * (1 + clipLoudness * 5);
Debug.Log("aftercalc: " + trivars.songvol);

}

Expand Down
Loading

0 comments on commit d085a82

Please sign in to comment.