0.0.0.0:80 5line / master demos / terminal / terminal.factor
master

Tree @master (Download .tar.gz)

terminal.factor @masterraw · history · blame

! Copyright (C) 2026 Your name.
! See https://factorcode.org/license.txt for BSD license.
USING: 5line kernel literals ;
IN: 5line.demos.terminal

<<
: bassline-a ( -- pattern )
PATTERN: 6/8 @ 240 bpm in key 0
   A2-q
   C3-e E3-e
   A2-q
   E3-e G3-e
   A3-q
   A2-q
   C3-e E3-e
   A2-q
   E3-e G3-e
   A3-q
   C4-e E4-e
   E3-q C4-e
   G3-e
|| FIN ! ;

: melody-a ( -- pattern )
PATTERN: 6/8 @ 240 bpm in key 3
   A5-q.t

   A5-q.t

   A5-s
   C6-e.
   D6-e

   A5-s
   C6-e.
   D6-e
|| FIN ! ;
>>

: play-terminal ( -- )
   { { { $[ melody-a dup dup ] } 2 34 }
     { { $[ bassline-a dup ] } 1 53 } } play-track ;
! About as musical as a cat on a keyboard, but it works!