Coder Social home page Coder Social logo

stepp0r's Introduction

Launchpad Step Sequencer

This will be a step sequencer for Renoise using the Launchpad.

How to release new version

git flow release start

  • remove all print functions (comment them out)
  • update version in manifest.xml and Rakefile

rake package

  • copy xrnx to renoise

git flow release finish

Structure

Layer

Layers should represent something that exists and you can talk to. Like the Launchpad or an OscClient.

Data

Should prevent you from magic numbers.

Init

Should hold all the stuff you need to set up the system. Everything from main.lua will call stuff from in here.

Module

A module is something that is used by other Modules. Most of the time that is something that writes something to the Launchpad.

Sub-Module

Sub-Modules are no real data-type. Because Modules become hard to manage over time, I split them up in multiple files. The folder always has a file-named like the folder require-ing all the other sub-module. Every Sub-Module should have a __init_SUBMODULE __activate_SUBMODULE and __deactivate_SUBMODULE function, even if they are empty. These functions will be called in the Modules init _activate and _deactivate function.

Mode

Is some kind of abstract Module, to toggle other module on and off.

Module fields

self.is_active and self.is_not_active will give you information if this module is activated or not. Use them in your notifies and callbacks!

self.is_first_run and self.first_run will always be true till the first time self._activate() is called. After self._activate() has finished, those values will be false. While the first time self._activate() is called those values will be true. Use them to control the wiring against notifies.

Data

Modules have them too, and the convention is <ModuleName>Data. It holds the Constant values for the module or this artifact (Color or Note for example). Its a dictionary (table). For more complex objects it has a access key (containing the indices to access parts of the complex object)

Observables

It would be best to use the native Observables but they are strictly bound to a type. In a lot of cases we want to publish changes of whole objects, like in the Pagination module. So we stick to the manual callback process. Here is a brief description on how this is to implement.

Example Callback setup (Manuel)

You have two objects LayerObject and ModuleObject. The LayerObject holds variables which should trigger update routines in the ModuleObject if changing.

Create the callback hook.

  function LayerObject:__init( )
    ...
    self.update_callbacks = {}
  end

  function LayerObject:register_update_callback( callback )
    table.insert( self.update_callbacks, callback )
  end

and the update function

  function LayerObject:update_callbacks( )
    local myUpdate = {
      foo = self.value_1,
      bar = self.value_2,
    }
    for _, callback in ipairs(self.update_callbacks) do
        callback(myUpdate)
    end
  end

After that you can hook in the LayerObject

  function ModuleObject:hook( layerObject )
    local callback = function ( update )
      print( update.foo )
      print( update.bar )
    end
    layerObject:register_update_callback( callback )
  end

Pros and Cons

It is a lot of work you have to do to set something up like this. But you can pass around object, which is in most cases more readable. It might be possible that you dont need that at all, and you are fine with just the Observables given for primitive data types.

Example Callback setup (ObservableBang)

(much more readable)

function LayerObject:__init()
    self.value = {
        foo = "foo",
        bar = "baz"
    }
    self.value_observable = renoise.Document.ObservableBang
end

function LayerObject:change()
    self.value = {
        foo = "bar",
        bar = "baz"
    }
    self.value_observable:bang()
end

Hook to it

function ModuleObject:wire_layer(layer)
    self.layer = layer
    add_notifier( self.layer.value_observable, function() 
        print(self.layer.value.foo)
        print(self.layer.value.bar)
    end)
end

stepp0r's People

Contributors

mrvandalo avatar mrvandalo-springer avatar the-xor avatar

Stargazers

 avatar  avatar Roland avatar  avatar [0] avatar Mikael 'tew' avatar metakeule avatar Alexandre Bique avatar wizetek avatar  avatar Harald Lapp avatar

Watchers

 avatar James Cloos avatar  avatar

stepp0r's Issues

fix master branch

The master branch is strange. There must there are strange folders and all.

-> clean that up.

select instrument in renoise when select instrument on launchpad

Also the other way around ?

right now :

  • Selecting a track in renoise will select the instrument and track on the launchpad too
  • Selecting an instrument on the launchpad will select the the track on renoise too.

addition:

  • selecting an instrument in renoise will select the instrument and track on the launchpad too. (ergo select the track on renoise too)
  • selecting an instrument on the launchpad will also select the instrument in renoise.

questions?

  • what about instrument rows in renoise which don't have a name (meaning they are not instruments)? -> don't select anything on the launchpad (and there for in renoise too)

follow currente play position

like the follow the play position in renoise it would be greate to follow the play-position also on the pad. So pagination will be done automatically.

Edit Pattern Matrix

Like Live-Dive and Grid-Pie, Stepp0r should also have access to the PatternMatrix.

  • Sketches about the UI exist.
  • This is just the first ticket to get this thing started. It will of course improve over time.
  • Focus is on a Producer point of view, to create a Track, and not mix it live (like live-dive).

dodgy usb cable generates lockup

i seem to be getting a lock up....
C:\Users\Slippy\AppData\Roaming\Renoise\V3.0.1\Scripts\Tools\com.mrVanDalo.Stepp0r.xrnx\main.lua' failed in one of its notifiers.

Please contact the author (Ingolf Wagner ([email protected])) for assistance...

.\Layer/Launchpad/RotationRight.lua:75: Script execution terminated by user.
stack traceback:
[string "do..."]:37: in function <[string "do..."]:35>
.\Layer/Launchpad/RotationRight.lua:75: in function 'set_matrix_right'
.\Layer/Launchpad/Launchpad.lua:133: in function 'set_matrix'
.\Module/Keyboard/Keyboard.lua:188: in function 'matrix_clear'
.\Module/Keyboard/Keyboard.lua:178: in function 'matrix_refresh'
.\Module/Keyboard/Keyboard.lua:83: in function '_activate'
.\Module/Module.lua:23: in function 'activate'
.\Mode/Mode.lua:58: in function '__activate_mode'
.\Mode/Mode.lua:23: in function 'callback'
.\Mode/StepperMode.lua:67: in function '__update_mode'
.\Mode/StepperMode.lua:73: in function '_activate'
.\Module/Module.lua:23: in function 'activate'
.\Init/LaunchpadSetup.lua:75: in function 'activate'
main.lua:64: in function 'run_callback'
.\Init/MainUI.lua:272: in function 'run'
.\Init/MainUI.lua:227: in function <.\Init/MainUI.lua:223>

i have to unplug the launchpad before renoise spits out an error, the lockup happens randomly, i have tried disabling other tools that may be interfering....

[edit] seems this could be a dodgy usb cable.sorry...when the usb cable moves slightly out of place the tool locks up,....ive replaced it :-)

record button

  • pressing the record button also selects the edit pattern view
  • pressing the record button also sets the cursor to follow the playback position.

Move instruments around

Moving tracks or instruments in a late stage of your project makes trouble because of one instrument one track rule.

There should be a plugin for moving stuff around.

Improve pattern editor view

  • when selecting a note on the keyboard, highlight all notes on the pattern editor which have the same tone
  • show notes on other note columns like on a radrar. So it is easy to arrange different note columns.

Don't select Group Tracks

  • creating a group (containing track 1 and 2) with 3 instruments.
  • select third instrument
  • edit on the step area. you will not be able to edit anything. because you select and target the group pattern track.

Find a better way to remove notifiers

renoise object notfiers are still calling function. but theses functions just don't react to changes when inactive.

It is better to unregister theses functions. For this we have to safe the callbacks itself.

self.foo_callback = function (_) ... end 
renoise.song().some_observable:add_notifier(self.foo_callback)
renoise.song().some_observable:remove_notifier(self.foo_callback)

Right now its done using the is_first_run and is_not_active values. which is kinda the same, but we can't react on configuration changes (on restarting the plugin start -> stop -> reconfigure -> start) which need different callback registrations, than before.

Write Tests

  • wrap renoise in Layer Modules (and mock them in tests)
  • find the standard way of writing tests in lua,
  • mock renoise calls right in the testscenario (renoise.sone(). ...)

Add UI

add ui to start the thing

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.