mirror of
https://github.com/FMS-Cat/condition.git
synced 2025-08-22 21:22:53 +02:00
help
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -7,8 +7,8 @@ export const audio = new AudioContext();
|
||||
let music: Music;
|
||||
|
||||
if ( process.env.DEV ) {
|
||||
// music = new MusicRealtime();
|
||||
music = new MusicOffline();
|
||||
music = new MusicRealtime();
|
||||
// music = new MusicOffline();
|
||||
} else {
|
||||
music = new MusicOffline();
|
||||
}
|
||||
|
@@ -12,6 +12,7 @@ import musicVert from './music.vert';
|
||||
const discardFrag = '#version 300 es\nvoid main(){discard;}';
|
||||
|
||||
const sectionResets = [
|
||||
0.0,
|
||||
16.0,
|
||||
80.0,
|
||||
144.0,
|
||||
@@ -143,8 +144,8 @@ export abstract class Music {
|
||||
const barLength = 240.0 / MUSIC_BPM;
|
||||
|
||||
const sectionReset = binarySearch( sectionResets, time );
|
||||
const sectionBegin = sectionResets[ sectionReset ];
|
||||
const sectionLength = sectionResets[ sectionReset + 1 ] - sectionBegin;
|
||||
const sectionBegin = sectionResets[ sectionReset - 1 ];
|
||||
const sectionLength = sectionResets[ sectionReset ] - sectionBegin;
|
||||
|
||||
program.attribute( 'off', this.__bufferOff, 1 );
|
||||
program.uniform( 'bpm', '1f', MUSIC_BPM );
|
||||
|
@@ -17,6 +17,7 @@ const float SECTION_PSY = 464.0 * BEAT;
|
||||
|
||||
#define saturate(i) clamp(i, 0.,1.)
|
||||
#define aSaturate(i) clamp((i),-1.,1.)
|
||||
#define fs(i) (fract(sin((i)*114.514)*1919.810))
|
||||
#define linearstep(a,b,x) saturate(((x)-(a))/((b)-(a)))
|
||||
#define n2r(n) (pow(2.,((n)-1.)/12.))
|
||||
#define n2f(n) (n2r(float(n))*440.)
|
||||
@@ -45,10 +46,6 @@ float auto( float y ) {
|
||||
return texture( samplerAutomaton, vec2( off / bufferLength, y ) ).x;
|
||||
}
|
||||
|
||||
float fs( float s ) {
|
||||
return fract( sin( s * 114.514 ) * 1919.810 );
|
||||
}
|
||||
|
||||
vec2 fbm( vec2 p ) {
|
||||
vec2 sum = vec2( 0.0 );
|
||||
|
||||
@@ -356,21 +353,21 @@ vec2 mainAudio( vec4 time ) {
|
||||
}
|
||||
|
||||
// -- kick ---------------------------------------------------------------------------------------
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA ) ) {
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA - 2.5 * BEAT ) ) {
|
||||
float t = mod( mod( mod( time.y, 4.0 * BEAT ), 3.25 * BEAT ), 1.75 * BEAT );
|
||||
sidechain = smoothstep( 0.0, 0.7 * BEAT, t );
|
||||
dest += 0.25 * kick( t, 1.0 );
|
||||
}
|
||||
|
||||
// -- hihat --------------------------------------------------------------------------------------
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA ) ) {
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA - 4.0 * BEAT ) ) {
|
||||
float t = mod( time.x, 0.25 * BEAT );
|
||||
float decay = mix( 40.0, 100.0, fs( floor( time.z / ( 0.25 * BEAT ) ) ) );
|
||||
dest += 0.13 * mix( 0.3, 1.0, sidechain ) * hihat2( t, decay );
|
||||
}
|
||||
|
||||
// -- snare --------------------------------------------------------------------------------------
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA ) ) {
|
||||
if ( inRange( time.w, SECTION_NEURO, SECTION_WHOA - 4.0 * BEAT ) ) {
|
||||
float t = mod( time.y - 2.0 * BEAT, 4.0 * BEAT );
|
||||
dest += 0.1 * snare( t );
|
||||
}
|
||||
@@ -409,10 +406,19 @@ vec2 mainAudio( vec4 time ) {
|
||||
dest += 0.25 * kick( t, 1.0 );
|
||||
}
|
||||
|
||||
// -- snare --------------------------------------------------------------------------------------
|
||||
if ( inRange( time.w, SECTION_WHOA, SECTION_PORTER_FUCKING_ROBINSON ) ) {
|
||||
float t = mod( time.z - 4.0 * BEAT, 8.0 * BEAT );
|
||||
dest += 0.1 * snare( t );
|
||||
// -- gabber -------------------------------------------------------------------------------------
|
||||
if (
|
||||
inRange( time.w, SECTION_WHOA, SECTION_PORTER_FUCKING_ROBINSON ) &&
|
||||
inRange( mod( time.z, 8.0 * BEAT ), 4.0 * BEAT, 8.0 * BEAT )
|
||||
) {
|
||||
const int pattern[16] = int[](
|
||||
0, 1, 0, 1,
|
||||
2, 3, 4, 0,
|
||||
1, 2, 0, 1,
|
||||
2, 3, 4, 5
|
||||
);
|
||||
float tHeadKick = 0.25 * BEAT * float( pattern[ int( time.y / 0.25 / BEAT ) ] );
|
||||
float tKick = tHeadKick + mod( time.y, 0.25 * BEAT );
|
||||
}
|
||||
|
||||
// -- amen ---------------------------------------------------------------------------------------
|
||||
|
@@ -101,7 +101,7 @@ void main() {
|
||||
for ( int i = 0; i < MARCH_ITER; i ++ ) {
|
||||
isect = map( rayPos );
|
||||
accum += isect * INV_MARCH_ITER;
|
||||
rayLen += stepLen * 0.8 + 0.2 * prng( seed );
|
||||
rayLen += stepLen * 0.5 + 0.5 * prng( seed );
|
||||
rayPos = rayOri + rayDir * rayLen;
|
||||
|
||||
if ( rayLen > cameraNearFar.y ) { break; }
|
||||
|
Reference in New Issue
Block a user