Skip to content

Instantly share code, notes, and snippets.

View made-indrayana's full-sized avatar
:octocat:
curious

Made Indrayana made-indrayana

:octocat:
curious
View GitHub Profile
@made-indrayana
made-indrayana / SongSimulator.lua
Created February 7, 2022 15:50
QSC Song Simulator
timer0 = Timer.New()
Controls.OFF.EventHandler = function (valueChange)
if (Controls.OFF.Boolean) then
Controls.OFF.Color = "#F00"
timer0:Stop()
--Controls['Peak Out'].RampTime = 0.3
Controls['Peak Out'].Value = -100
--Controls['RMS Out'].RampTime = 1
Controls['RMS Out'].Value = -100
@made-indrayana
made-indrayana / AudioFader.cs
Created October 12, 2021 15:16
Simple static Class for AudioSource fade In and Out
using System.Collections;
using UnityEngine;
public static class Fade
{
public static IEnumerator In (AudioSource audioSource, float fadeTime)
{
const float startTime = 0f;
var currentTime = 0f;
audioSource.Play();
@made-indrayana
made-indrayana / LinearDecibelConverter.cs
Last active August 6, 2021 15:10
Small utilities to convert Linear value (0-1) to dB and vice versa - Yes I'm looking at you Unity - as well as FMODs Internal Bus Volume
// LinearDecibelConverter.cs
// Author: Made Indrayana
// MIT License
// Small utilities to convert Linear value (0-1) to dB and vice versa
public class LinearDecibelConverter
{
public float LinearToDecibel(float linear)
{
float dB;
@made-indrayana
made-indrayana / pointer-reference.cpp
Created August 6, 2021 14:29
This program is created to display the usage of pass-by-value, pass-by-reference and pointer in C++.
// main.cpp
// Reference and Co.
// Author: Made Indrayana
// MIT License
// This program is created to display the usage of pass-by-value, pass-by-reference and pointer in C++.
#include <iostream>
using namespace std;
@made-indrayana
made-indrayana / Singleton.cs
Last active September 22, 2021 15:08
Generic persistent Singleton script for Unity
// MonoBehaviour Singleton Template
// Author: Made Indrayana
// MIT License
using UnityEngine;
public class Singleton<T> : MonoBehaviour
where T : Component
{
public static T Instance { get; private set; }
@made-indrayana
made-indrayana / ResonanceLocationBugFix.cs
Last active August 6, 2021 14:54
Location fix by forcing an AudioSource to continually stop and play to force localization update on Google Resonance
// Google Resonance Audio Location Bug Fix
// Author: Made Indrayana
// MIT License
// Location fix by forcing an AudioSource to continually stop and play to force localization update on Google Resonance
// Use a 100ms empty WAV
public class ResonanceLocationBugFix : MonoBehaviour
{
[SerializeField]
@made-indrayana
made-indrayana / IEnumCircularTest.cs
Created July 2, 2021 10:19
Making a recurring IEnum with Update-like behaviour for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class IEnumTest : MonoBehaviour
{
public bool isTracking = false;
// Trigger to start, can be whatever
void Start()
@made-indrayana
made-indrayana / FMODOutputUtils.cs
Last active August 6, 2021 14:25
I created this script to tackle the biggest problem when combining FMOD and Oculus VR Framework --- FMOD's audio only outputs to the currently used system audio device and not mirror its output to the VR headset, unlike when using SteamVR.
// FMOD Output Setter - Editor script
// Author: Made Indrayana
// MIT License
// Create a window in Unity to be able to explicitly select FMOD's audio output and auto enable it on every Play Mode.
using System;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using FMODUnity;
@made-indrayana
made-indrayana / DemoPlayerController.cs
Last active April 6, 2023 16:40
Basic PlayerController for 3D scene. Copeid from Google Resonance Unity SDK.
// Copyright 2017 Google Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
@made-indrayana
made-indrayana / FMODCrashCourse.cs
Last active August 6, 2021 14:13
FMOD Programming Crash Course
// FMOD Crash Course for Programmer
// written by Made Indrayana
// MIT License
using UnityEngine;
public class FMODCrashCourse : MonoBehaviour
{
// String as reference with FMOD Picker
[FMODUnity.EventRef] public string eventName;