Coder Social home page Coder Social logo

mimic-sussex / sema Goto Github PK

View Code? Open in Web Editor NEW
151.0 11.0 51.0 85.99 MB

Sema – A Playground for Live Coding Music and Machine Learning

Home Page: https://sema.codes

License: MIT License

HTML 0.25% JavaScript 21.49% CSS 2.59% Nearley 4.74% HCL 0.93% Svelte 70.00%
live-coding language-design signal-processing machine-learning web-audio

sema's Introduction

Sema – A Playground for Live Coding Music and Machine Learning

version stability-experimental PRs Welcome Build Status Website GitHub license


Sema is a playground where you can rapidly prototype live coding mini-languages for signal synthesis, machine learning and machine listening.

Sema aims to provide an online integrated environment for designing both abstract high-level languages and more powerful low-level languages.

Sema implements a set of core design principles:

  • Integrated signal engine – In terms language and signal engine integration, there is no conceptual split. Everything is a signal. However, for the sake of modularity, reusability, and a sound architecture, sema's signal engine is implemented by the sema-engine library.

  • Single sample signal processing – Per-sample sound processing for supporting techniques that use feedback loops, such as physical modelling, reverberation and IIR filtering.

  • Sample rate transduction – It is simpler to do signal processing with one principal sample rate, the audio rate. Different sample rate requirements of dependent objects can be resolved by upsampling and downsampling, using a transducer. The transducer concept enables us to accommodate a variety of processes with varying sample rates (video, spectral rate, sensors, ML model inference) within a single engine.

  • Minimal abstractions – There are no high-level abstractions such as buses, synths, nodes, servers, or any language scaffolding in our signal engine. Such abstractions sit within the end-user language design space.

Dependencies

Sema requires the following dependencies to be installed:

  • Chrome browser or any Chromium-based browser (e.g. Brave, Microsoft Edge, Opera)
  • Node.js active LTS version (currently v14.4.0). To switch between node versions, you can use nvm.
  • NPM cli OR Yarn

In order to run, Sema must connect with a project url and api key to a Supabase backend.

How to build and run the Sema playground on your machine

If you decide to use npm to build sema, you can follow this list of commands:

$ cd sema
$ npm install
$ npm run build
$ npm run dev

If you decide to go with the Yarn package manager instead, you can use the following list of commands:

To use Yarn:

$ cd sema
$ yarn
$ yarn build
$ yarn dev

Once you have sema running as a node application, you can load it on your browser on the following ports

Hardware acceleration:

Hardware acceleration will have a drastic effect in Tensorflow.js model training speed.

To enable it in Chrome:

  • Navigate to chrome://settings
  • Click the Advanced ▼ button at the bottom of the page
  • In the System section, ensure the Use hardware acceleration when available checkbox is checked (relaunch Chrome for changes to take effect)

To enable in Firefox:

  • Go to about:preferences
  • Scroll till you reach the Performance section, or simply search for "performance"
  • Enable recommended performance settings, this will enable hardware acceleration if and when it is available

Linux Users

Sema uses Web Audio API Audio Worklets. Their performance seems very sensitive to CPU power scaling. If you are experiencing sound quality issues, try setting the CPU governor to performance mode. e.g on Ubuntu,

$ cpupower frequency-set --governor performance

Documentation

Sema's internal documentation aims at supporting the users learning experience. It is integrated within the application and comprises the following sections:

Sema's Wiki documentation aims at supporting contributions. It focuses on how Sema is designed and built:

Contributing

Sema is an open-source project and hopefully the underlying vision, aims and structure will motivate you to contribute to it. Check the following:

Publications

Bernardo, F., Kiefer, C., Magnusson, T. (2021). Assessing the Support for Creativity of a Playground for Live Coding Machine Learning, In: Baalsrud Hauge J., C. S. Cardoso J., Roque L., Gonzalez-Calero P.A. (eds) Entertainment Computing – ICEC 2021. ICEC 2021. Lecture Notes in Computer Science, vol 13056. Springer, Cham. https://doi.org/10.1007/978-3-030-89394-1_38

Bernardo, F., Kiefer, C., Magnusson, T. (2020). A Signal Engine for a Live Coding Language Ecosystem, J. Audio Eng. Soc., vol. 68, no. 10, pp. 756-766. doi: https://doi.org/10.17743/jaes.2020.0016

Bernardo, F., Kiefer, C., Magnusson, T. (2020). Designing for a Pluralist and User-Friendly Live Code Language Ecosystem with Sema. 5th International Conference on Live Coding, University of Limerick, Limerick, Ireland

Bernardo, F., Kiefer, C., Magnusson, T. (2019). An AudioWorklet-based Signal Engine for a Live Coding Language Ecosystem. In Proceedings of Web Audio Conference 2019, Norwegian University of Science and Technology (NTNU), Trondheim, Norway (Best Paper Award at Web Audio Conference 2019)

sema's People

Contributors

amalgah avatar chaosprint avatar chriskiefer avatar dependabot[bot] avatar egemenertugrul avatar emmawinston avatar frantic0 avatar mnistrel avatar smilo7 avatar teropa avatar thormagnusson 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sema's Issues

Undo function

The live coding editor could have an undo function that would revert back to previously running code replacing the signal graph and the code in the code window.

Use cmd+z for Undo and cmd+Shift+z to revert back to what was undone. (Like in a regular text editor)

Add basic functionality for recording and managing training sequences

This is cumbersome to write in JS, would be nice to have these available as functions / classes.

To help the whole workflow for:

  • recording a sequence from incoming data (growing buffer for a full sequence; circular buffer to create frames for use in realtime prediction)
  • loading / storing these sequences to disk - also not just as single sequences, but as a set.
  • formatting these sequences/sets as input for TensorFlow based models.

Implement pulse oscillator with variable pulse width and/or a single pulse generator

Referring to issue #14, to trigger envelopes, we need an audio unit to have an oscillator with variable pulse width.
Then you can have a pattern going on where the duration of the note and the time between notes is different from each other.

Alternatively, the option to have a single pulse with a variable width, that is triggered within a sequence would be very useful.

grammar does not accept negative numbers

{2.0,-1.0}mul

gives error:


index.js:235 DEBUG:Main:evalLiveEditorExpression: {2.0,-1.0}mul
nearley.worker.js:28 ErrorError: invalid syntax at line 1 col 6:

  {2.0,-
       ^
Unexpected hyphen token: "-"

workaround:

{2.0,{0.0,1.0}sub}mul

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.