Skip to content

Instantly share code, notes, and snippets.

@NickCulbertson
NickCulbertson / gist:9873b9142a36cb8090e3af7bf6642643
Last active November 2, 2023 21:04
Looping audio test with AudioKit using Timer & CADisplayLink
///This loops between two audio files that are two seconds long.
///The audio files are longer than two seconds to include the fade between files
///
///Using CADisplayLink
import AudioKit
import AVFoundation
import SwiftUI
class InstrumentEXSConductor: ObservableObject, HasAudioEngine {
let engine = AudioEngine()
@renaudbedard
renaudbedard / gist:7a90ec4a5a7359712202
Created September 11, 2014 18:39
Billboarding for Unity surface shaders
void vert(inout appdata_full v, out Input o)
{
UNITY_INITIALIZE_OUTPUT(Input, o);
// get the camera basis vectors
float3 forward = -normalize(UNITY_MATRIX_V._m20_m21_m22);
float3 up = float3(0, 1, 0); //normalize(UNITY_MATRIX_V._m10_m11_m12);
float3 right = normalize(UNITY_MATRIX_V._m00_m01_m02);
// rotate to face camera