Skip to content

Commit fb28246

Browse files
author
James Bradbury
authored
[Release] 1.0.0-beta6 (#102)
* mfcc rst and sc help file * mfcc sc examples * mfcc output * mfcc helpfile readability * BufMFCC udpates * update bufonsetslice docs slightly (#87) * fix audio transport segmentation of discussion and desc * fix audio transport segmentation of discussion and desc (#88) * add missing see alsos * Json driver (#35) * Make jinja rendering conditional on driver having a template * minimal driver for raw JSON output * cmake target for raw JSON * fix cmake output directory * add command line option for raw * remove spurious item from raw driver * add back changes that dealt with conditional template rendering * add a github action for creating a basic API on actions Co-authored-by: James Bradbury <[email protected]> * Update json_api.yml * Update json_api.yml * Update json_api.yml * change name of raw output to api.json * Update json_api.yml * remove indentation on api * typo in UMAP * [Docs] OnsetSlice and BufOnsetSlice (#91) * update bufonsetslice text * onsetslice update * ted's changes * copy changes to bufonsetslice also * revamp MelBands and BufMelBands RST, update SC example code * *melbands description * added a hyphen * pitch and buf pitch RST * added link to the learn page * edited normalize description * pitch sc help files * BufFlatten RST and SC examples * buf thresh * sc help file * typo in fluid pitch sc example code * bufthresh rst * typo * james' feedback * add .ds_store to gitignore * pa feedback * pa feedback * pa feedback * PA feedback * [Docs] Update Normalize Docs (#76) * update normalize entry * update description * pa's requests Co-authored-by: James Bradbury <[email protected]> * [Docs] Slicer Feature Objects (#101) * add skeleton of bufnoveltyfeature * caveat novelty feature * add onset feature * remove space * add bufampfeature * realtime amp feature * update output of AmpFeature * clean up the language * caveats for bufonset feature * add onset feature * Add JSON generators for Slicers' feature counterparts * rt noveltyfeature * fix various errors * robots in disguise * change feature -> algorithm * cleanup noveltyfeature * make noveltyfeature more consistent * remove superfluous spaces * fix description * fix reference to buffer version in rt object * add padding * sc example code for slicer-features
1 parent 7dd5ffc commit fb28246

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1574
-595
lines changed

.github/workflows/json_api.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Dev API
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ dev, ci/** ]
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: flucoma/actions/env@v4
14+
- uses: flucoma/actions/docs@v4
15+
with:
16+
target: 'MAKE_RAW_REF'
17+
18+
- uses: dev-drprasad/[email protected]
19+
with:
20+
delete_release: true # default: false
21+
tag_name: api # tag name to delete
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
25+
- name: Setup SSH
26+
uses: shimataro/ssh-key-action@v2
27+
with:
28+
key: ${{ secrets.SSH }}
29+
known_hosts: 'placeholder'
30+
31+
- name: Adding Known Hosts
32+
run: |
33+
mkdir -p ~/.ssh
34+
ssh-keyscan -H ${{ secrets.DO_IP }} >> ~/.ssh/known_hosts
35+
36+
- name: package and upload
37+
uses: softprops/action-gh-release@v1
38+
with:
39+
name: FluCoMa Docs API
40+
body: "A JSON that can be accessed to derive parameters/args for objects. The build hash is ${{ github.sha }}"
41+
files: 'build/flucoma.api.json'
42+
prerelease: true
43+
tag_name: api
44+
draft: false
45+
46+
- name: Upload To Droplet
47+
run: |
48+
rsync -avz --delete --no-times --no-o --no-g --no-perms ./build/api.json james@${{ secrets.DO_IP }}:/home/learn/www/

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ schelp
1010
*.pyc
1111
interfaces/*
1212
*.log
13+
**/.DS_Store

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ set(MAX_DOC_OUT "${CMAKE_BINARY_DIR}/max_ref" CACHE PATH "")
2727
set(PD_DOC_OUT "${CMAKE_BINARY_DIR}/pd_ref" CACHE PATH "")
2828
set(CLI_DOC_OUT "${CMAKE_BINARY_DIR}/cli_ref" CACHE PATH "")
2929
set(SC_DOC_OUT "${CMAKE_BINARY_DIR}/sc_ref" CACHE PATH "")
30+
set(RAW_DOC_OUT "${CMAKE_BINARY_DIR}" CACHE PATH "")
3031
# option(TESTS,"Run tests?")
3132
include(FetchContent)
3233

@@ -138,6 +139,7 @@ add_ref_target(max "Making Max ref")
138139
add_ref_target(pd "Making PD ref")
139140
add_ref_target(cli "Making CLI ref")
140141
add_ref_target(sc "Making SC ref")
142+
add_ref_target(raw "Making raw API JSON")
141143

142144
enable_testing()
143145

doc/AmpFeature.rst

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
:digest: Realtime Amplitude Differential Feature
2+
:species: transformer
3+
:sc-categories: Libraries>FluidDecomposition
4+
:sc-related: Guides/FluidCorpusManipulationToolkit
5+
:see-also: AmpGate, AmpSlice, OnsetFeature, NoveltyFeature
6+
:description: Calculate the amplitude differential feature in realtime.
7+
:discussion:
8+
:fluid-obj:`AmpSlice` uses the differential between a fast and a slow envelope follower to determine changes in amplitude. This object calculates the amplitude differential and copies it to an output buffer.
9+
10+
:process: The audio rate in, control rate out version of the object.
11+
:output: A KR signal of the feature.
12+
13+
:control in:
14+
15+
The audio to be processed.
16+
17+
:control fastRampUp:
18+
19+
The number of samples the relative envelope follower will take to reach the next value when raising. Typically, this will be faster than slowRampUp.
20+
21+
:control fastRampDown:
22+
23+
The number of samples the relative envelope follower will take to reach the next value when falling. Typically, this will be faster than slowRampDown.
24+
25+
:control slowRampUp:
26+
27+
The number of samples the absolute envelope follower will take to reach the next value when raising.
28+
29+
:control slowRampDown:
30+
31+
The number of samples the absolute envelope follower will take to reach the next value when falling.
32+
33+
:control floor:
34+
35+
The level in dB the slowRamp needs to be above to consider a detected difference valid, allowing to ignore the slices in the noise floor.
36+
37+
:control highPassFreq:
38+
39+
The frequency of the fourth-order Linkwitz–Riley high-pass filter (https://en.wikipedia.org/wiki/Linkwitz%E2%80%93Riley_filter). This is done first on the signal to minimise low frequency intermodulation with very fast ramp lengths. A frequency of 0 bypasses the filter.
40+
41+

doc/AudioTransport.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
:species: transformer[2]
33
:sc-categories: FluidManipulation
44
:sc-related: Classes/FluidBufAudioTransport
5-
:see-also:
5+
:see-also: NMFMorph, BufNMFCross
66
:description:
7-
Interpolates between the spectra of two sounds using the Optimal Transport algorithm
7+
Interpolates between the spectra of two sounds using optimal transport.
88

9+
:discussion:
10+
Interpolates between the spectra of two sounds using the optimal transport algorithm. This enables morphing and hybridisation of the perceptual qualities of each source linearly.
911
See Henderson and Solomonm (2019) AUDIO TRANSPORT: A GENERALIZED PORTAMENTO VIA OPTIMAL TRANSPORT, DaFx
1012

11-
13+
https://arxiv.org/abs/1906.06763
1214

1315
:control in2:
1416

doc/BufAmpFeature.rst

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
:digest: Buffer-Based Amplitude Differential Feature
2+
:species: buffer-proc
3+
:sc-categories: Libraries>FluidDecomposition
4+
:sc-related: Guides/FluidCorpusManipulationToolkit
5+
:see-also: BufAmpSlice, BufNoveltyFeature, BufAmpFeature, BufOnsetFeature
6+
:description: Calculate the amplitude differential feature used by :fluid-obj:`BufAmpSlice`.
7+
:discussion:
8+
:fluid-obj:`BufAmpSlice` uses the differential between a fast and a slow envelope follower to determine changes in amplitude. This object calculates the amplitude differential and copies it to an output buffer.
9+
10+
:output: Nothing, as the destination buffer is declared in the function call.
11+
12+
13+
:control source:
14+
15+
The index of the buffer to use as the source material to be sliced through novelty identification. The different channels of multichannel buffers will be summed.
16+
17+
:control startFrame:
18+
19+
Where in the srcBuf should the slicing process start, in sample.
20+
21+
:control numFrames:
22+
23+
How many frames should be processed.
24+
25+
:control startChan:
26+
27+
For multichannel sources, which channel should be processed.
28+
29+
:control numChans:
30+
31+
For multichannel sources, how many channel should be summed.
32+
33+
:control features:
34+
35+
The index of the buffer where the amplitude differential feature will be copied to.
36+
37+
:control fastRampUp:
38+
39+
The number of samples the relative envelope follower will take to reach the next value when raising. Typically, this will be faster than slowRampUp.
40+
41+
:control fastRampDown:
42+
43+
The number of samples the relative envelope follower will take to reach the next value when falling. Typically, this will be faster than slowRampDown.
44+
45+
:control slowRampUp:
46+
47+
The number of samples the absolute envelope follower will take to reach the next value when raising.
48+
49+
:control slowRampDown:
50+
51+
The number of samples the absolute envelope follower will take to reach the next value when falling.
52+
53+
:control floor:
54+
55+
The level in dB the slowRamp needs to be above to consider a detected difference valid, allowing to ignore the slices in the noise floor.
56+
57+
:control highPassFreq:
58+
59+
The frequency of the fourth-order Linkwitz–Riley high-pass filter (https://en.wikipedia.org/wiki/Linkwitz%E2%80%93Riley_filter). This is done first on the signal to minimise low frequency intermodulation with very fast ramp lengths. A frequency of 0 bypasses the filter.
60+
61+
:control padding:
62+
63+
Controls the zero-padding added to either end of the source buffer or segment. Possible values are 0 (no padding), 1 (default, half the window size), or 2 (window size - hop size). Padding ensures that all input samples are completely analysed: with no padding, the first analysis window starts at time 0, and the samples at either end will be tapered by the STFT windowing function. Mode 1 has the effect of centering the first sample in the analysis window and ensuring that the very start and end of the segment are accounted for in the analysis. Mode 2 can be useful when the overlap factor (window size / hop size) is greater than 2, to ensure that the input samples at either end of the segment are covered by the same number of analysis frames as the rest of the analysed material.
64+
65+
:control action:
66+
67+
A Function to be evaluated once the offline process has finished and indices instance variables have been updated on the client side. The function will be passed indices as an argument.

doc/BufAudioTransport.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
:species: buffer-proc
33
:sc-categories: FluidManipulation
44
:sc-related: Classes/FluidAudioTransport
5-
:see-also:
5+
:see-also: NMFMorph, BufNMFCross
66
:description:
7-
Interpolates between the spectra of two sounds using the Optimal Transport algorithm
7+
Interpolates between the spectra of two sounds using optimal transport
88

9-
See Henderson and Solomonm (2019) AUDIO TRANSPORT: A GENERALIZED PORTAMENTO VIA OPTIMAL TRANSPORT, DaFx
9+
:discussion:
10+
Interpolates between the spectra of two sounds using the optimal transport algorithm. This enables morphing and hybridisation of the perceptual qualities of each source linearly.
1011

12+
See Henderson and Solomonm (2019) AUDIO TRANSPORT: A GENERALIZED PORTAMENTO VIA OPTIMAL TRANSPORT, DaFx
1113

14+
https://arxiv.org/abs/1906.06763
1215

1316
:control sourceA:
1417

doc/BufFlatten.rst

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,59 +2,56 @@
22
:species: buffer-proc
33
:sc-categories: FluidCorpusManipulation
44
:sc-related: Classes/Buffer
5-
:see-also:
5+
:see-also: BufCompose, BufStats
66
:description:
7-
Flatten a multichannel |buffer| to a single channel. This can be useful for constructing n-dimensional data points for use with :fluid-obj:`DataSet`
7+
Flatten a multichannel |buffer| to a single channel. This can be useful to structure a buffer such that it can be added to a :fluid-obj:`DataSet`
88

9-
The ``axis`` determines how the flattening is arranged. The default value, 1, flattens channel-wise, such that (if we imagine channels are rows, time positions are columns):
9+
The ``axis`` argument determines how the flattening is arranged. The default value, 1, flattens channel-wise (similar to how audio files are stored), such that (if we imagine channels are rows, time positions are columns):
1010

1111
=== === ===
1212
a 1 a 2 a 3
1313
b 1 b 2 b 3
1414
c 1 c 2 c 3
1515
=== === ===
1616

17-
1817
becomes
1918

2019
=== === === === === === === === ===
2120
a 1 b 1 c 1 a 2 b 2 c 2 a 3 b 3 c 3
2221
=== === === === === === === === ===
2322

24-
25-
whereas with ``axis = 0`` we get
23+
whereas with ``axis`` = 0, the buffer is flattened frame-wise, resulting in:
2624

2725
=== === === === === === === === ===
2826
a 1 a 2 a 3 b 1 b 2 b 3 c 1 c 2 c 3
2927
=== === === === === === === === ===
30-
31-
28+
29+
To learn more visit https://learn.flucoma.org/reference/bufflatten/.
3230

3331
:control source:
3432

35-
The |buffer| to flatten
33+
The |buffer| to flatten.
3634

3735
:control startFrame:
3836

39-
Where in the source should the flattening process start, in samples.
37+
Where in ``source`` should the flattening process start, in samples. The default is 0.
4038

4139
:control numFrames:
4240

43-
How many frames should be processed.
41+
How many frames should be processed. The default of -1 indicates to process through the end of the buffer.
4442

4543
:control startChan:
4644

47-
For multichannel source buffers, which channel to start processing at.
45+
For multichannel ``source`` buffers, which which channel to begin the processing. The default is 0.
4846

4947
:control numChans:
5048

51-
For multichannel source buffers, how many channels should be processed.
49+
For multichannel ``source`` buffers, how many channels should be processed. The default of -1 indicates to process up through the last channel in ``source``.
5250

5351
:control destination:
5452

55-
The |buffer| to write the flattened data to
53+
The |buffer| to write the flattened data to.
5654

5755
:control axis:
5856

59-
Whether to group points channel-wise or frame-wise
60-
57+
Whether to flatten the buffer channel-wise (1) or frame-wise (0). The default is 1 (channel-wise).

doc/BufMFCC.rst

Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,59 +4,64 @@
44
:sc-related: Guides/FluidCorpusManipulationToolkit, Guides/FluidBufMultiThreading, Classes/FluidBufMelBands
55
:see-also:
66
:description:
7-
This class implements a classic spectral descriptor, the Mel-Frequency Cepstral Coefficients (https://en.wikipedia.org/wiki/Mel-frequency_cepstrum). The input is first filtered in to **numBands** perceptually-spaced bands, as in Classes/FluidMelBands. It is then analysed into **numCoeffs** number of cepstral coefficients. It has the advantage of being amplitude invariant, except for the first coefficient. It is part of the Guides/FluidCorpusManipulationToolkit of Guides/FluidCorpusManipulationToolkit. For more explanations, learning material, and discussions on its musicianly uses, visit http://www.flucoma.org/
8-
9-
The process will return a single multichannel buffer of **numCoeffs** per input channel. Each frame represents a value, which is every hopSize.
7+
8+
MFCC stands for Mel-Frequency Cepstral Coefficients ("cepstral" is pronounced like "kepstral"). This analysis is often used for timbral description and timbral comparison. It compresses the overall spectrum into a smaller number of coefficients that, when taken together, describe the general contour the the spectrum.
109

10+
The MFCC values are derived by first computing a mel-frequency spectrum, just as in :fluid-obj:`MelBands`. ``numCoeffs`` coefficients are then calculated by using that mel-frequency spectrum as input to the discrete cosine transform. This means that the shape of the mel-frequency spectrum is compared to a number of cosine wave shapes (different cosines shapes created from different different frequencies). Each MFCC value (i.e., "coefficient") represents how similar the mel-frequency spectrum is to one of these cosine shapes.
1111

12+
Other that the 0th coefficient, MFCCs are unchanged by differences in the overall energy of the spectrum (which relates to how we perceive loudness). This means that timbres with similar spectral contours, but different volumes, will still have similar MFCC values, other than MFCC 0. To remove any indication of loudness but keep the information about timbre, we can ignore MFCC 0 by setting the parameter ``startCoeff`` to 1.
1213

14+
For more information visit https://learn.flucoma.org/reference/mfcc/.
15+
16+
For an interactive explanation of this relationship, visit https://learn.flucoma.org/reference/mfcc/explain.
17+
1318
:control source:
1419

15-
The index of the buffer to use as the source material to be described through the various descriptors. The different channels of multichannel buffers will be processing sequentially.
20+
The index of the buffer to use as the source material to be analysed. The different channels of multichannel buffers will be processing sequentially.
1621

1722
:control startFrame:
1823

19-
Where in the srcBuf should the process start, in sample.
24+
Where in the ``srcBuf`` the analysis should start, in samples. The default is 0.
2025

2126
:control numFrames:
2227

23-
How many frames should be processed.
28+
How many frames should be analysed. The default of -1 indicates to analyse to the end of the buffer.
2429

2530
:control startChan:
2631

27-
For multichannel srcBuf, which channel should be processed first.
32+
For a multichannel ``srcBuf``, which channel should be processed first. The default is 0.
2833

2934
:control numChans:
3035

31-
For multichannel srcBuf, how many channel should be processed.
36+
For a multichannel ``srcBuf``, how many channels should be processed. The default of -1 indicates to analyse through the last channel.
3237

3338
:control features:
3439

35-
The destination buffer for the numCoeffs coefficients describing the spectral shape.
40+
The destination buffer to write the MFCC analysis into.
3641

3742
:control numCoeffs:
3843

39-
The number of cepstral coefficients to be outputed. It will decide how many channels are produce per channel of the source.
44+
The number of cepstral coefficients to return. The default is 13.
4045

4146
:control numBands:
4247

43-
The number of bands that will be perceptually equally distributed between **minFreq** and **maxFreq**.
48+
The number of bands that will be perceptually equally distributed between ``minFreq`` and ``maxFreq``. The default is 40.
4449

4550
:control startCoeff:
4651

47-
The lowest index of the output cepstral coefficient, zero-counting.
52+
The lowest index of the output cepstral coefficients to return, zero-counting. This can be useful to skip over the 0th coefficient (by indicating ``startCoeff`` = 1), because the 0th coefficient is representative of the overall energy in spectrum, while the rest of the coefficients are not affected by overall energy, only the mel-frequency spectral contour. The default is 0.
4853

4954
:control minFreq:
5055

51-
The lower boundary of the lowest band of the model, in Hz.
56+
The lower bound of the frequency band to use in analysis, in Hz. The default is 20.
5257

5358
:control maxFreq:
5459

55-
The highest boundary of the highest band of the model, in Hz.
60+
The upper bound of the frequency band to use in analysis, in Hz. The default is 20000.
5661

5762
:control windowSize:
5863

59-
The window size. As MFCC computation relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty
64+
The window size. As MFCC computation relies on spectral frames, we need to decide what precision we give it spectrally and temporally, in line with Gabor Uncertainty principles. http://www.subsurfwiki.org/wiki/Gabor_uncertainty. The default is 1024.
6065

6166
:control hopSize:
6267

@@ -68,13 +73,4 @@
6873

6974
:control padding:
7075

71-
Controls the zero-padding added to either end of the source buffer or segment. Possible values are 0 (no padding), 1 (default, half the window size), or 2 (window size - hop size). Padding ensures that all input samples are completely analysed: with no padding, the first analysis window starts at time 0, and the samples at either end will be tapered by the STFT windowing function. Mode 1 has the effect of centering the first sample in the analysis window and ensuring that the very start and end of the segment are accounted for in the analysis. Mode 2 can be useful when the overlap factor (window size / hop size) is greater than 2, to ensure that the input samples at either end of the segment are covered by the same number of analysis frames as the rest of the analysed material.
72-
73-
:control maxNumCoeffs:
74-
75-
The maximum number of cepstral coefficients that can be computed. This sets the number of channels of the output, and therefore cannot be modulated.
76-
77-
:control maxFFTSize:
78-
79-
How large can the FFT be, by allocating memory at instantiation time. This cannot be modulated.
80-
76+
Controls the zero-padding added to either end of the source buffer or segment. Possible values are 0 (no padding), 1 (default, half the window size), or 2 (window size - hop size). Padding ensures that all input samples are completely analysed: with no padding, the first analysis window starts at time 0, and the samples at either end will be tapered by the STFT windowing function. Mode 1 has the effect of centring the first sample in the analysis window and ensuring that the very start and end of the segment are accounted for in the analysis. Mode 2 can be useful when the overlap factor (window size / hop size) is greater than 2, to ensure that the input samples at either end of the segment are covered by the same number of analysis frames as the rest of the analysed material.

0 commit comments

Comments
 (0)