(评论)
(comments)

原始链接: https://news.ycombinator.com/item?id=41434679

您提供了有关当前项目的描述,其中涉及与音乐同步的几何图案。 这是一个简短的解释: 您的项目使用 React Native SVG 创建几何形状,例如玫瑰、螺旋、吸引子、曲线和和声图。 您可以手动将这些几何图形与使用 Suno AI 创建的音乐曲目同步。 虽然仍处于实验阶段,您的目标是在现场表演期间创建实时可视化。 您计划利用 Spleeter 和 Librosa 等 Python 库来提高自动化程度。 但是,代码和生成的应用程序当前不可用。 此外,您提到使用 TypeScript 开发 Maurer Rose 函数,该函数根据三角方程和比例生成路径。 这种方法可能不适合长期项目,因为它依赖于 setInterval 进行更新。 最终,您的目标是发布一个独立的应用程序,用户可以在其中交互地修改各种几何图案的参数。 另一方面,您发现《Suno》的作者陶涛也在同一家公司工作。

相关文章

原文
Absolutely wonderful!

> "We obtain these times from MIDI files, though in the future I’d like to explore more automated ways of extracting them from audio."

Same here. In case it helps: I suspect a suitable option is (python libs) Spleeter (https://github.com/deezer/spleeter) to split stems and Librosa (https://github.com/librosa/librosa) for beat times. I haven't ventured into this yet though so I may be off. My ultimate goal is to be able to do it 'on the fly', i.e. in a live music setting being able to generate visualisations a couple of seconds ahead being played along with the track.

Not sure if this is unsavory self promotion (it's not for commercial purposes, just experimenting), but I am in the middle of documenting something similar at the moment.

Experiments #1 - A Mutating Maurer Rose | Syncing Scripted Geometric Patterns to Music: https://www.youtube.com/watch?v=bfU58rBInpw

It generates a mutating Maurer Rose using react-native-svg on my RN stack, synced to a music track I created in Suno AI *. Manually scripted to sync up at the moment (not automatic until I investigate the above python libs).

Not yet optimised, proof of concept. The Geometric pattern (left) is the only component intended to be 'user facing' in the live version - But the manual controls (middle) and the svg+path html tags (right) are included in this demo in order to show some of the 'behind the scenes'.

Code not yet available, app not yet available to play with. Other geometric patterns in the app that I have implemented:

- Modified Maurer

- Cosine Rose Curve

- Modified Rose Curve

- Cochleoid Spiral

- Lissajous Curve

- Hypotrochoid Spirograph

- Epitrochoid Spirograph

- Lorenz Attractor

- Dragon Curve

- Two Pendulum Harmonograph

- Three Pendulum Harmonograph

- Four Pendulum Harmonograph

This is the Typescript Maurer Rose function (that is used with setInterval + an object array of beat times which determine when to advance the 'n' variable):

  export const generateGeometricsSimplemaurer = (n: number, d: number, scale: number = 1) => {
      const pathArray: TypeSvgPathArray = [];
      for (let i = 0; i <= 360; i += 1) {
          const k = i \* d;
          const r = Math.sin(n \* k \* (Math.PI / 180));
          const x =
              r \*
              Math.cos(k \* (Math.PI / 180)) \*
              40 \* // base scale
              scale +
              50; // to center the image
          const y =
              r \*
              Math.sin(k \* (Math.PI / 180)) \*
              40 \* // base scale
              scale +
              50; // to center the image
          pathArray.push(\${i === 0 ? "M" : "L"} ${x} ${y}`);`
      }
      const pathString: string = pathArray.join(" ");
      return pathString;
  };
setInterval isn't an appropriate solution for the long term.

The geometric patterns (with their controls) will have a playground app that you can use to adjust variables... As for the music sync side, it will probably take me a long time.

*Edit: I just noticed that the author (Victor Tao) actually works at Suno

联系我们 contact @ memedata.com