Browse Source

Updated README, new modules, minor compiler changes

spesk 2 years ago
parent
commit
bd4f2084d7

+ 29 - 13
README.md

@@ -1,15 +1,15 @@
 
 # Table of Contents
 
-1.  [Modmark](#org3315e91)
-    1.  [Current Status and Goals](#org9a3029e)
-    2.  [Purpose](#orgbde233a)
-    3.  [Syntax](#org47e5981)
-        1.  [A Module File](#org6619c61)
-        2.  [A Patch](#orgefc3c3a)
+1.  [Modmark](#org18831d8)
+    1.  [Current Status and Goals](#org926a523)
+    2.  [Purpose](#org0463441)
+    3.  [Syntax](#org004fef7)
+        1.  [A Module File](#orgb5658bc)
+        2.  [A Patch](#orgf298aea)
 
 
-<a id="org3315e91"></a>
+<a id="org18831d8"></a>
 
 # Modmark
 
@@ -19,7 +19,7 @@ In future, this scope may be expanded to make available a language for describin
 data routing across a wide array of devices.
 
 
-<a id="org9a3029e"></a>
+<a id="org926a523"></a>
 
 ## Current Status and Goals
 
@@ -29,12 +29,28 @@ This software is currently a prototype. Right now the "compiler" is a Perl scrip
 A rough road map looks something like:
 
 -   [X] Prototype compiler in Perl
--   [ ] Test and stabilize syntax/grammar
+-   [ ] Test and stabilize syntax/grammar/prototype compiler
+    -   [ ] Bug with connections where similar connection names are not resolved properly,
+        resulting in duplicate or merged connections
+    -   [ ] Clean up module naming, should support `-` chars, possibly other chars
 -   [ ] Implement modmark as a source-to-source compiler in Racket ( "Real" implementation )
+    -   [ ] Implement `import as` semantics for brevity
+    -   [ ] Implement `import Module::MakeNoise::*` semantics for brevity
+    -   [ ] Implement importing specific module revisions, ie: `import Module::MakeNoise::Wogglebug::Rev1`
+    -   [ ] Standardize input/knob labeling semantics:
+        
+            - Input: Foo
+            -- Position: [1,12]
+            
+            - Knob: Foo
+            -- Position: [1,12]
+            
+            # Currently both of above "compile", and work as expected, in the case where a
+            # module parameter has both a knob and an input. It may be better to only have one way?
 -   [ ] Develop libraries for as many modules as possible
 
 
-<a id="orgbde233a"></a>
+<a id="org0463441"></a>
 
 ## Purpose
 
@@ -53,19 +69,19 @@ modules yourself. Modmark aims to offload this task by having the community desc
 to do that work again the next time we'd like to use it in a patch.
 
 
-<a id="org47e5981"></a>
+<a id="org004fef7"></a>
 
 ## Syntax
 
 
-<a id="org6619c61"></a>
+<a id="orgb5658bc"></a>
 
 ### A Module File
 
 [Make Noise Maths](./module_lib/maths.module)
 
 
-<a id="orgefc3c3a"></a>
+<a id="orgf298aea"></a>
 
 ### A Patch
 

+ 18 - 1
README.org

@@ -13,8 +13,25 @@
 
    A rough road map looks something like:
    - [X] Prototype compiler in Perl
-   - [ ] Test and stabilize syntax/grammar
+   - [ ] Test and stabilize syntax/grammar/prototype compiler
+     - [ ] Bug with connections where similar connection names are not resolved properly,
+       resulting in duplicate or merged connections
+     - [ ] Clean up module naming, should support =-= chars, possibly other chars
    - [ ] Implement modmark as a source-to-source compiler in Racket ( "Real" implementation )
+     - [ ] Implement =import as= semantics for brevity
+     - [ ] Implement =import Module::MakeNoise::*= semantics for brevity
+     - [ ] Implement importing specific module revisions, ie: =import Module::MakeNoise::Wogglebug::Rev1=
+     - [ ] Standardize input/knob labeling semantics:
+       #+BEGIN_SRC
+       - Input: Foo
+       -- Position: [1,12]
+
+       - Knob: Foo
+       -- Position: [1,12]
+
+       # Currently both of above "compile", and work as expected, in the case where a
+       # module parameter has both a knob and an input. It may be better to only have one way?
+       #+END_SRC
    - [ ] Develop libraries for as many modules as possible
 
 ** Purpose

+ 19 - 0
module_lib/a-185-2.module

@@ -0,0 +1,19 @@
+Manufacturer: Doepfer
+Module: PrecisionAdderA1852
+Rev: 1
+- Input: Input1
+- Input: Input2
+- Input: Input3
+- Input: Input4
+- Button: Switch1
+-- Position: [0,1]
+- Button: Switch2
+-- Position: [0,1]
+- Button: Switch3
+-- Position: [0,1]
+- Button: Switch4
+-- Position: [0,1]
+- Output: Output1
+- Output: Output2
+- Output: Output3
+- Output: InvertedOutput

+ 18 - 0
module_lib/make_noise_function.module

@@ -0,0 +1,18 @@
+Manufacturer: MakeNoise
+Module: Function
+Rev: 1
+- Input: Slew1
+- Button: Cycle
+-- Position: [0,1]
+- Input: Rise
+-- Position: [1,12]
+- Input: Both
+-- Position: [1,12]
+- Input: Fall
+-- Position: [1,12]
+- Knob: LogExp
+-- Position: [1,12]
+- Output: EndOfRise
+- Output: EndOfCycle
+- Output: OutputPositive
+- Output: OutputInverted

+ 21 - 0
module_lib/wmd_modbox.module

@@ -0,0 +1,21 @@
+Manufacturer: WMD
+Module: ModBox
+Rev: 1
+- Input: CV
+- Input: SkewCV
+- Input: SHTrig
+- Input: SkShpCV
+- Input: SmplIn
+- Input: Sync
+- Knob: Rate
+- Position: [1,12]
+- Knob: SkewRate
+- Position: [1,12]
+- Knob: SkewShape
+- Position: [1,12]
+- Output: 0
+- Output: 120
+- Output: 240
+- Output: Skew
+- Output: Noise
+- Output: SH

+ 8 - 8
module_lib/wmd_quad_atten.module

@@ -1,14 +1,14 @@
 Manufacturer: WMD
 Module: QuadAtten
 Rev: 1
-- Input: 1
-- Input: 2
-- Input: 3
-- Input: 4
-- Output: 1
-- Output: 2
-- Output: 3
-- Output: 4
+- Input: Input1
+- Input: Input2
+- Input: Input3
+- Input: Input4
+- Output: Output1
+- Output: Output2
+- Output: Output3
+- Output: Output4
 - Knob: Knob1
 -- Position: [1,12]
 - Knob: Knob2

+ 28 - 0
patches/self_ref.modmark

@@ -1 +1,29 @@
+# This patch is a self referential patch
+# and is provided as an example of a "non-trivial"
+# patch
+Title: Bells and Bongos
+
+import Module::MakeNoise::Wogglebug
+import Module::MakeNoise::Tempi
+import Module::WMD::QuadAtten
+import Module::WMD::ModBox
+import Module::WMD::Ultrafold
+import Module::MakeNoise::Maths
+import Module::MakeNoise::Function
+import Module::Doepfer::PrecisionAdderA1852
+import Module::Doepfer::QZVCOA1104
+import Module::Doepfer::QNTA156
+
+set Function.Cycle = 1
+connect Function.OutputPositive QuadAtten.Input1
+set QuadAtten.Knob1 = 3
+set PrecisionAdderA1852.Switch1 = 1
+connect QuadAtten.Output1 PrecisionAdderA1852.Input1
+
+
+connect PrecisionAdderA1852.Output1 QNTA156.CVIn2
+
+connect Wogglebug.IntClk Tempi.Tempo
+connect Wogglebug.Burst Tempi.ModGate
+connect Tempi.Ch1 QNTA156.TrigIn2
 

+ 6 - 6
pl_proto.pl

@@ -248,7 +248,7 @@ my %PARSE_RULES = (
 			$AST{'Sets'}->{$mod_to_set}->{$attr_to_set} = \%set_params;
 		};
 
-		if ( $set_line =~ m/(^[A-Z]{1}[A-Za-z]{1,})\.{1}([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
+		if ( $set_line =~ m/(^[A-Z]{1}[A-Za-z0-9]{1,})\.{1}([A-Za-z0-9]{1,})\ \=\ (.*)$/ ) {
 			$mod_to_set = $1;
 			$attr_to_set = $2;
 			$value = $3;
@@ -361,7 +361,7 @@ sub line_parse($) {
 }
 
 # For testing module definitions
-if ( $ARGV[1] eq "--import-test" ) {
+if ( defined $ARGV[1] && $ARGV[1] eq "--import-test" ) {
 	my $mod_ref = parse_module_file($src_content);
 	print Dumper $mod_ref;
 	exit 0;
@@ -430,8 +430,8 @@ sub module_node_constructor($$) {
 		my $conn_ref = $AST{'Connections'};
 		foreach my $conn ( keys %{$conn_ref} ) {
 			if ($$mod_ref{'Module'} eq $$conn_ref{$conn}->{'Output_Module'} ) {
-				my $name = "cluster" . "_" . "$$conn_ref{$conn}->{'Output_Port'}";
-				my $label = "$$conn_ref{$conn}->{'Output_Port'}";
+				my $name = "cluster" . "_" . "$$conn_ref{$conn}->{'Output_Port'}_$conn";
+				my $label = "$$conn_ref{$conn}->{'Output_Port'}_$conn";
 				$graph->push_subgraph(
 					name => $name,
 					graph => {label => $label},
@@ -440,8 +440,8 @@ sub module_node_constructor($$) {
 				$graph->add_node(name => "$$conn_ref{$conn}->{'Output_Port'}");
 				$graph->pop_subgraph;
 			} elsif ($$mod_ref{'Module'} eq $$conn_ref{$conn}->{'Input_Module'} ) {
-				my $name = "cluster" . "_" . "$$conn_ref{$conn}->{'Input_Mod_Dst'}";
-				my $label = "$$conn_ref{$conn}->{'Input_Mod_Dst'}";
+				my $name = "cluster" . "_" . "$$conn_ref{$conn}->{'Input_Mod_Dst'}_$conn";
+				my $label = "$$conn_ref{$conn}->{'Input_Mod_Dst'}_$conn";
 				$graph->push_subgraph(
 					name => $name,
 					graph => {label => $label},