Giter Club home page Giter Club logo

softcut-lib's People

Contributors

artfwo avatar catfact avatar rcolinray avatar sbl avatar schollz avatar tehn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

softcut-lib's Issues

simultaneous loop set and position move bug

i feel like i've stumbled onto a bug, so logging it here before i look at the softcut code (tomorrow)

ex: if looping from 0-2 and move the loop points to 2-4 and the position to 3 (ie, mid-loop) somehow the position lands on 2, not 3.

likewise if loop is at 2-4, setting it to 0-2 and position to 1 (mid-loop) will actually put position at 0 (loop start).

test code below shows this (use K2 and K3 to set loop regions, feedback is visual from the phase callback)

function init()
  softcut.enable(1,1)
  softcut.buffer(1,1)
  softcut.loop(1,1)
  softcut.loop_start(1,0)
  softcut.loop_end(1,2)
  softcut.position(1,0)
  softcut.play(1,1)

  softcut.phase_quant(1,0.0625)
  softcut.event_phase(update_positions)
  softcut.poll_start_phase()
end

pos = {}

function update_positions(n,d)
  pos[n] = d
  redraw()
end

function redraw()
  screen.clear()
  screen.move(20,10)
  screen.line_rel(pos[1]*16,0)
  screen.stroke()
  screen.move(0,50)
  screen.font_face(2)
  screen.text(pos[1])
  screen.update()
end

function key(n,z)
  if n==2 and z==1 then
    softcut.loop_start(1,0)
    softcut.loop_end(1,2)
    softcut.position(1,1)
  elseif n==3 and z==1 then
    softcut.loop_start(1,2)
    softcut.loop_end(1,4)
    softcut.position(1,3)
  end
end

wrap write frame index to loop, not buffer

record head position is computed by adding record offset to write head position, then wrapping.

this wraps to buffer size, not to loop size, e.g. here:
https://github.com/monome/norns/blob/master/crone/src/softcut/SubHead.cpp#L130

it doesn't matter until you start changing the offset amount. then you can have material in the loop that was written with the old offset, but which will never be hit with the new offset.

made a branch that had SubHead tracking loop positions in frames and using that for wrapping. but it's not quite enough, because wrap points should be [start, end+fade] when rate > 0, and [start-fade, end] when rate < 0. and rate can change each sample... so this bookkeeping should happen in the parent SoftCutHead, and maybe it's not quite worth it at all.

send loop trigger

would be helpful to have a non-periodic poll that simply fires when a loop happens in softcut (with voice ID number perhaps)

the old ugen did this.

requires:

  • each audio block, each voice, each subhead reports boolean didLoop
  • add new Poll and update appropriately: this means we need proper mechanism for non-periodic polls with updates initiated from audio thread. this could be a worker thread or a non-blocking, non-allocating lo_send analog.

more clients

it would be nice to have a couple more clients

  • max/MSP external
  • pd external
  • supercollider ugen

these should be pretty easy to make now.

[dev] glitch on sign change in rate

in buffered-state version (dev branch), still some nasty glitches when changing rate sign, which seem to recur every audio block, or something

they seem to go away after the first loop.

i think this is because recordOffsetSamples doesn't get applied to wrIdx until wrIdx is reset when fading in for a new loop. so we probably need to flag rate sign change, and re-apply record offset when needed

replace smoothers with envelopes

replace dumb 1-pole log smoothers with tapered envelopes.

important for a good experience when modulating playback/rec/pre levels.

arbitrary easing functions and LFO/sequencing modes could make it fun for movement rate as well.

weird position bug when enabling record

see this thread:
https://llllllll.co/t/norns-2-0-softcut/20550/147?u=zebra

under some condition, which is not yet understood, enabling record flag on a playing voice will cause material to be written to the wrong part of the buffer.

it seems likely that the inactive sub-head is erroneously writing (?)

i will work on a minimal repro case. but the example case goes like this:

  1. enable rec, start playing
  2. set loop endpoint, jump to loop beginning, disable rec
  3. enable rec in the middle of the loop, before reaching the loop endpoint. new audio is erroneously written to the beginning of the loop.

if step (3) occurs after a loop has already happened, the problem isn't seen.

voice-duck mode

allow voice N to modulate its playback level as a function of it's position, and that of a second voice M.

this can be used to apply a fadeout around the clicks that would otherwise occur when M is writing and N is reading, at different rates.

voice-follow mode

add a mode for any voice N to copy its position and level settings from voice M on each block, instead of computing them.

this could be used to create stereo pairs (with arbitrary pan/width no less.)

patch: [macos] for missing <array> and homebrew build support

I tried to compile on a macOS (x86_64) and had to make the following changes to enable compilation without errors.

  • A fix to clients/softcut_jack_osc/src/BufDiskWorker.cpp to include <array>

  • Some additions to clients/softcut_jack_osc/CMakeLists.txt to make it work nicely with homebrew installed dependencies if available.

The patch is as follows and attached at the end of this post:

diff --git a/clients/softcut_jack_osc/CMakeLists.txt b/clients/softcut_jack_osc/CMakeLists.txt
index 08798c0..6381cc6 100644
--- a/clients/softcut_jack_osc/CMakeLists.txt
+++ b/clients/softcut_jack_osc/CMakeLists.txt
@@ -13,9 +13,38 @@ set(SRC src/main.cpp
 
 add_executable(softcut_jack_osc ${SRC})
 
-include_directories(../../softcut-lib/include)
 
-target_link_libraries(softcut_jack_osc softcut jack lo pthread sndfile)
+if(CMAKE_HOST_APPLE)
+    execute_process(
+        COMMAND brew --prefix
+        OUTPUT_VARIABLE HOMEBREW_PREFIX
+        OUTPUT_STRIP_TRAILING_WHITESPACE
+    )
+    if(DEFINED HOMEBREW_PREFIX)
+        set(HAS_HOMEBREW 1)
+        message(STATUS "HAS_HOMEBREW: ${HAS_HOMEBREW}")
+        message(STATUS "HOMEBREW_PREFIX: ${HOMEBREW_PREFIX}")
+    endif()
+endif()
+
+
+include_directories(
+    ../../softcut-lib/include
+    $<${HAS_HOMEBREW}:${HOMEBREW_PREFIX}>/include
+)
+
+target_link_directories(softcut_jack_osc
+    PRIVATE
+    $<${HAS_HOMEBREW}:${HOMEBREW_PREFIX}>/lib
+)
+
+target_link_libraries(softcut_jack_osc
+    softcut
+    jack
+    lo
+    pthread
+    sndfile
+)
 
 target_compile_options(softcut_jack_osc PRIVATE -Wall -Wextra -pedantic)
 
diff --git a/clients/softcut_jack_osc/src/BufDiskWorker.cpp b/clients/softcut_jack_osc/src/BufDiskWorker.cpp
index e5c8dc4..8b65230 100644
--- a/clients/softcut_jack_osc/src/BufDiskWorker.cpp
+++ b/clients/softcut_jack_osc/src/BufDiskWorker.cpp
@@ -12,6 +12,7 @@
 
 #include <sndfile.hh>
 #include <utility>
+#include <array>
 
 #include "BufDiskWorker.h"

macos_fix.patch

bitcrushing stage

add a nice variable bitcrusher (compander + modulo), maybe before post-filter

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.