Skip to content

Commit

Permalink
Merge pull request #5 from kanduvisla/develop
Browse files Browse the repository at this point in the history
v0.3
  • Loading branch information
kanduvisla authored Oct 16, 2024
2 parents 00f7285 + 26b6c9b commit 902d176
Show file tree
Hide file tree
Showing 4 changed files with 164 additions and 65 deletions.
47 changes: 19 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,30 @@ This tool adds the following effects to the pattern editor:

- The following effects are applicable to both **columns** and **tracks**:
- Note triggers
- 1st pattern only
- `LT01`
- !1st pattern only
- `LT00`
- nth pattern only
- `LTn0`
- Play every xth pattern after y runs
- `LTyx`
- `LT01` : Only play the first run of this pattern.
- `LT00` : Don't play the first run of this pattern.
- `LTn0` : Only play the nth run of this pattern.
- `LTyx` : Play every xth pattern after y runs. Some examples:
- `LT21` : Play the note on run 1, but not run 2 (`2:1`)
- `LT33` : Play the note on run 3, but not on 1 and 2 (`3:3`)
- Inverted (Don't play every xth pattern after y runs)
- `LIyx`
- `LIyx` : Inverted trigger (Don't play every xth pattern after y runs). Some examples:
- `LI41` : Play the note on run 2, 3 and 4, but not on 1 (`4:1`)
- `LI33` : Play the note on run 1 and 2, but not 3 (`3:3`)
- Fills
- Only play when not having a fill
- `LF00`
- Only play when transitioning to another pattern
- `LF01`
- Start muted
- `LM00`
- `LMxx` : Unmute after `xx` runs (in dec)
- `LF00` : Only play when not having a fill/transition to another pattern
- `LF01` : Only play when having a fill/transition to another pattern
- Muting
- `LM00` : Start track muted
- `LMxx` : Unmute after `xx` runs (in dec)
- The following effects are applicable to **only tracks**:
- Automatically set next pattern
- `LNxx` : Go to pattern `xx` (in dec)
- `LNxx` : Set pattern `xx` (in dec) to be the next one in the queue.
- Set pattern play count
- `LPxx` : Set pattern play count to `xx` (transitions will be triggered in the last count)
- Cutoff pattern (generate polyrhythm)
- `LC00` : Cut off (and repeat) the pattern from this point. This is up to but not included, so a cut on line 4 would repeat lines 1,2 and 3; effectively creating a [polyrhythm](https://en.wikipedia.org/wiki/Polyrhythm). Triggs (`LT`) and inverted triggs (`LI`) are supported; fills (`LF`) and muting (`LM`) are not.
- `LPxx` : Set pattern play count to `xx` (transitions will be triggered in the last count). When a next pattern is queued, the current pattern plays a full `xx` runs. For example: a 16-bar pattern with `LP04` will always play in sets of 4, but you can already queue it on the first run. Fills will be triggered in the last run.
- Cutoff pattern (useful to generate polyrhythms)
- `LC00` : Cut off (and repeat) the pattern from this point. This is up to but not included, so a cut on line 4 would repeat lines 1,2 and 3; effectively creating a [polyrhythm](https://en.wikipedia.org/wiki/Polyrhythm).
- Triggs (`LT`) and inverted triggs (`LI`) are supported when a track uses `LC`
- Fills (`LF`) and muting (`LM`) are not supported when a track uses `LC`

## Ideas

Expand All @@ -66,18 +61,13 @@ This is a rough lists of ideas that I want to add to this plugin in the future:
- Add mute / unmute buttons to UI
- Queue mute / unmute
- When queueing mute, do play the first note before muting
- Add fill button to UI
- So you can trigger a fill without a transition
- Add trig condition that only plays on the first pattern after a fill
- suggestion: `LF02`
- Add trig condition that doesn't plays on the first pattern after a fill
- suggestion: `LF03`
- Stutter / randomize track
- Set pattern play count
- When a next pattern is queued, make sure that the pattern plays a full x cycles. For example: a 16-bar pattern you might always want to play 4 times, but you already want to queue it on the first play.
- Fill will be triggered in the last rotation.
- UI should indicate how many rotations are left.
- Suggestion: `LP04` = 4 plays
- Muting Groups - where you can mute/unmute multiple tracks at once
- More optimizations (any help is welcome)

## Known issues & limitations

Expand All @@ -87,3 +77,4 @@ This is a rough lists of ideas that I want to add to this plugin in the future:
- Muting in tracks don't work in tracks that are cut with the `LC` command
- When live-editing a track with a `LC` command, funky things will happen due to the virtual counting.
- Possibly a Renoise bug, but when you delete an effect from a track, the `L` in the FX column changes (to a `K` for example).
- Transitioning between patterns of different lengths not yet very stable. Using `ZB00` on the end of your pattern helps when the next pattern is longer, but when transitioning from a longer to a shorter pattern it's not really stable yet.
25 changes: 23 additions & 2 deletions includes/cutoff_points.lua
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ process_cutoff_points = function(t, dstPattern, srcPattern, song, trackLengths,
-- times it has already copied to keep the remainder in mind.

-- How many times does this pattern "fit" in this track:
local duplicationCount = math.ceil(numberOfLines / trackLengths[t])
local duplicationCount = math.ceil(numberOfLines / trackLengths[t]) + 1

-- Copy from first line up until the line with the "LC" effectL
for fl=1, l - 1 do
Expand Down Expand Up @@ -51,7 +51,28 @@ process_cutoff_points = function(t, dstPattern, srcPattern, song, trackLengths,
dstTrack:line(dstLine):copy_from(srcLine)
end

-- TODO: columns
-- Check for column effects (the apply to a single column):
local line = dstTrack:line(dstLine)
local columns = line.note_columns
for c=1, #columns do
local column = line:note_column(c)
local effect_number = column.effect_number_string
local effect_amount = column.effect_amount_string
-- Fill:
if effect_number == "LF" then
-- TODO, how to do fills with polyrhythm?
elseif effect_number == "LT" then
if not is_trig_active(effect_amount, virtualTrackPlayCount) then
column:clear()
end
-- Inversed Trigger:
elseif effect_number == "LI" then
if is_trig_active(effect_amount, virtualTrackPlayCount) then
column:clear()
end
end -- end if

end -- end for#columns
end -- end if#line<>
end -- end for#duplicationCount
end -- end for#fl
Expand Down
28 changes: 28 additions & 0 deletions includes/fill.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
-- Determine if there is a fill
-- Returns true if the note is to be kept, false if the note is to be cleared
is_fill = function(currPattern, nextPattern, patternPlayCount, patternSetCount, amountString, userInitiatedFill)
-- Remove the not playing ones:
if nextPattern ~= currPattern or userInitiatedFill == true then
-- Transition to another pattern
-- Check if we're in the last run of the set:
if (patternPlayCount + 1) % patternSetCount == 0 then
-- We're in a transition, filter out "00"
if amountString == "00" then
return false
end
else
-- We're not yet in the last part of the set, filter out "01"
if amountString == "01" then
return false
end
end
else
-- No transition to another pattern, filter out "01"
if amountString == "01" then
return false
end
end

return true
end

Loading

0 comments on commit 902d176

Please sign in to comment.