Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
blechdom committed Nov 9, 2023
1 parent 368006e commit 608b275
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/components/ContourAudioControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import WebRenderer from "@elemaudio/web-renderer";
import dynamic from "next/dynamic";
import React, {useEffect, useState} from "react";
import styled from "styled-components";
import {AudioParamsType, KnobRow} from "@/components/FractalPlayer";
import {ContourAudioParamsType, KnobRow} from "@/components/FractalPlayer";

type ContourAudioControlsProps = {
contour: { angle: number; duration: number }[];
Expand All @@ -25,7 +25,7 @@ const ContourAudioControls: React.FC<ContourAudioControlsProps> = (
const [freqScaling, setFreqScaling] = useState<number>(1);
const [highest, setHighest] = useState<number>(6000);
const [duration, setDuration] = useState<number>(5);
const [audioParams, setAudioParams] = useState<AudioParamsType>({
const [audioParams, setAudioParams] = useState<ContourAudioParamsType>({
volume: 0,
threshold: 0,
highest: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/components/ContourAudioEngine.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {AudioParamsType} from "@/components/FractalPlayer";
import {ContourAudioParamsType} from "@/components/FractalPlayer";
import dynamic from "next/dynamic";
import React, {useCallback, useEffect, useState} from "react";
import {el, NodeRepr_t} from "@elemaudio/core";
Expand All @@ -14,7 +14,7 @@ type AudioEngineProps = {
audioContext: AudioContext | null;
core: WebRenderer;
playing: boolean;
audioParams: AudioParamsType;
audioParams: ContourAudioParamsType;
}

const AudioEngine: React.FC<AudioEngineProps> = ({
Expand Down
18 changes: 12 additions & 6 deletions src/components/FractalPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,18 @@ type FractalPlayerProps = {

export type AudioParamsType = {
volume: number;
threshold?: number;
highest?: number;
lowest?: number;
smoothing?: number;
freqScaling?: number;
duration?: number;
threshold: number;
highest: number;
lowest: number;
smoothing: number;
}

export type ContourAudioParamsType = {
volume: number;
threshold: number;
highest: number;
freqScaling: number;
duration: number;
}

const FractalPlayer: React.FC<FractalPlayerProps> = ({
Expand Down

0 comments on commit 608b275

Please sign in to comment.