analyze_spectrum
Perform FFT spectrum analysis with Strudel MCP Server to extract audio frequency data, enabling detailed sound analysis for AI-powered music creation and live coding.
Instructions
FFT spectrum analysis
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/EnhancedMCPServerFixed.ts:251-255 (registration)Registration of the analyze_spectrum tool, including name, description 'FFT spectrum analysis', and input schema (empty object properties).{ name: 'analyze_spectrum', description: 'FFT spectrum analysis', inputSchema: { type: 'object', properties: {} } },
- Input schema for analyze_spectrum: accepts no parameters.description: 'FFT spectrum analysis', inputSchema: { type: 'object', properties: {} }
- MCP tool handler for analyze_spectrum: checks initialization, calls controller.analyzeAudio(), and returns the spectrum features object or full analysis.case 'analyze_spectrum': if (!this.isInitialized) { return 'Browser not initialized. Run init first.'; } const spectrum = await this.controller.analyzeAudio(); return spectrum.features || spectrum;
- src/StrudelController.ts:87-91 (helper)StrudelController.analyzeAudio(): delegates analysis to injected AudioAnalyzer on the browser page.async analyzeAudio(): Promise<any> { if (!this.page) throw new Error('Not initialized'); return await this.analyzer.getAnalysis(this.page); }
- src/AudioAnalyzer.ts:101-108 (helper)AudioAnalyzer.getAnalysis(): evaluates the injected JavaScript analyzer on the Strudel webpage to perform FFT spectrum analysis.async getAnalysis(page: Page): Promise<any> { return await page.evaluate(() => { if ((window as any).strudelAudioAnalyzer) { return (window as any).strudelAudioAnalyzer.analyze(); } return { error: 'Analyzer not initialized' }; }); }