Wednesday, July 31, 2024

3D Fractal Xenharmonic Synth, Web App

 Virtual Virtual Instrument?

An experimental program for creating microtonal music.

Sound is generated from a 3D object, a fractal. Clicking on the object's surface produces a set of pitches based on the click point's coordinates (X, Y, Z, and distance to the surface). Each click remaps the keyboard with these new pitches.

The demo video showcases live performance with only drums added afterward.

Play using left and middle clicks, assigning sounds to four keys on two keysets (A, S, D, F and H, J, K, L).

The blinking lights indicate key presses (A, S, D...). The "chord compass" next to it simplifies chord prediction by referencing a 12-tone equal temperament framework.

Built with JavaScript and the browser's Audio API.

Note on microtonality: This program doesn't focus on specific fractal tunings. Musical patterns emerge from the object's geometry, but all fractals potentially contain the same intervals.

Core concept: Generating pitches from arbitrary object coordinates. The code includes primitive 3D shapes for experimentation.

How to play:

  • Left and middle clicks trigger notes based on X, Y, Z, and D coordinates.
  • Use keysets 1 (A, S, D, F) and 2 (H, J, K, L) to assign sounds.

Pitch generation: Pitch is derived from the click point's coordinates. In linear mode, X=1 corresponds to a pitch of 1 Hz.



SFINX - Xenharmonic Guitar Learning App

 

SFINX - Xenharmonic Guitar Learning App

Stringed Fretted Instruments Notes Explorer


This free web-based app is designed to help you explore and experiment with xenharmonic (micro/macro-tonal) guitars.

Key Features:

  • Generate scales and chord diagrams for custom tunings
  • Play and find chord progressions on an interactive virtual guitar
  • Utilize a built-in tuner and fretboard calculator

Basic Concepts:

  • Xenharmonic Tuning: SFINX specializes in exploring tunings beyond the standard 12-tone equal temperament. Users can create custom tunings using decimal ratios or equal division.
  • Virtual Guitar: The app provides an interactive virtual guitar interface to visualize and experiment with different tunings, scales, and chords.
  • Preset Management: Users can save and load instrument and scale presets for quick access and experimentation.

Help:

Default presets include normal 12ed2 guitar and bass.
SFINX saves presets per browser, allowing you to import and export settings. Overwriting existing presets is possible, but remember to save the instrument preset after creating or modifying scales.

Tuning System

  • Strings and Frets: Define the physical parameters of your virtual instrument.
  • Decimal Ratio List: The program accepts intervals in decimal ratio, comma-separated. The last ratio represents the octave equivalent.
  • Equal Division: Divide the octave into a specified number of equal intervals.
  • Tuning Pattern: Determine the open string note of each string relative to the previous one. This allows for various tuning configurations, including drop tunings.
    Each string you add, also adds a control on its left that sets the open string note in relation with its previous string (that is why the lowest string doesn't have one).
    The standard guitar tuning pattern is 5, 5, 5, 4, 5.
    A one step drop tuning pattern is: 7, 5, 5, 4, 5.
  • Lowest Pitch: Set the fundamental frequency of the lowest open string.
    In hertz. Sets the lowest possible pitch, that is the lowest open string, the only control for setting pitch directly.
  • Interval Rulers: Measure intervals and string lengths for in-depth analysis.
    - The pink ruler marks always the equave.(the last number in the interval list, or the interval used for the division in equal-division systems)
    - The fixed green 12ed2 ruler is useful to measure other tunings, since most musicians are familiar with the role of those tempered 12, is easy to relate new tunings using the ruler for quick comparison. (it can be moved)
    For deeper interval analysis and measurement beyond the basic tools provided, explore my other app, 'Interval Rulers.' It visualizes intervals as an 'abstract guitar' or interval matrix, enabling complex calculations like successive reductions and chroma finding. Unlike SFINX, which focuses on a fixed interval matrix inherent to the guitar, 'Interval Rulers' offers a more flexible and comprehensive approach to interval exploration.

Visualization and Interaction

  • Highlights: Select specific notes on the fretboard to focus on particular scales or chords.
    Each interval on the list gets a control, or with the equal-division system, each division gets a control.(Note: with non-integer divisions, this gets truncated, floored. So with 11.66 divisions, it will count 11, this is non-sense, yes).
    Here is where you set the scale to be displayed on the fretboard.
    Each marked note, adds a control for arpeggiate a chord.
  • Chord Pattern: Define the notes for each chord position.
    Each string added, adds a control for selecting a note for the chord-row.
  • Colors: Customize the appearance of notes based on:
    Single: Plain color.
    Class: Notes get a unique color by its class.
    Row: Colorize by chord row, controlled by the chord pattern.
  • Arpeggiator: Play notes sequentially in different patterns (up, down, converge, diverge).
  • Speed: Arpeggio note separation speed in seconds.
  • Synth Sound: Choose from available sounds for the virtual guitar.

Additional Controls

  • Width, Length, Zoom: Adjust the visual representation of the fretboard without affecting the tuning or sound.
  • Note Length: Control the duration of played notes.
  • Volume: Adjust the overall volume of the virtual guitar.
  • Calculator ruler: Displays a ruler (orange) with the relative size of the string when hovering a fret.
  • Size: Sets the nut to bridge length for calculations. In units.

Photoshop Scripting +

kMaps - 32bit HDR 360 Sky Creator PS Plug-In

 kMaps - HDR 32bit Procedural 360° Sky Maps Latitude/Longitude Cylindrical Mapping


Important: This plug-in is free and open-source. It was created and tested with Photoshop 2020 (21.2.1) (with CEP 9) in English on Windows 10. Compatibility with other versions is unknown.

Update: I've confirmed compatibility with the latest Photoshop (24.3.0 with CEP 11), but it still requires the English version. Importantly, CEP is being deprecated, which may limit this plug-in's usefulness in the future due to advancements in AI image synthesis.

kMaps offers simple, perlin, and fractal noise-based clouds in a classic style.

As an unsigned plug-in, manual installation and enabling Photoshop's debug mode is required (see video for instructions).

Please note that the plug-in contains some bugs, primarily in the user interface.


Information:

  • Groundless Images: Generated images lack a ground plane, allowing for versatile use. Each image can effectively serve two purposes.
  • Resolution: Generating 16K images depends on GPU and driver capabilities. 8K is consistently reliable, and 4K is generally suitable.
  • 32-bit Depth: The 32-bit output is computationally intensive. The plugin initially creates a 16-bit PSD, simulating different exposures, and then combines them into a 32-bit image.
  • Preset Compatibility: Presets are optimized for default cloud settings. Modifying advanced noise options might require adjustments to other parameters. Experiment with Seed and Noise Evolution values before applying presets.
  • Aspect Ratio: Images are generated in a 1:1 aspect ratio to accommodate engines like Unity, which often resize and pack textures in this format.

Installation (Windows 10):

  1. Extract the /com.k.maps folder from the .rar file and place it in C:/Users/***/AppData/Roaming/Adobe/CEP/extensions/.
  2. Install the included Actions as usual.
  3. Enable Debug Mode in Photoshop (follow the video guide).

Simple Guide:

  • Close all other files.
  • Click "Render .PSD".
  • Select a preset and click "Run".
  • Optionally, click "Convert to HDR".
  • Save the image.

Tips:

  • The preview is a style guide, not a definitive representation.
  • Ignore potential banding when zooming out. Gradients are accurate.
  • To disable a layer or option without affecting presets, set its opacity to 0 instead of hiding it.
  • The sun and moon may appear distorted depending on their position.
  • The animation feature is experimental and prone to crashes. Use with caution.

Color Coding:

  • Red: Do not modify these elements as they are controlled by the plugin.
  • Blue and Green: These elements are editable.

Downloads:

kMaps-v2 Download < 184Kb
kMaps-v2n Download Photoshop 2023 < 184Kb
HDR examples Download < 476Mb
PNG examples Download < 3.5Gb

Tuesday, July 30, 2024

AE 3D Audio Spectrum (no plugins) +free templates

 

3D Wave Spectrum Audio Visualizer

After Effects CC Template Guide









Basic Usage:

  1. Choose a template from the downloaded .rar file and open the Project (some may take longer to load). Locate the replaceMe.mp3 file in the project panel, right-click > Replace Footage, and select your audio file. Trim the composition length to match your audio; it is set to 10 minutes by default.
  2. Render the project or customize the included camera and lights to your preference.

Modifying the Template:

The first layer, from top to bottom, called 3DSpectrumControls, contains all the controls to change and animate the aspect of the wave spectrum. The first option called 3DLayersPadding allows you to change the distance, in pixels, between the spectrum layers to create depth. A value of 0px makes it flat; it should be at least 1px. (Note: Each layer is flat on its own. If you place the camera from an absolute side view, the spectrum will not be visible.)

All other options are from the AE Wave Spectrum regular effect. Refer to the AE Manual for detailed explanations of each control.

  • Start Point/EndPoint: The 2D coordinates (X, Y) in pixels defining the starting and ending points of the audio wave.
  • Start Frequency/End Frequency: The frequency range (in Hertz) to be visualized, from 0 to 22050 for 44100Hz files.
  • Frequency Bands: The number of subdivisions within the specified frequency range.
  • Maximum Height: The spectrum's height relative to the audio amplitude.
  • Audio Duration: The length of the audio sample used for spectrum analysis (in milliseconds). The default is 300ms. Higher values increase render time, lower values reduce animation smoothness. Keep this value between 200-500ms.
  • Audio Offset: The time offset (in milliseconds) between spectrum layers. The default is 20ms. Controls the sampling time difference for each layer.

An Expression script (see below) automatically applies the audio offset to all spectrum layers. You only need to modify the Audio Offset value in the 3DSpectrumControls layer.

audioOffset = thisComp.layer("3DSpectrumControls").effect("AudioOffset")("Slider");
thisComp.layer(thisLayer, 1).effect("Audio Spectrum")(11) + audioOffset


The same happens with the 3DLayersPadding control.

padding = thisComp.layer("3DSpectrumControls").effect("3DLayersPadding")("Slider");
[ thisComp.layer(thisLayer, 1).transform.position[0], [ thisComp.layer(thisLayer, 1).transform.position[1] ], thisComp.layer(thisLayer, 1).transform.position[2]-padding ]

Both Audio Offset and Audio Duration affect the spectrum's refresh rate. The default values for each template typically work well for most audio files.

  • Thickness: The thickness of the line (in pixels) that forms the audio wave.
  • Softness: The softness of the line that forms the audio wave.
  • Inside Color/Outside Color: The color of the line and its outline.
  • Hue Interpolation: Interpolates the selected color based on the hue wheel (in degrees). A value of 360° displays the entire color wheel starting from the chosen color. The default is 35°, which interpolates from blue to cyan/green.
  • Dynamic Hue Phase: Uses audio phase information to randomly change colors.
  • Color Symmetry: Mirrors colors along the line, useful for hiding seams in round spectrum shapes (like template 04).
  • Display (Digital/Lines/Dots): Changes the wave's appearance between these three options.
  • Side (A/B/A&B): Displays the positive, negative, or both sides of the amplitude wave.
To use a custom shape for the spectrum, open the "3dWaveSpectrum_shape.aet" project. In the 3DspectrumLayer_1, you'll find the original AE Wave Spectrum effect, which allows you to use a mask or path to trace the wave. Duplicate this layer (Ctrl+D/Cmd+D) as many times as needed to create the desired spectrum depth.

About the Audio File

The AE Wave Spectrum effect used in this template represents the spectrum linearly in both frequency and amplitude, unlike most spectrum visualizers. This means that when displaying the entire spectrum (0 to 22,000 Hz), you'll see more activity on the left side (low frequencies) with higher peaks, and less activity on the right side (high frequencies), even with maximum height settings.

While selecting a smaller frequency range (e.g., 20 to 2000 Hz) can help, it might not be ideal as it eliminates higher frequencies and may not accurately represent the audio.

You can use After Effects' native audio effects, like the parametric equalizer, to adjust frequency levels. Create a pre-composition for better performance.

For more precise control, using an external audio editor like Audition is recommended. You can apply an equalizer to reduce frequencies below 800 Hz, use a multi-band compressor to target lower frequencies, and then a tube-modeled compressor, hard limiter, and declipper to even out volume levels. While this process might distort the audio, it's intended for spectrum visualization only. Use the original audio for the final sequence. Refer to the Audition documentation for detailed instructions on these effects.

About Performance

This template is computationally intensive, potentially taking up to 100 hours to render on an average PC. Performance decreases with more layers. To improve editing speed:

  • Set preview resolution to "1/4" instead of "Full."
  • Disable the three default lights during editing (re-enable for rendering).
  • Avoid effects like Glow, Blur, background images, and footage during editing. Add these later in a new project.
  • Use the Classic 3D Renderer with the lowest Shadow Resolution.
  • Employ compressed audio formats like MP3 instead of uncompressed formats like WAV.
  • Disable Depth of Field and Motion Blur.
  • Reduce the frame rate from 24fps to 18fps and use frame blending after rendering for smoothness.

Rendering

Render the composition as a PNG sequence to preserve the alpha channel for adding background images or footage later in a new project.

To accelerate render times, consider using the After Effects command-line renderer (aerender.exe) to run multiple instances of the program simultaneously.

Exampe code:

aerender -project X:\examplePath\exampleProject.aep -comp "exampleComp" -RStemplate "Multi-Machine Settings" -OMtemplate "PNG Sequence" -output X:\examplePath\exampleSubPath\exampleOutput_[#####].png

Ensure the selected Render Settings template (-RStemplate) has the "Skip File if Already Exists" option enabled within After Effects. The pre-included "Multi-Machine Settings" template can be used.

Create an Output Module template (-OMtemplate) with your desired PNG settings or other sequence format.

This command-line rendering approach can be used on multiple computers with After Effects installed to accelerate the process.

For more details on multi-machine rendering, consult the After Effects manual.

This Plug-in is free and provided as-is without any support beyond this documentation.

Copyright laws apply. You can create unlimited commercial projects using it, but selling or distributing any of the templates is prohibited.

Tested exclusively in After Effects CC 2017.2 (Version 14.2.1.34).

DOWNLOAD

Project on Behance


The Spiral Harp

6-sided spiral harp, concept art

 A spiral tuning system is a layout for string instruments based on any of the diverse configurations of a spiral polygonal chain, known as a spirangle, utilizing the segment's length as source for pitch, either as string length or frequency.

These systems are aperiodic (with exceptions) and possess an infinite range of possibilities. Among these configurations defined by their sides and segments, many prove musically practical, with potential for some to manifest as tangible instruments, such as spiral harps. (An instrument with a single wound string where pitch is linked solely to string length, and tension becomes relative.)

Each unique configuration unveils distinct chords and progressions, often showcasing geometric patterns.


Theory:

Each tuning can be mainly defined by the amount of sides and the margin, and can be named:

S6m1 - "S" for spiral, followed by the number of sides, "m" for margin; if its value is 1, it can be omitted (e.g., S6m1 = S6). [This tuning is of main interest.]

S5.5 - Five-and-a-half-sided spiral with margin 1 (omitted).

S1m1.05946 - One-sided spiral with a margin of the twelfth root of 2.

S7r2c1 - Seven-sided spiral with a margin of 1 (omitted), with an initial radius of 2, and constant increment c = 1. When omitted, spirals initial radius is 0, c = 1.

iS6m1 - Inverted six-sided spiral with a margin of 1.

The parameters affecting the resulting relative segment length progression are:

Amount of sides: from 0 to infinity.

Margin: usually 1 (to mimic spider-webs). This property can be (unnecessarily) employed to generate equal-division systems. For example, the angle is calculated with \( \frac {2\pi}{sides}\), so when sides are \(1\), \( \frac{1}{2}\), or \( \frac{1}{4}\), etc., it leaves the margin as the sole control for segment length increase. For instance, a one-sided spiral with a radius of approximately \( 1.05946 = \sqrt[12]{2} \) generates a 12 equal division system. From this perspective, equal-division systems can be seen as a subset of spirals.

Initial radius: usually 0 Using a different initial radius opens another dimension of progression; however, it seems to mostly affect the initial segments, and the rest of the spiral converges quickly with its version with radius 0.

Inversion: This parameter doesn't affect the progression but rather how the progression is treated, as string length or as frequency.

Spiral polygonal chains with different margins,

Spiral polygonal chains with different sides.


Construction:

Starting from the center, and considering the segment's length as string length, the first being the shortest, becomes the highest pitch so the tunings are defined inversely.
Since, in most cases, they are aperiodic, the system sizes are infinite, it will depend on how many notes one wants to calculate.
Most spiral settings cover the audible range with less than 300 segments.
For instance, a six-sided spiral harp with margin 1, comprised of 120 segments spans approximately five octaves.
The spiral can be of any size, a diameter, or scale property, while changing the length of the segments, won't alter their relative length.(if started at 0,0)
We assign a frequency to the first segment, e.g. 8000hz, and the rest of the notes are calculated from it.

Unwound spirals next to each other, firsts 10 segments. With margin 1. From 0.5 to 2 sides (150 spirals, in 0.01 step) First segment from each spiral is normalized to the same length. Segments are colored by octave, this means, every red is the same chroma. The 1-sided spiral has all its segments of the same length in this configuration with margin 1.


The algorithm for calculating the length of a segment, the distance between consecutive points on a spiral:

Given:

Radius: \(r= (z \times m)\times (m^n)\) where \(z\) is the constant size increment, \(m\) is margin and \(n\) is the point's index, starting at \(0\).

Angle \(a = \frac{2\pi}{s}\) where \(s\) is the amount of sides of the spiral

The x-coordinate and y-coordinate of a point on the spiral are calculated using:

\(x = r \times \cos(a)\)

\(y = r \times \sin(a)\)

The distance between two consecutive points on a spiral in Cartesian coordinates \((x_1,y_1)\) and \((x_2,y_2)\) is calculated using the Euclidean distance formula:

\(d = \sqrt{(x_2-x_1)^2 + (y_2-y_1)^2} \)


Properties:

One significant characteristic that differs from most tunings is that each successive lower octave has more notes. At first sight, the different progressions don't seem to say much. It helps to analyze each tuning by looking at its full interval matrix, revealing that some strings have many more types of minor thirds, while others have more fifths. Some completely dodge certain harmonics, regardless of how many "strings" you add; some combinations just never happen.

The most important part is the number of sides, which will expose different chords at each row, some configurations make progressions more intuitive. The most altered part of the progression are the initial segments, since its the result of truncating the spiral, they are the most affected. from these different truncation different patterns still emerge. The rest of the progression are mostly equal, relatively, in most configurations. From a string length perspective,(already away from the center, with less error in the truncation) the progression is almost arithmetic, seems to increase at constant but there is an increasing unnoticeable ratio.

Considerations for spiral tunings and possible harps:

For a real spiral, a logical number of sides starts at 3 (greater than 2, avoiding string overlap) and ends at some point depending on the expected range (e.g., 12 sides). However, a real harp beyond this will have too many or too short strings to be practical. Regarding the margin, the value is usually 1; going too far away from this eliminates the possibility of the spiral as an instrument, and so does this tuning inversion, the progression as frequency.



An open-source, virtual playable version is accessible link.

The new version is available as a interface in MIND.

-----

The concept art is a 3d model post processed with AI.

The app has one pending update.... 



Clarifying Functional Music Theory

I’ve mentioned functional music theory in various articles on this blog, often without specific references. This is because the concept itse...