Skip to content

Releases: cmajor-lang/cmajor

1.0.3096

07 Jan 06:20

Choose a tag to compare

1.0.3096 Pre-release
Pre-release

Bug fixes

The midi handling for 2 byte midi messages within our runtime was wrong, which lead to the inability for Cmajor to process Pressure (channel aftertouch) messages correctly. This has been respolved

The JUCE project builder now includes the PLUGIN_NAME attribute

1.0.3066

23 Nov 10:06

Choose a tag to compare

Improved claude integration

There has been ongoing work on updating the claude.md file, and improving documentation so as to support 'vibe coding' of Cmajor plugins. An example, Claude/FilterEQ has been added which was generated via prompting, including a functional UI. Further work is planned to make such code easier to generate, and to improve our documentating and prompting so as to improve the quality of the generated plugin code.

Updated ## global test option

The code has been reworked to support a list of files to import, and fixes an issue with test update incorrectly writing the ## global test entry

C++ code generation changes

The generated C++ now throws std::runtime_error to deal with exception cases rather than the previous assert codepath. This allows these situations to be captured in the wrapping code rather than triggering something more catastrophic.

The command line tool now allows maxFrequency to be specified when generating C++.

The command line tool now has support for windows C++ code testing - we previously supported llvm and webview via the --engine parameter, and now with C++ support, all backends can be validated in CI using this mechanism. There is support for specifying platform specific compiler options.

Bug fixes

Resolved a problem when running with Apple devices in continuity mode (e.g. using an iPhone microphone from) which would cause a runtime error.

Better support for lossy comparisons when running tests cases for event and value endpoint result

Fixed a regression where the patch loader plugin did not correctly report errors when a patch failed to compile

Fixed a problem which disabled windows midi support.

Support for multiple linux webkit versions when building.

Resolved a rounding problem that could cause integer parameters to be incorrectly populated via a drop down value list in the default UI

1.0.2944

29 Jul 09:27

Choose a tag to compare

As part of this release, LLVM has been updated to v20, and CHOC has been updated to the latest release. The CHOC update changes the directory paths, so if a dependent project has build issues, please check the paths for CHOC to ensure these are correct.

Mutable slices

The support for mutable slices has improved, and we now support writing to the entire slice, a range of the slice, or an individual slice element:

    int[] a = (0, 0, 0, 0, 0);      // a is an array of type int[5]
    int[] b = a;                    // b is a writeable slice, referencing a

    b = 1;                          // a now contains (1, 1, 1, 1, 1)
    b[1:4] = 2;                     // a now contains (1, 2, 2, 2, 1)
    b[2] = 3;                       // a now contains (1, 2, 3, 2, 1)

We are still actively working on the writeable slice support, so expect further work in this area in the next release.

Refactored audio code

The audio code that the command line tool (and VSCode tool) uses has been updated to resolve some issues around input and output sample rates, which produced unsupported configurations.

Updated ## global test option

The ## global test option can now take an optional file or directory as part of the global Cmajor codebase when running tests. For example

## global ("library.cmajor")

This will include the contents of the library.cmajor file within the test context, so tests can be written against this library

Other Updates

Cmajor version is now included in the plugin loader 'drag and drop' message

JUCE exporter now populates the PRODUCT_NAME field in the juce_add_plugin function call

Bug fixes

Resolve an issue where built JUCE projects may incorrectly fail to initialse their event loops
Resolve a problem where some casts of bounded types would fail if the source was constant
Updated choc message loop to avoid an initialisation issue that could trigger a hang
Resolves an issue where a patch with a warning would fail to run, and just display the warning. This has been changed to report the warning to the console or to the VSCode panel

1.0.2829

22 Apr 09:25

Choose a tag to compare

This release includes various bug fixes, and some incremental changes to the language, and resolves various problems around vector support.

Mutable slices and slice constness

We have implemented mutable slices, that is, the ability to modify the underlying array via a slice. The existing slice syntax is now implicitly mutable, so it is a requirement that if a slice of a constant array is created, it must now be marked as const:

int getElement (int[] a, int i)
{
    return a[i];
}

bool test()
{
    let a = int[3](1, 2, 3);
    return getElement (a, 1) == 2;      // error: Cannot pass a const value as a mutable slice
}

The getElement function would need to be updated to:

int getElement (const int[] a, int i)
{
    return a[i];
}

This is an early release of this feature, so we'd be interested in any feedback, especially odd error reporting and bug reports related to this feature.

Improved compilation optimisation

There have been various improvements to the JIT compiler, which lead to more automatic vectorisation, and automatic loop unrolling. These updates may increase compile time, but will increase the runtime performance of the generated code.

Slices of slices

It is now possible to take a slice of a slice - previously we were not able to pass a slice to a function, and return part of this slice. Slice indexes must still be static, and are currently readonly. Further work will be made to relax these constraints further.

std::convolution

We now have convolution support in the std library. These include time domain and frequency domain implementations, including a zero latency convolution algorithm. The library supports multi-channel impulses.

New examples

There is a demo of convolution using a reverb, and a new synth (TX81Z).

Bug fixes

Resolved an issue related to vector<1> in the C++ code generator.
Resolved an issue where a wrap loop counter could be updated and lead to invalid loop repetitions
Fixed some intrinsic functions which previously accepted invalid data types leading to confusing error messages
Resolved an issue which could lead to hoisted endpoints having an invalid endpoint type, leading to invalid compile errors
Stopped the compiler incorrectly recompiling the patch when only UI components have been updated
Fixed C++ code generation related to some vector operations (|, &, >>, <<, >>>>>)
Resolved a problem with endpoint annotations merging incorrectly
Fixed a bug in the NoteToMidi helper
Fixed a bug in inplace operators which could lead to incorrect index operations
Fixed an issue which could cause out of range indexes for wrap types for powers of 2

1.0.2724

01 Nov 07:30

Choose a tag to compare

Web Audio Module support

There is now an additional genererator option, wam which supports building a web audio module. This is a web audio plugin standard, see https://www.webaudiomodules.com/ for details.

Improved endpoint hoisting support for renaming

Previously, it was possible to rename a hoisted endpoint by providing a new name. This support has been extended to provide a wildcard name which allows multiple endpoints to be hoisted and renamed.

graph Test
{
    input child.in child_in;       // Specifies hoisting child input in, but renamed to child_in
    output child.* child_*;        // Hoists child.out and child.gain as child_out and child_gain

    node child = Child;
}

graph Child
{
    input stream float in;
    output stream float out;
    output stream float gain;
}

Bug fixes

Fixed the bundled windows LLVM libraries for static runtime.

Fixed an issue where graph connections could incorrectly trigger a duplicate node error.

Fixed a bug where constant ifs were not being handled correctly within parameterised namespaces which could lead to incorrect compile errors.

Resolved an issue on linux that was causing some WebView components to not load correctly.

Improved the performance of some value classes which could cause long load times for patches with many endpoints.

Fixed a problem where wrap types could sometimes be left by the compiler and cause code generation to fail.

Fixed inplace operators which caused problems when compiling to wasm.

Improved performance of the compiler by simplifying the state size calculation logic.

Fixed an issue with unused intermediate processors when hoisting endpoints that could cause compilation failure.

1.0.2656

27 Sep 18:04

Choose a tag to compare

SubtractOne example

The examples folder now includes a plugin with a UI build using React.

Improved error reporting from the C++ backend

In some situations, the C++ backend did not correctly report errors. This lead to an apparent successful run, but no C++ output for the patch. This has been resolved, and the backend now correctly reports the error.

Bug fixes

Fixed an issue which caused patch workers to often hang on windows, due to a race condition in the initialiser.

Oversanpled nodes now correctly handle forwarding for event array endpoints.

Ensured that the C++ backend casts ints correctly to resolve possible issues with function overloading.

Resolved issue where the plugin was not running correctly on some windows hosts.

Resolved an issue where the clap wrapper had problems with mono endpoints.

Linux plugin wrapper now builds correctly.

Resolved a problem with patches using floating point modulo not running with wasm.

1.0.2616

15 Aug 14:14

Choose a tag to compare

This release includes various updates related to the audio runtime and midi classes

API Updates

The API has been updated to return result codes from various methods on the Performer. The result indicates success, or specific error conditions. Previously these conditions would trigger an assert within the implementation, which was unhelpful when considering wrapping the library into other languages.

Updated LLVM

LLVM has been updated to version 18, which brings some performance benefits when running with the JIT.

Added SourceTransformer

A new beta capability has been added which allows a patch to modify source code before compilation. This can be used to inject user generated source code into a patch, or to transform source code in other ways. An example,FaustFM is included in the examples which uses both Faust and Cmajor source code, and uses a Faust to Cmajor transpiler to allow support mixing source within one patch, using a wasm build of the Faust compiler suite to transpile.

This feature is new and the API is likely to change over time as it stabilises, so expect some churn if you use this feature.

Bug fixes

There were issues in the previous release which caused compilation failures when using certain intrinsic functions. This has been resolved

Resolved a compile error related to unresolved types triggering errors when checking function return types

Resolved a problem when returning void events from a patch, which previously returned the incorrect type

1.0.2562

19 Jun 04:44

Choose a tag to compare

This release includes a major rewrite of how the application discovers audio and midi devices, removing the dependency on JUCE. The library and application builds of Cmajor do not use JUCE, although the project is capable of generating a JUCE project as an export target.

The Cmajor plugin is however a JUCE project. If building from source, the plugin is not built by default, and the -DBULD_PLUGIN=ON option must be specified to cmake. If the plugin is being built, a path to JUCE must be specified using -DJUCE_DIR=... option

General code tidy up

We have found that some uses of the library with stricter warnings enabled lead to warnings about unreachable statements, and issues around const char * conventions for string literals. We've resolved these issues, and updated our build settings to catch regressions in this area in future.

Drop binaryen support

The codebase had two ways of generating web assembly - via the LLVM backend, or using a custom web assembly generator. The LLVM backend produced superior code, but there were concerns the library would be too large to support Cmajor JIT in the browser. We have now completed this work, and determined that the LLVM backend is suitable for browser based compilation, and so have removed the custom web assembly generator.

Various CLAP export changes

The CLAP exporter now defaults to using a webview for the patch worker. In addition, the exporter now uses bigobj on windows platforms.

Updates for the default GUI to support non-linear parameter scaling

Parameters can now specify a mid value in their annotations. This specifies the value of the parameter in the central position of the knob. The default knob value is now scaled in a power series so that it passes through the mid value at the middle of it's travel. If no mid value is specified, the knob defaults ot the previous linear behaviour.

Changed type rules around wrap<> and clamp<> types

Previously, wrap and clamp types could not automatically converted to float, unlike int. This lead to some confusion when migrating algorithms from int to wrap. This change will mean some situations where previously an explicit cast was required is no longer needed.

Bug Fixes

Resolved a problem with the new audio interface failing to update the sample rate correctly

Resolved a problem where certain data types were not being correctly transformed into and out of the runtime. This mainly affected the C++ translation (JUCE plugin builds for example). Issues were fixed related to bool vectors with the JIT backend, and with void events with web assembly.

Solved a problem where output midi events were not being correctly timestamped when running with large block sizes within a plugin context.

1.0.2462

24 Apr 14:54

Choose a tag to compare

This release has various improvements to the web assembly generation, and how webaudio is supported.

SIMD support for wasm generator

The wasm generator now supports SIMD code generation, which gives significantly improved performance on wasm runtimes which support this. By default, the wasm generator generates both SIMD and non-SIMD code and switches between them based on whether the platform includes support. The generator has options to switch between this default and --no-simd and --simd-only modes for situations where the benefits of smaller generated files outweights the performance and compatibility benefits of supporting both.

Changes to the patch connection object to avoid javascript imports

The javascript helper classes have been refactored and are now provided via the patchConnection. The avoids the need to import cmaj_api files, as they are available via the patchConnection.

Updated patch worker runtime

The patch worker by default now runs using the native webview on the host. It can optionally be switched back to using the previous quickjs javascript interpreter, by adding --worker=quickjs as an option.

Added reset() method to the Performer API

We've added the ability to reset a Performer to the initial state. Previously a performer could not be reset and would have to be deleted and replaced with a new instance if a reset was required.

Bug Fixes

Various performance issues were identified which were triggered by having a large number of graph nodes. The fixes introduced improved algorithms and a reduction in the compilation time for these graph structures.

wasm output will now be correctly displayed when using the --debug option from the command line.

Some confusing error messages have been fixed which gave incorrect endpoint types in some error messages.

The on-screen keyboard now correctly ignores key modifiers (e.g. control) which could cause hanging notes on some platforms

modifications to the source code of a patch were no longer triggering reload of the patch - this was disabled inadvertently, and has been re-enabled in this release.

Resolved an issue which caused the --dry-run mode to fail.

Fixed an issue where the JIT plugin did not correctly restore state in some situations.

Fixed a conditional connection issue which could trigger a compilation failure when unused nodes were removed.

Fixed a problem with the JUCEPlugin helper which caused the patch to fail to reload in some situations.

Fixed a problem with hoisted endpoint arrays which lead to a failure to compile

1.0.2397

17 Mar 11:18

Choose a tag to compare

This release includes many new example projects, including Pro54 - a Cmajor implementation of the Pro53 synthesiser, showcasing how to build instruments and web GUIs using the runtime.

Code refactoring

Some of the helper functions have been refactored, especially in the clap plugin. We have also resolved some issues with warnings from more modern compiler suites, and fixed warnings when more stringent warnings are enabled in the compiler.

Pro54 improvements

We have fixed the GUI to correctly show the HPF mode on the GUI - it previously indicated this was a bandpass mode.

The program state saving wasn't implemented correctly, so restoring state when built as a VST plugin was incorrect. This should now function correctly.

CmajPlugin updates

The plugin was incorrectly storing it's state, and hence was unable to restore the plugin when reloading a saved DAW project.

Bug Fixes

The processor.id allocation strategy has been updated, so that all instances of a processor array are given unique ids, so now all processor instances in the graph have unique ids.

The load and link times in test output were being incorrectly calculcated, this has been fixed.