andr-ew / cartographer Goto Github PK
View Code? Open in Web Editor NEWnorns softcut buffer space utility
norns softcut buffer space utility
came up with friendly solution:
warden.assign([voices, ], slice)
each slice would have a table of voice indices it is assigned to. calling the function above would detach indices from their last slice and insert them into the new slice. all setter functions would then just send update_voice
their voice table every call. update_voice
can even stick around as a lower level utility for voice assignment (which I still think I prefer).
potential solutions:
'stereo'
flag to update_voice
to increment buffer when setting the second voiceupdate_voice
which just overwrites whatever is stored'stereo'
flag in warden.subloop
& warden.divide
specifying that the new regions are stereo regions (buffer = { 1, 2 }
or buffer = 3
, 'both'
/'stereo'
?)warden
function to set a table as stereo buffersbuffer = 3
on all slicesblank_area = warden.divide(warden.buffer[1], 2)
rec_area = warden.subloop(blank_area)
play_area = warden.subloop(rec_area)
function init()
warden.load(blank_area, play_area)
end
function cleanup()
warden.save(blank_area, play_area)
end
last two arguments (non-table) may be save slot & file name
great for drums !
drums = cartographer.folder(cartographer.buffer, '~/dust/audio/common/808')
cartographer.assign(drums['808-BD'], 1)
cartographer.assign(drums['808-CP'], 2)
drums:trigger(1)
drums['808-CP']:trigger()
probably best to add a flag:
slice:get_start('seconds', 'absolute')
abstract lower level bits of save/load
, can be used externally for preset storage
using util.time()
rather than the clock ticks
a few shortcuts that take advantage of the region & buffer data in warden
Slice:clear()
: softcut.buffer_clear_region_
Slice:copy(source_slice, fade_time, reverse)
: buffer_copy_
Slice:read(file)
: buffer_read_
Slice:write(file)
: buffer_write_
Slice:render(samples)
: render_buffer
Slice:phase_relative(phase, [units])
: scale phase from phase_event
this might need to be recursive ?
Slice:position(t, units)
: no voice arg required
Slice:trigger()
runs position(0)
-- useful for one-shots
adjusts both the end point of one slice and the start point of the following slice, so they're sill touching. times are relative to slice containing both slices that are being adjusted. boundaries are 0-based, starting from the very beginning, which I think makes sense since you usually don't need to adjust the 0th boundary.
bundle:set_boundary(boundary, t, <'seconds' or 'fraction'>, <'relative' or 'absolute'>)
bundle:get_boundary(boundary, <'seconds' or 'fraction'>, <'relative' or 'absolute'>)
also:
bundle:index_to_boundary(index, <'left' or 'right'>)
bundle:boundary_to_index(boundary, <'left' or 'right'>)
mmm ok since dan suggested it maybe it does make sense - we don't want to extend the scope to control record flags, but we can abstract away only the parts of the function that set the record region size
lets see how it would look at a basic script level, using some readable conventions:
recording = false
has_initial_recording = false
function key(n, z)
if z == 1 and n == 2 then
if not has_initial_recording then
if not recording then
softcut.rec(1)
reg.rec:punch_in()
elseif recording then
softcut.rec(0)
reg.rec:punch_out()
end
elseif has_initial_recording then
if not recording then
softcut.rec(1)
recording = true
else
softcut.rec(0)
recording = false
end
end
end
end
options:
warden.load/save
with a data-only flagwarden
(audio_save/data_save
)warden
)A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.