You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* restyled most components for better visuals
* added light and dark mode functionality for some components
* added mobile responsive layout for smaller screens and removed redundant props
* added ScrollView in replacement of regular div to remove unecessary horizontal bar
* added animations for smoother light and dark mode transitions
* removed border from buttons and added shadow instead
* made score display on mobile reponsive with horizontal scrolling and removed the scroll bar indicators
* adjusted header and footer styles to stick on top / bottom when scrolling happens
* cleaned up code structure and removed themestyles
* adjusted small screen breakpoint to include landscape mode devices
* added function to generate and store session token on load within the frontend alone
* replaced logic used to display score sheet from app.py to score.ts
* added basic cursor movement logic based on step and speed input
* removed node modules from being tracked
* updated comments and formatted code
* implemented file upload logic for standalone app
* converted features.py and added real-time chroma feature extraction from live audio input
* Fix: resolved linter errors for AudioWorklet globals
* upgraded SDK and made changes for Expo app compatibility
* added live mic for expo + UI adjustments + adjust cursor to move by beats
* reduced zoom of OSMD display for better UI
* added same beat movement logic to script for expo app version
* added / modified comments for clarity
* added Peter's OTW and ScoreFollower files
* quick expo app upgrade from SDK52 to SDK53 due to recent expo app update
* adjusted OSMD display on web for smaller devices
const[chroma,setChroma]=useState<number[]>(newArray(12).fill(0));// Initialize the chroma state as an array of 12 zeros (used to capture chroma vector at each chunk of audio).
68
54
const[started,setStarted]=useState(false);// state used to determine user selects live microphone option or not
55
+
constprocessor=useRef(newExpoMicProcessor()).current;// Create a stable ExpoMicProcessor instance that persists across renders
56
+
constSAMPLE_RATE=44100;// Define sample rate for ChromaMaker
57
+
constN_FFT=4096;// Define chunk size for ChromaMaker
58
+
constchromaMaker=useRef(newChromaMaker(SAMPLE_RATE,N_FFT)).current;// Create a stable ChromaMaker instance that persists across renders
69
59
60
+
// Create an array of Animated.Value objects for a smooth height animation of each chroma bar.
61
+
// const animatedChroma = useRef(new Array(12).fill(0).map(() => new Animated.Value(0))).current;
62
+
63
+
// // Whenever the chroma state updates, animate each corresponding Animated.Value.
64
+
// useEffect(() => {
65
+
// chroma.forEach((value, idx) => {
66
+
// Animated.timing(animatedChroma[idx], {
67
+
// toValue: value * 200, // scale factor to adjust maximum bar height
68
+
// duration: 50,
69
+
// useNativeDriver: false
70
+
// }).start();
71
+
// });
72
+
// }, [chroma]);
73
+
70
74
useEffect(()=>{
71
75
letaudioCtx: AudioContext;// Declare a reference to the AudioContext, which manages all audio processing
72
76
letmicStream: MediaStream;// Declare a reference to the MediaStream from the user's microphone
73
77
74
-
constinitAudio=async()=>{
78
+
// Web version of intializing miccrophone (Uses AudioWorklet Node)
79
+
constinitWebAudio=async()=>{
75
80
try{
76
81
micStream=awaitnavigator.mediaDevices.getUserMedia({audio: true});// Request access to user's microphone
77
82
audioCtx=newAudioContext();// Create a new AudioContext for audio processing
78
-
awaitaudioCtx.audioWorklet.addModule('../utils/mic-processor.js');// Load the custom AudioWorkletProcessor
83
+
awaitaudioCtx.audioWorklet.addModule('./utils/mic-processor.js');// Load the custom AudioWorkletProcessor
79
84
constsource=audioCtx.createMediaStreamSource(micStream);// Create a source node from the microphone stream
80
85
constworkletNode=newAudioWorkletNode(audioCtx,'mic-processor');// Create an AudioWorkletNode linked to our custom 'mic-processor'
81
86
source.connect(workletNode);// Connect the mic source to the worklet
@@ -100,17 +105,47 @@ export default function App() {
100
105
console.error('Failed to initialize audio:',err);
101
106
}
102
107
};
103
-
// If "started" state is true, initialize audio processing
108
+
109
+
// Mobile version of intializing miccrophone (Uses ExpoMicProcessor)
0 commit comments