-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Iain Duncan
committed
Apr 30, 2020
1 parent
638237b
commit 018a2c7
Showing
7 changed files
with
105 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
Notes on buffer and table io | ||
|
||
(define my-table (table 'foo')) | ||
- returns a table object named foo or false if not found | ||
|
||
(table-set! 'table 1 99) | ||
- sets table index 1 to 99 | ||
|
||
(table-set! table-obj 1 99) | ||
- as above | ||
|
||
(my-table 1 99) | ||
- writes to table | ||
|
||
(my-table 4) | ||
- returns value at 4, or #f if not in table | ||
|
||
what would a table object look like? | ||
|
||
(define table (lambda args | ||
(( | ||
(cond | ||
|
||
the table object needs to be a function that accepts either | ||
(my-table index) -> returns value or #f | ||
(my-table index int-val) -> writes int-value to index | ||
(my-table index seq) -> copies values from seq to the table | ||
maybe? (my-table index int-points dest-seq) -> copies int-points values from index to dest-seq | ||
|
||
- probably at a low level the various conditions need to go to functions | ||
defined in C | ||
(cond | ||
( ( (= 0 (length args)) && (int? (args 0)) ) (s4m-table-read table-name index value) | ||
|
||
- table objects in C, are they held with a registry somehow?? | ||
- no, in C we need to use the name on each call, so the table object can just store the name | ||
|
||
|
||
(table 'table-name) -> returns a function object for the table, that has stored the table name in a closure | ||
|
||
|
||
(define (table name) | ||
(let (table-name name) | ||
;; returns a function that takes variable number of args | ||
(lambda args | ||
(cond | ||
( (and (= 1 (length args)) (int? (args 0))) | ||
(table-ref table-name (args 0))) | ||
( (and (= 2 (length args)) (int? (args 0)) (int? (args 1))) | ||
(table-set! table-name (args 0) (args 1))) | ||
( (and | ||
|
||
- other things that would be useful: later | ||
(table->vector 'table-name) -> returns an s7 vector | ||
(vector->table vector 'table-name) -> create or load an s7 table from a vector | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
Notes on thispatcher functionality in s4m | ||
|
||
- I'm pretty sure that the object we get from the call below gives us the same thing as we get from a thispatcher object | ||
|
||
object_obex_lookup(x, gensym("#P"), &mypatcher); | ||
|
||
- let's try sending it some messages? | ||
|
||
- maybe a function that is the equiv of send to this patcher? | ||
(send-this ) | ||
|
||
- what is a test message we can use?? | ||
|
||
this works for making objects from the SDK, so we should just hook it up to scheme | ||
and allow a property list in scheme | ||
(new-max-obj (list :maxclass 'toggle :varname 'foobar) ) | ||
|
||
.. which will then go to: | ||
.. could be a problem that patching position takes two values, maybe switch that to x y? | ||
|
||
t_object *toggle = newobject_sprintf(x->patcher, "@maxclass toggle @varname foo @patching_position %.2f %.2f", 10, 10); | ||
|
||
|
||
DONE: | ||
- added new instance var, x->patcher with the thing we think is thispatcher | ||
- figured out that sending object_method_typed with the script messages does not work | ||
(would probably have to make a this patcher object) | ||
|
||
|
||
|
||
(new-max-obj :maxclass foo :patching-position '(10 10) | ||
|
||
(connect-max-obj obj-1 outlet obj-2 inlet) | ||
|
||
- question, who calls who here? | ||
|
||
(define (new-max-obj properties) | ||
- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cm/loop.scm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
cm/utilities.scm |