Example #1
0
from ftis.analyser import (FluidOnsetslice, FluidMFCC, Stats, Standardise,
                           UMAP, ExplodeAudio)
from ftis.process import FTISProcess as Chain
from ftis.corpus import Corpus, PathLoader

analysis = Chain(source=Corpus("../../reaper/highgain_source/bounces"),
                 folder="../outputs/em_detailed_segmentation")

analysis.add(
    # Segmentation
    FluidOnsetslice(framedelta=20,
                    minslicelength=2,
                    filtersize=5,
                    threshold=0.3,
                    metric=0,
                    cache=1),
    ExplodeAudio(),
    # Analysis
    FluidMFCC(discard=True, numcoeffs=20, fftsettings=[4096, 512, 4096]),
    Stats(numderivs=1),
    Standardise(),
    UMAP(components=2))

if __name__ == "__main__":
    analysis.run()
Example #2
0
from pathlib import Path
from shutil import copyfile

src = "outputs/segments/2_ExplodeAudio"
folder = "outputs/classification"

process = Chain(
    source=src, 
    folder=folder
)

cluster = AgglomerativeClustering(numclusters=2)

process.add(
    Flux(cache=False),
    Stats(numderivs=2),
    Normalise(),
    cluster
)

if __name__ == "__main__":
    process.run()

    # Now implement a quasi one-shot analyser to copy the sound files to individual directories
    # We will use the directories as a significant progress point from which new analysis will be orchestrated
    out = Path(folder) / "4_Split"
    out.mkdir(exist_ok=True)

    for c in cluster.output:
        folder = out / c
        folder.mkdir(exist_ok=True)
Example #3
0
from ftis.analyser import FluidMFCC, Stats, Standardise, UMAP, Normalise, HDBSCluster
from ftis.corpus import CorpusLoader, CorpusFilter
from ftis.process import FTISProcess as Chain

src = "outputs/micro_segmentation/2_ExplodeAudio"
folder = "outputs/quitest"

process = Chain(source=src, folder=folder)

process.add(CorpusLoader(cache=1), CorpusFilter(max_loudness=10, cache=1),
            FluidMFCC(discard=True, cache=1), Stats(numderivs=1, cache=1),
            UMAP(components=10, cache=1), HDBSCluster(minclustersize=5))

if __name__ == "__main__":
    process.run()
"""
Analyse each segment in the 'gestural' pool and cluster it
"""

from ftis.analyser import (FluidMFCC, HDBSCluster, Stats, UMAP, Standardise,
                           Normalise)
from ftis.process import FTISProcess as Chain

src = "outputs/micro_segmentation/2_ExplodeAudio"
folder = "outputs/micro_clustering"

process = Chain(source=src, folder=folder)

process.add(FluidMFCC(cache=True),
            Stats(numderivs=1,
                  flatten=True, cache=False), Standardise(cache=False),
            Normalise(cache=False), UMAP(components=6),
            HDBSCluster(minclustersize=10))

if __name__ == "__main__":
    process.run()
Example #5
0
# Description
"""
Arrange segmentations along a single axis using dimension reduction
"""

from ftis.analyser import FluidMFCC, UMAP, Stats, Normalise
from ftis.process import FTISProcess as Chain
from ftis.common.conversion import samps2ms

src = "outputs/micro_segmentation/2_ExplodeAudio/"
folder = "outputs/oned"

process = Chain(source=src, folder=folder)

mfcc = FluidMFCC(cache=True)
stats = Stats(flatten=True, numderivs=1, cache=True)
umap = UMAP(components=1, cache=True)
normalise = Normalise()

process.add(mfcc, stats, umap, normalise)

if __name__ == "__main__":
    process.run()
Example #6
0
from ftis.analyser import FluidMFCC, Stats, Standardise, UMAP, Normalise, HDBSCluster
from ftis.common.io import get_duration
from ftis.corpus import CorpusLoader, CorpusFilter
from ftis.process import FTISProcess as Chain
from pathlib import Path
import jinja2

src = "outputs/micro_segmentation/2_ExplodeAudio"
folder = "outputs/loudest"

process = Chain(source=src, folder=folder)
clustering = HDBSCluster(minclustersize=10)
process.add(
    CorpusLoader(cache=1), CorpusFilter(max_loudness=100, min_loudness=75),
    FluidMFCC(discard=True, numcoeffs=20, fftsettings=[8192, 128, 8192]),
    Stats(numderivs=1,
          spec=["median", "max", "min", "stddev", "mean", "skewness"]),
    UMAP(components=2), clustering)

if __name__ == "__main__":
    process.run()

    tracks = {}
    for cluster, items in clustering.output.items():
        track_id = cluster
        pos = 0
        for audiofile in items:

            dur = get_duration(audiofile)
            item = {
                "file": audiofile,
                "length": get_duration(audiofile),
# Description
"""
Analyse each item belonging to a cluster so that they can be ranked in order of a descriptor.
"""

from ftis.analyser import Flux, FluidLoudness, Stats
from ftis.process import FTISProcess as Chain

src = "outputs/micro_segmentation/2_ExplodeAudio"

flux_chain = Chain(
    source=src,
    folder="outputs/micro_segmentation_flux",
)

loud_chain = Chain(source=src, folder="outputs/micro_segmentation_loudness")

flux = Flux()
loud = FluidLoudness()

flux_chain.add(flux, Stats(numderivs=0))

loud_chain.add(loud, Stats(numderivs=0))

if __name__ == "__main__":
    flux_chain.run()
    loud_chain.run()