Skip to content

v0.9.0 redesigned architecture

Choose a tag to compare

@chaosprint chaosprint released this 15 Mar 17:00
· 279 commits to main since this release

TL;DR: Glicol is a graph-oriented live coding language and audio DSP library written in Rust. try the latest version: https://glicol.org


there are a lot of updates in this release. I basically rewrote all the rust part from scratch. now the source code is much easier to read. the error handling is also more robust. just pick some highlights:

rewrite the parser

  • the parser is now very strict and can catch almost all the errors in parsing
  • the parser can report the error with expecting... or unexpected... and pos
  • the parser now provide a get_ast function for parsing which will return a HashMap

make glicol_synth a standalone rust library that is ready to publish at crates.io

glicol_synth begins with a fork of the dasp_graph crate, written by @mitchmindtree.
many features and contents are added:

  • use const generics feature of rust for a customisable buffer size
  • replace the input from Vec to HashMap, so users can use a node id to select input
  • users can send Message to each node in real-time for interaction
  • add a higher level AudioContext for easier APIs
  • many useful audio nodes from oscillators, filters, etc.

rewrite the engine

  • the live coding engine takes some code for updating and always yield new blocks with next_block() method
  • some new mechanism for parsing and audio graph building and updating
  • we get the HashMap ast first and compare it with the old ast
  • there are some tracks that are completely new, deleted or modified; then further compare those modified tracks
  • get list of node_to_add, node_to_update and node_to_remove
  • check if it is possible to make the update, such as whether samples exist, and refs exist
  • not update the graph until every check is passed, else clean up the mess, and the graph is unchanged

rewrite the wasm-binder

  • some new sample adding mechanism
  • some more error reporting mechanism for the js side
  • updating is simplified to one single function with sharedarrarybuffer

js

  • automatically load samples
  • support stereo samples
  • better organise the commands into addSampleFiles, addSampleFolder, showAllSamples, getRandSample