Open jarmitage opened 3 years ago
This would be an interesting feature to add. I can see several usages in Glicol immediately:
aa: seq '[0 [1 2]*4 <5 6 7> 8]' >> sp \bd
or
aa: sound 'bd [bd ~] ~ bd*4'
But since Glicol has its own philosophy on syntax, of which one prominent feature is to have no pair symbols, it is better to only have a minimal modification to the glicol.pest
file when adding new features. For instance, we can only add an one-line rule of Tidal:
tidalpattern = { "\'" ~ ANY* ~ "\'" } // pseudo pest code
Similar to how Gibber mixes in mini-Tidal, the best solution is to create an individual Rust crate for doing the same job as the example you mentioned in Rust:
use tidalcycles::pattern_to_event;
let event = pattern_to_event("bd ~".to_string());
Then in nodes like seq
or sp
, these patterns can be parsed in the node constructing process.
This Tidal crate can be created with pest.rs or other tools, and can be reused in other projects.
Another possibility here would be to build an OSC bridge with Tidal or Strudel or Vortex.
All of the above also show more ideas for how to implement pattern parsers for inspiration to make a Rust-based parser.
On the Rust side, these look interesting:
Edit: closed by accident 😅
What are the author's thoughts on introducing a pattern syntax such as
tidal.pegjs
? https://github.com/gibber-cc/tidal.pegjsWould this require porting the above to Pest.rs?