- 20 Jul, 2020 3 commits
-
-
Joel K. Pettersson authored
Part 1 of redesigning parseconv and generator as planned in 2013. Traverse graph before generator, determining which operators to use and how to use them. Not complete, the generator still using the old recursive algorithm. Simplifies some code in generator. Do a clean-up rewrite of parseconv.c, using the new arrtype (generic array) module for its simple dynamically-sized arrays. Calculate duration of script/program and include in program struct. Duration now printed with -p option. Changes include: * Use an array of operator data instances per event, instead of splitting events with several. * Fully separate voice & operator parameter flags (which were already stored separately during parse), renaming enums. Also separate the enums for voice & operator "attr" values (which were already stored separately). * Rename various types, fields, and flags in program.h. Use SGS_P* names for all voice and operator constants. * Change time types to uint32_t from int32_t, setting SGS_TIME_INF to UINT32_MAX instead of -1. (Infinite time is handled as a special value for nested operators, as of 2012-01-23. This reverses the type change from unsigned to signed done then.) * Make voice and operator IDs unsigned, replacing the use of -1 for no ID with named enums. Also replace the old symtab placeholder with the new hash table, and update label handling in the parser. Remove obsolete parser string alloc/free code (reversing a 2012-01-12 change). Script syntax: Labels can now only contain alphanumeric characters and '_'. Any other character will end and follow the label. Change log: * 2018-10-29: Complete branch merging. Further program module changes. Use partially-done redesign in generator. Further rename flags and fields. Old branch: - 2013-08-05: Redesign sketch #1 (non-working) for program & generator. - 2014-10-05: Redesign sketch #2 (still non-working) for program.c, and minor change in parser.c. - 2018-02-14: Redesign sketch #3 (non-working), adding interpreter and turning new generator version into renderer for its results. - 2018-02-16: Style change for new interpreter. - 2018-02-24: Rename program module to builder, splitting header. - 2018-07-01: Add some code to interpreter. Also change builder to count op & voice data struct instances, for one-off allocation of corresponding result structs in interpreter. - 2018-07-02: Use unsigned values for time except when negative times are needed. Also make voice and operator IDs unsigned. - 2018-07-26: Undo renaming program to builder. Simplistically assign block IDs in interpreter module. Prepare for merge with program module. - 2018-07-27: Redesign sketch #4. Turn old program module into imp (intermediate program). Turn useful code from interpreter into new program module. Unlink renderer from build. - 2018-07-29: Build list of operator references (new type) per-voice in program module. Create garr (generic array) module, use in imp & program modules. - 2018-08-21: Merge imp back into program. General round of fixes and clean-ups. Use partially-done redesign in generator. Remove leftover files with redesign sketches. - 2018-08-23: Flense redesign sketch traces from generator. * 2018-10-31: Turn old GRAPH voice parameter into SDEV flag. Correct fix in mempool.c. Give -p printout prettier heading part. Refactor parser scan code. * 2018-11-02: Minor refactoring of parser scan code. * 2019-06-07: Merge minimal redesign changes from old v0.4.0. Adjust old parser code to work without new file module, and re-do trivial clean-up. Increase version to v0.3.2. Re-add bugfix for too-long label (max index was one too high), and add debug script for too-long label. Old branch: - 2018-03-14: Fully replace old symtab code with the new, and parser clean-ups. - 2018-06-30: Change string pointer type used in symtab calls from char to void, add length args. - 2018-08-29: Minor mempool clean-up. - 2018-09-11: Refactor garr (generic array) module. - 2018-10-23: Fix mempool bug introduced with refactoring. - 2018-10-27: Rename garr to arrtype. Correct README. * 2019-06-16: Adjust parser for new v0.2.4 syntax changes. * 2019-06-30: Update -p printout details to match June syntax changes. * 2020-07-13: Merge back as intermediate change. Keep version at v0.2-beta.
-
Joel K. Pettersson authored
Script syntax changes: * Label referencing: From ":label" to "@label". * Compound value (e.g. gradual value change, arg value with subvalues): From "[...]" to "{...}". * PM modulator list prefix: Change from "p*" to "p+". (I.e., a list uses "p+[]". More fitting, as PM amounts to adding the amplitude of modulator(s) to the phase.) * Add downscaling of output amplitude by voice count by default. Using "S a" disables it. * Allow 'a' (amplitude) parameter for AM and FM modulators. (Previously disallowed within "a![]" and "f![]"/"r![]".) * Numerical expressions: Further change parsing for correctness and consistency. - Fix bug disallowing sign before a nested '(' after '('. - Fix result of several subtractions in succession. - Fix handling of '^' (to the power of) priority, truly binding it more closely than other operators. - Only allow arithmetic inside parentheses. (Previously allowed without parentheses when no whitespace separated parts of the expression.) - Only allow number sign within parentheses. (Previously '-' sign was allowed without parentheses. This frees up '-' for new future uses.) - Allow '+' as sign (not only as operator) in addition to '-'. * Multiple operator binding: From "{...}" to nesting syntax prefixed by '@', i.e. "@[...]". Todo: * Make multiple operator binding functional. (It has been a "todo" since it was added.) Wave type changes: * Make 'saw' (saw wave) increasing instead of decreasing. (Negative frequency or amplitude gives a decreasing saw.) Reorganize code: * Move parser.c, program.c, and the lexer and symtab modules to builder/, splitting out builder.c and renaming files: - parser.h -> script.h (parser output). - program.c -> parseconv.c. Place conditionally-compiled test use of lexer in builder.c. * Move generator and osc to renderer/, splitting out renderer.c from sgensys.c. * Create common module, moving the old sgensys.h contents to common.h. Add and use utility functions: - SGS_warning(), SGS_error(): now used for warnings and errors (when the format is suitable). - SGS_memdup(), SGS_strdup(): moved from parser.c. Consistent type and function naming: * Rename each "SGSType" to "SGS_Type". * For function and macro names including a type, use same (mixed) case as in type. Further clean-ups: * Use size_t for event IDs, uint32_t for operator IDs, uint16_t for voice IDs. * Rename parser struct types, flags, and functions. Name types "SGS_Script*", flags "SGS_S*". * In parser result (SGS_Script), include options set in script and script name. * Add circular reference guard for operators in generator to avoid crashes due to incompletely supported features. * Refactor generator memory handling. Also somewhat simplify memory handling in program module. * Add -p option for printing script info after loading. No longer print the program "debug info" unless -p used. Change log: * 2018-04-13: Rename parser struct types and flags. * 2018-04-18: Simplify memory management in program and generator. Implement downscaling of amplitude by voice count by default. * 2018-06-02: Undo faulty simplification in parser code, and some further renaming. Add circular reference guard for operators in generator, and some further clean-ups. * 2018-06-30: Rename types from "SGSName" to "SGS_Name". Rename corresponding functions and macros to use same (mixed) case in included type name. * 2018-09-11: Create common module, refactor warnings and errors. Move memdup from parser to common. * 2018-10-04: Further renaming of parser structs and flags. Some additional tidying. * 2018-10-15: Reorganize code, moving parser.c, program.c, and symtab to builder/. Rename program.c to parseconv.c, split out builder module. Further flag renaming in parser.c. Add -p option for printing program info. * 2018-10-16: Move lexer to builder/. Update headers, comments. Move lexer test invocation to builder.c. Complete branch merging. Split out renderer module from sgensys.c. Move audiodev, wavfile, generator, and osc to renderer/. Some code tidying. * 2018-10-17: Move audiodev and wavfile out from renderer/. Make "saw" wave increasing instead of decreasing. Replace renderer.h and builder.h with combined sgensys.h. * 2018-10-18: Enable 'a' parameter for "f!<>"/"r!<>" and "a!<>". * 2018-10-23: Change PM list syntax from "p*<>" to "p+<>". * 2018-12-25: Further changes to numerical expression parsing for correctness and consistency. Add warning for '(' without closing ')'. Remove extra linebreak from file open error. * 2019-06-05: Merge syntax changes. Increase version to v0.3.1. Clean up a few scripts. * 2019-06-13: Set version to v0.2.4. * 2019-06-16: Backport further simple syntax changes. Old branch: - 2019-02-08: Fix inconsistent indentation in a few scripts. - 2019-06-13: Three simple syntax changes. Label ref: from ":label" to "@label". Subvalues: from within "[...]" to "{...}". Mul. op.b: from within "{...}" to "@[...]". * 2019-06-30: Update -p printout details to match June syntax changes. * 2019-08-07: Move back Makefile -ffast-math portability fix. Also update unusable 'devtests/newconcept' script. Old branch: - 2019-08-06: Fix parsing when -ffast-math breaks isnan(). Only build some files with -ffast-math. * 2019-12-21: Merge 'S a' multiplier apply-to-ramp fix. * 2019-12-22: Merge composite timing fix. * 2020-02-09: num.exp. parsing: Fix result of several subtractions in succession. * 2020-07-13: Keep version at v0.2-beta.
-
Joel K. Pettersson authored
Change scope nesting syntax from "<...>" to "[...]". ('<' and '>' are now unused. "[...]" is now used both for lists of objects, and arguments with several sub-values.) Bugfixes: * Numerical expression parsing: Fix really old bug which prevented evaluation of "Y" in an expression of the form "((X)Y)". * Parsing on systems where -ffast-math breaks NAN checks: Portability requires limiting the use of -ffast-math. (Only use -ffast-math for files with float-heavy code which needs performance and ignores non-finite values.) * WAV file output: Correct byte length in header, was channel-count times too large. (Avoid double multiplication.) * 'S a' (Set amplitude multiplier): Apply multiplier to amplitude valit/ramp target, not only the normal or initial value. (This was missed a long time ago.) * Fix edge case for composite event timing, adding and checking a flag for the existence of composite follow-ons before assigning infinite time. Add -v version number, initially at v0.2-beta. Change log: * 2018-12-21: Fix two outdated scripts in devtests/. Fix really old bug in parsing of numerical expressions with nested parentheses, which prevented "Y" in an expression of the form ((X)Y) from being evaluated. * 2019-06-05: Change scope nesting syntax from "<...>" to "[...]". Add -v version, initially at v0.3.0. * 2019-06-13: Set version to v0.2.3. * 2019-06-30: Update debug printout details to match June syntax changes. * 2019-08-07: Move back Makefile -ffast-math portability fix. Also update unusable 'devtests/newconcept' script. Old branch: - 2019-08-06: Fix parsing when -ffast-math breaks isnan(). Only build some files with -ffast-math. * 2019-09-14: wavfile.c bugfix - avoid double multiplication: Correct byte length in header, was channel-count times too large. (Bug from 2012.) * 2019-12-21: Move back fix to apply 'S a' multiplier to valit/ramp target, not only initial value. * 2019-12-22: Add and check flag for composite event timing, to prevent assigning infinite time when a next composite exists. * 2020-07-13: Set version to v0.2-beta.
-
- 11 Jul, 2020 10 commits
-
-
Joel K. Pettersson authored
Change PM modulator list syntax from "p!<>" to "p*<>". Since semantics differ for PM lists vs. AM and FM lists, make this clearer in the syntax. (For PM lists, modulator amplitudes are summed, while for AM and FM lists, they are multiplied.) Split osc module into osc and wave. Wave type changes: * Add 'sha' (half-frequency absolute sine). * Add 'szh' (half-zero'd sine). * Add 'shh' (first quarter of sine). * Rename 'srs' (square root of sine) to 'ssr'. Move wave type names from parser to wave module. Reorganize example and test scripts. Move some old and useful scripts from devtests/ to examples/tests/. Rename scripts, add descriptions to some of them, modify a few, remove a few which are useless, and add more wavetype testing. Change log: * 2018-04-18: Move wave type names to osc module, add new 'sab' wave type, rename 'srs' to 'ssr'. Reorganize and update example and test scripts. * 2018-06-02: Add 'shw' and 'shr' wave types, and further LUT init code changes. * 2018-06-30: Split osc module into wave and osc. * 2018-09-12: Rename wavetypes ("sab"->"sah", "shw"->"szh", "shr"->"szhhr"). * 2018-09-27: Rename wave type 'sah'->'sha', add 'shh', comment out 'szhhr'. * 2018-09-29: Rename debug #define switches in sgensys.h. * 2018-10-16: Update headers, heading comments, for added code. Complete branch merging. * 2018-10-19: Change PM list syntax from "p!<>" to "p*<>". * 2020-07-11: Merge into current branch to provide fuller history.
-
Joel K. Pettersson authored
Support sndio and use on OpenBSD. Fixes audio on newer OpenBSD. Clean up the Linux audio code. Improve audiodev error messages. Program & parser changes: * Rework the SGSNodeList parser code into the SGSPtrList type, split out into the ptrlist module. * Return parser result in new SGSParserResult type. Add parser module method for destroying it, instead of it being implemented in program module. Add missing list clearing. * Rename voice and operator parameter flags from SGS_* to SGS_P_*. Further edit usage notice. Makefile changes: compile with -std=c99, add missing header dependencies. Change log: * 2018-02-16: Renamed voice and operator parameter flags from SGS_* to SGS_P_*. * 2018-02-19: Split out ptrarr module from parser, reworking node list code and its uses. * 2018-02-20: Makefile changes: add -Werror=implicit-function-declaration, list more header dependencies. * 2018-03-10: Change ptrarr to work more like old nodelist, re-adding case for < 2 items and needed macros. * 2018-08-23: Makefile: use -std=c99. Adjust audiodev. * 2018-09-09: Add sndio support, use on OpenBSD. Fixes audio on newer OpenBSD. Move audiodev implementation files to audiodev/. * 2018-09-11: DragonFly portability fix: On DragonFly, cannot build audiodev with _POSIX_C_SOURCE defined (needed on Linux), only define _POSIX_C_SOURCE on Linux, in audiodev.c instead of in Makefile. * 2018-09-20: Replace ptrarr with cleaned-up ptrlist. Fixes and clean-ups for parser, program, as well as some addititional tidying. * 2018-10-12: audiodev code tidying, and fix typo which broke Linux build. Some further code tidying. * 2019-04-18: Merge into current branch to provide fuller history. * 2019-04-26: Remove useless uint typedef.
-
Joel K. Pettersson authored
Use stdint.h and stdbool.h types instead of ushort, uchar, and uint (and usually int) throughout all code. Universally use 32-bit IDs and counters for voices and operators. Rework the oscillator module: * Increment phase after each sample instead of before. * Move wave type enum (SGS_WAVE_*) to osc.h, use to index array of LUTs. * Replace extra value at end of LUTs with use of bitmask. Bump LUT values from 1024 to 2048. * Correct saw wave LUT initialization off-by-one indexing error. Also improve init code for other LUTs. * Remove unused SGSOsc_RUN*() variants. Renamings, a few new macros, improved comments. * Add wave type test script, examples/test-wavetypes.sgs. Remove math.h SET_I2FV() macro (x86/x86-64 fast float-to-int rounding). Replaced with lrint()/lrintf(), which nowadays is inlined to fast code when compiling with -O > 0 and -ffast-math. This removes all inline assembly. Change audiodev and main module, retrieving and using modified sample rate when changed by the audio device. Handle resulting difference in sample rates for device and file outputs by generating audio twice if needed. Also improve audio output-related error and warning messages. Tweak usage notice. Split sgensys.h into sgensys.h (common type definitions), generator.h (new) and program.h (relevant lines moved over). Also rename some functions, do minor refactoring, improve commenting here and there. Change log: * 2017-12-03: Replace types in many cases. Quick first pass. Remove sgensys.h. Program module still largely not updated. * 2018-02-05: Replace more types. Rewrite and readd sgensys.h. Rename some functions. Minor refactoring. Improve audio output handling. Program module updated. * 2018-02-06: Oscillator module changes. Use SGS_WAVE_* enums to index LUTs. Correct saw wave LUT. Inc phase after sample instead of before. Renamings, macro clean-ups. * 2018-02-08: Undo minor changes for SGSNodeList (parser) that are better redone with a real redesign. Rename a few more functions. Tweak messages in sgensys.c. * 2018-02-09: Remove math.h inline assembly, leaving none. * 2018-02-19: Replace a ';' with a ',' in heading comments. * 2018-02-22: Extend oscillator LUTs to 4096 values from 1024. Some further renamings, init code improvements, and smaller macro improvements. Update COPYING file. (FSF link updates.) * 2018-02-23: Add examples/test-wavetypes.sgs. * 2018-03-14: Fix allocation size in generator.c. Use offsetof(), avoid allocation failure which resulted from unsigned value wrapping around upon (zero flag count - 1). * 2018-09-27: Reduce osc LUTs to 2048 values (no point in 4096 with 16-bit int and lerp). Some more osc module tidying. * 2019-04-17: Merge into current branch to provide fuller history.
-
Joel K. Pettersson authored
Disable test lexer and re-enable normal output by default, adding a #define switch in sgensys.h to switch between the old parser and the test lexer. Some clean-ups for the test lexer, symtab code, and other parts of the program. Make the test lexer handle line comment ('#'), and change its buffered reading to make multiple character ungetting possible. Portability fixes: * Makefile and linking: Correct sh syntax. Check in Makefile for three uname -s cases: - Linux - OpenBSD or NetBSD - other ("generic UNIX") Unbreaks building on FreeBSD and DragonFly. Also reorder linking CC args for portability. * ALSA: Add missing call to snd_pcm_drain(). Re-remove GNUmakefile and simply use Makefile. Change log: * 2017-11-27: Some cleanups for lexer and symtab modules. Add debug #define for hash table in symtab.c (for testing collisions). * 2018-01-21: Make lexer handle line comments ('#'). Source fix for ALSA. Correct Makefile sh syntax and reorder CC args for linking. * 2018-02-04: Fix program.c typo / memory init bug. * 2018-02-08: Only include LFLAGS addition for OpenBSD and NetBSD on those systems. Unbreaks building on FreeBSD and DragonFly. * 2018-02-12: Change buffered reading in the lexer. * 2018-02-13: Rearranging of and renamings in lexer code. Add debug #define for lexer (for silent-enough output to measure time to process file). Move debug #define switches to sgensys.h. * 2018-02-14: Disable lexer, re-enable parser and output. Insert #define switch in sgensys.h to toggle. * 2018-02-19: Replace a ';' with a ',' in heading comments. * 2018-02-22: Update COPYING file. (FSF link updates.) * 2018-05-01: Replace README with rewritten version from 04-16. Similar to newer versions, but with references to added features removed. * 2018-09-19: In program.c, remove two unused functions, and two useless conditionals, one broken. * 2018-10-25: Fix parser string matching bug (not impacting the current uses). * 2019-01-19: Complete branch merging. Correct README wording in one place. Re-remove GNUmakefile and simply use Makefile.
-
Joel K. Pettersson authored
Add quick test version of a lexer module, used in place of the parser. (Normal output is disabled.) Experimental work towards loose plans for a new scripting language and a fuller redesign. Beginning of new symbol table implementation. Implemented string pool/string interning with a simple hash table. Used by the test lexer but not integrated with the old code. Added memory pool module (mempool.c), used for string storage in the new symbol table code. It is meant for large numbers of small allocations. Internally they are stored in arrays sized after the system's memory page size. Upon destruction, everything stored is freed. Fix build on OpenBSD (and NetBSD) using conditional compilation in audiodev_oss.c and an LFLAGS addition. (Note: This broke building on DragonFly and FreeBSD, fixed in newer versions.) (The .gitignore file is replaced with that used for all old snapshots.) Change log: * 2014-09-18: First quick test version of lexer module. * 2014-09-20: Add new symtab code. Add mempool module. Second quick test version of lexer module. Replace normal output with lexer testing. Implemented string interning for symtab. * 2014-10-11: Portability fix for OSS on OpenBSD and NetBSD. * 2014-10-12: Mempool module debugged. Test hash collisions in symtab module. Third quick test version of lexer module. Add GNUmakefile with debug build options.
-
Joel K. Pettersson authored
Non-functional draft for redesigning the program module and audio generator. The idea is to traverse the voice and operator graphs before the generator, assigning block IDs for the generator audio I/O buffers before they are used. The old design limits what the generator is able to do, preventing full implementation of the existing script syntax. Buffer IDs properly pre-assigned would allow the generator to run through a flat list of what to generate, output buffers being filled and re-used as inputs in the pre-scheduled order. (The 2013 version of program.c re-added as an extra file, the extra/earlier 2014 version in the 2014 snapshot renamed.) Change log: * 2013-08-05: Redesign sketch #1 (non-working) for program & generator. * 2014-10-05: Redesign sketch #2 (still non-working) for program.c, and minor change in parser.c.
-
Joel K. Pettersson authored
Add ALSA support, splitting out system audio support from the main module to the new audiodev module. Further rework main module, expanding command-line options. Indentation style changed to tabs in new code, as well as the wavfile module. (Having planned redesigning of sgensys, the indentation style was changed to tabs for new or "clean" modules after this, while those to be rewritten or further reworked still use 2 spaces.) Moved tests/ to devtests/. (This snapshot contains the scripts missing in and readded to the last 4 snapshots.) Change log: * 2013-02-28: ALSA support added. Reworked sgensys.c. Reindented sgensys.c, audiodev and wavfile modules. * 2013-03-04: Add -c command-line option to stop after processing a script, before sound generation. Re-add tests/ as devtests/. * 2013-08-03: Add '.' to heading comments.
-
Joel K. Pettersson authored
Program module: Skip calling operator_alloc_inc() for multiple operator nodes, as used for the '{}' syntax. Fail crashlessly.
-
Joel K. Pettersson authored
Program module: Rework output event and operator allocation. Handling of nodes for multiple operator binding still missing. Sound generator: Place voice update code after operator update code, since buffer calculations take place during voice updates and may be altered by operator updates. (Originally released at Gna! as sgensys-20120401.tgz, without tests/.)
-
Joel K. Pettersson authored
Assign operator IDs after parsing rather than during, adding operator allocation code analogous to the voice allocation code for "program" construction. Parser: Also remove an unneeded scope conditional for multiple operator binding.
-
- 09 Jul, 2020 20 commits
-
-
Joel K. Pettersson authored
Output event allocation reworked, maintaining a list of all events and eliminating the counting pass for operators which was used to determine the number of events.
-
Joel K. Pettersson authored
Make SGSNodeList more elaborate and refactor parser and "program" using it. Further parser changes for the unfinished multiple operator binding feature. As-yet unused beginning of "program" code to more fully handle operator allocation. Sound generator timing fix. (Originally released at Gna! as sgensys-20120305.tgz, without tests/.)
-
Joel K. Pettersson authored
Parser fix for added, incomplete multiple operator binding feature, and minor refactoring. Copyright notices and LGPL-3.0+ info added to source files. (README.COPYRIGHT, added to this repository for earlier versions lacking this, removed with this commit.) tests/ script changes. (Taken from later working dir because tests/ missing in tarball, but no scripts dated later than 2012-02-20.)
-
Joel K. Pettersson authored
-
Joel K. Pettersson authored
Parser fixes and minor refactoring. Sound generator fix for handling of voices and panning.
-
Joel K. Pettersson authored
Parser fixes for new design and timing. Sound generator corrected, adjacency indexing was outdated (only changed elsewhere). Update remaining scripts with outdated syntax. Script files in main dir moved to "tests/".
-
Joel K. Pettersson authored
Add and use 'ti' (infinite time) for nested operators by default. Such operators play whenever their carrier(s) do. This change was deemed the best solution for allowing both carrier-linked modulator duration and, cleanly, shorter. Parser: More changes related to new design and to timing. Some script changes, including update a few with outdated syntax. Larger README update.
-
Joel K. Pettersson authored
Some parser refactoring and experimental changes. Re-enable planned operator binding '{}' syntax, change nesting syntax to '<>'. Reorder code. Fix for voice allocation. Move string copying out of symbol table, make it simply store pointer. Syntax changes: - Use '<>' to list modulators rather than '{}', as in 'a!<...>', 'f!<...>' or 'r!<...>', or 'p!<...>'. - Remove '-' syntax for PM modulators. Replaced with 'p!<...>'. - Add '{...}' for binding several operators as one object to manipulate. Used to e.g. link several carriers to one or more modulators. Update various test scripts.
-
Joel K. Pettersson authored
Allocate voices after parsing, instead of trying to track and assign voice IDs during. Merge VoiceData into EventNode. Script syntax: Rename 'b' (panning, applies to the voice) to 'P'.
-
Joel K. Pettersson authored
Undo the 2011-09-26 redesign, preserving some of the new code and further updating the parser, while postponing support for the new '{}' operator binding syntax. Improve comments for sound generator, tiny code style clean-up.
-
Joel K. Pettersson authored
Further parser changes to support new '{}' operator binding syntax. Sound generator clean-up. Improve comments.
-
Joel K. Pettersson authored
Initial work to support new '{}' syntax for binding operators together as a single object. This is to allow carrier-modulator linkages to be M:N, and not just 1:N (as in adding a list of modulators to a single carrier).
-
Joel K. Pettersson authored
Redesign parser, changing NodeData and its uses and replacing *_event(), *_voice(), *_operator() functions with restructured code. Big refactoring, breaking out various smaller nd_*() functions. Add and use NodeList type. Flesh out sound buffer counting in sound generator.
-
Joel K. Pettersson authored
Parser fixes for compound steps and numerical expression parsing. Fixes for silence ('s') and timing. Fix syntax in an outdated test script.
-
Joel K. Pettersson authored
Further parser and sound "program" changes. Actually create the graph structure and use it. Some accompanying changes to the sound generator.
-
Joel K. Pettersson authored
Redesign: Part 1 of changes to use an operator graph for each voice, each operator specifying its modulators using an adjacency list. Event data is also split into a main struct keeping track of timing, linked to accompanying voice and/or operator updates. Fills in part of the new code, but does not construct the data. See next snapshot for the completed (but not bug-free) version. Script syntax: Rename '/' (delay time) to '\'. The old meaning of '\' is scrapped, 's' (silence) providing what it did when combined with '\'.
-
Joel K. Pettersson authored
Separate parser and "program" event types. Parser now uses its own "EventNode" suitable for parsing internally, replaced in the output with a cleaned-up event struct better adapted for the sound generator. Script syntax changes: - 'W' (wave) became 'O' (operator, i.e. oscillator with attached configuration options). - 'n' (frequency as note) removed, notes may now be set to 'f'. - 'srs' (square root of sine) wave type added. - 'p!{...}' (PM modulator list) replaced by '-' (PM linking) optionally combined with '<>' (subscope), as in '<-...>'. Larger README update.
-
Joel K. Pettersson authored
Rename subvalue 's' (shape of change) to 'c' (change type). Change type values are: - 'lin' (linear) - 'exp' (exponential) - 'log' (logarithmic) 'exp' and 'log' are not truly exponential or logarithmic, respectively, but instead use polynomial approximations developed "by ear" to sound "smooth" and natural. (The real curves do not have a finite length smooth ending.) Refactor sound generator handling of parameter value buffers.
-
Joel K. Pettersson authored
Parameters can now be set to "[...]", with sub-parameters deciding how the value changes over a specific time. This provides minimal envelope support and is done ahead of adding full-fledged ADSR support in the language. Sub-parameters: - 's' (shape of change, only "l" (linear) currently done) - 't' (time to reach target value) - 'v' (target value) Supported for amplitude, frequency, and panning. Also change frequency ('f') to accept note values, both directly and for 'v' inside '[]'. (This change broke note values for 'n', which is now obsolete.)
-
Joel K. Pettersson authored
Note frequencies in C-major scale are specified using 'n'; the value is the upper-case letter of the note, optionally followed by 's' (sharp) or 'f' (flat), and then optionally the octave number. Currently, just tuning is used, with A4=444 Hz by default. 'S' parameter 'n' sets A4 tuning frequency in Hz. "Subnotes" between two notes, in an "inner octave", supported with a prefix for the value (lower case letter of note). (Subnotes, unlike notes, cannot currently be sharp nor flat.)
-
- 02 Jul, 2020 7 commits
-
-
Joel K. Pettersson authored
Use ';' as separator between timed steps for an operation. Steps in the input handled by the parser no longer always correspond to the linear order of the resulting event list. The event list is "flattened" after parsing. Rename scripts from .mgs to .sgs.
-
Joel K. Pettersson authored
Bugfixes and minor refactoring. Debug printouts added for remaining debugging. Script syntax: Added 'w' for changing wave type of operator.
-
Joel K. Pettersson authored
Redesign parser-generated "program" for sound generator. Use a sequence of "events", which are updates for the sound generator to process, constructing and maintaining its voices and operators accordingly. The thinking was first to separate the old "program nodes" into separate timed lists of "operator nodes" and "event nodes", the former specifying what is to be used and the latter how. But only "event nodes" were necessary as input. Script syntax changes: - Added 's', silent time for operator (delay before sound). - Replaced center/left/right ('C', 'L', 'R') with 'b' for panning. Removed click reduction code in sound generator. The old code does not work with this design. Not fixed because deemed not worth it. It only worked for basic wave forms (by fitting the duration of a wave to the cycle length), not for modulated waves.
-
Joel K. Pettersson authored
Parser refactoring and changes. Use per-block instead of per-sample processing for sound generation. Note click reduction code works. Note: Fixes some bugs, is the first version which "sounds" like sgensys, but also includes new bugs fixed in the 2011-04-26 version, see script3.mgs.
-
Joel K. Pettersson authored
Parser-generated program nodes used by sound generator semi-divided into operator nodes and set data nodes.
-
Joel K. Pettersson authored
Make parser and sound generator use linked lists for modulators. Change PM modulator list syntax to "p!{}" for consistency with AM and FM, and add 'p' phase setting option. Add oscillator float-to-int phase value conversion macro. Change "envelope output" version of RUN macro to have very slightly higher output value.
-
Joel K. Pettersson authored
Support AM and FM in addition to PM. Also change syntax for modulator lists; now enclosed within "{}" instead of "<>". Use "a!{}" for AM, "f!{}" or "r!{}" for FM, and "m{}" for PM. Turn 'r' into an actual ratio parameter, adding the necessary divisions. Change oscillator type to store no more than phase, making frequency and amplitude parameters. Add "envelope output" version of RUN macro.
-