I just wanted to make a note on how helpful David Healey is in this community, and that his tireless efforts to upgrade everyone’s knowledge are noticed and appreciated!
Thank you, David :)
Happy New Year!
I just wanted to make a note on how helpful David Healey is in this community, and that his tireless efforts to upgrade everyone’s knowledge are noticed and appreciated!
Thank you, David :)
Happy New Year!
Christoph,
First off, I would like to thank you for this amazing development tool for music :)
I am quite happy to be taking the plunge and learning as much about coding in HISE every day since watching and following the David Healey tutorial video: "How to make a synth"
Now, my main goals with HISE involve making MIDI plugins; some to be released as free utilities, and others as a paid product.
In my tests it seems that HISE does not receive or pass (thru) some MIDI message types:
MIDI clock
MTC
MMC
SysEx
etc.
Then there is Program Change, which HISE can accept and use, but not generate or pass (thru).
My concern:
When using HISE to make MIDI plugins, blocking these messages may deny users access to certain features that are needed for the next plugin in the chain (often a VSTi).
Therefore, if I am to produce MIDI plugins I am apprehensive about blocking those messages, and I, myself as a MIDI plugin customer would not be happy if a plugin that I purchased were to deny the passage of those messages to the output stage.
Personally, I do a lot of orchestral template mockups in a system where the articulation switching of VSTis is managed by expression maps (in Dorico, Nuendo, Bidule and Reaper) which are changed via incoming program change messages. Currently, I can't actually use any of my HISE produced MIDI plugins within this system, as without PC messages, it blocks the articulation switching.
In addition, there are many VSTis that can utilize program change messages directly to change patches. Kontakt, Omnisphere and VSL for starters.
And from my observation, it seems that many electronic producers with outboard gear setups require MTC (MIDI time code) and/or MIDI clock to sync devices.
I also have use-cases for plugin designs involving MIDI clock, MTC and SysEx and would love to have access to them for making custom MIDI controller managers.
Given that, I would like to add a feature request of three different levels (sorted from lowest to highest complexity):
Thanks for your time,
Craig
@clevername27 Thank you very much for your time!
You have a lot of incite to provide and I found the instruction as well as conversation to be quite worthwhile. I would certainly sign up again for more!
@d-healey said in HISE Meet Up:
@HISEnberg said in HISE Meet Up:
I don't think you could do spectral morphing in realtime
https://www.zynaptiq.com/morph/
https://web.archive.org/web/20180705061655/http://www.hakenaudio.com/RealTimeMorph/
I find the Kyma to be rather convincing for smooth morphing:
I would love to hear this kind of thing used to interpolate between sample sets for articulations that have capabilities for continuous control of timbre:
bow position, fluttertongue, growl, stick position on percussion etc.
There are a few different algorithms to choose from for morphing on the Kyma, and I don't know the details, but I think these are precomputed FFTs for resynthesis.
I am not sure what is causing this, but sometimes when I open a project/preset I am not getting any MIDI input and when I check the settings the MIDI inputs have been turned off:
Whereas I am certain I have saved it like this:
Yes, you can send MIDI out from button clicks.
I am working on a series of MIDI plugins at the moment.
You need to enable MIDI out in settings:
When using UI components to generate MIDI notes, you need to use Synth.addNoteOn() and Synth.addNoteOff() on the callback to you component.
Here I have pads (made with panels) which play chords when you use a mouse click.
It turns the notes off when the mouse is up.
// mouse callbacks for the pads --
pad.setMouseCallback(function[unitSize](event)
{
var ps = this.data.pitchSet;
var l = ps.length;
if (event.clicked)
{
var velocity = Math.round(event.y / unitSize * 127);
for (k = 0; k < l; k++)
Synth.addNoteOn(1, ps[k], velocity, 0);
}
if (event.mouseUp)
{
for (k = 0; k < l; k++)
Synth.addNoteOff(1, ps[k], 0);
}
});
To get the MIDI to output from the plugin,
as others have said you must use Message.sendToMidiOut();
To make sure it catches everything (and not some intermediate stage of MIDI),
I always place these functions in a script processor and container after all of my other containers:
And place the Message.sendToMidiOut() on each of the three MIDI callbacks:
@HISEnberg said in Let’s Build the “League of Newbies”:
@HISEnberg Done, I created the group chat. I guess anyone else who is interested can post here and we can add them in.
Add me :)
I'll check it out.
@d-healey It needs both ceil and floor to work, so I wrote an inline function to do the job:
inline function roundFix(value)
{
local remainder = Math.fmod(value, 1.0);
local roundedValue;
remainder >= 0.5 ? roundedValue = Math.ceil(value) : roundedValue = Math.floor(value);
return roundedValue;
};
const testRound = roundFix(4.49);
Console.print("test round: " + testRound);
const testRound1 = roundFix(4.5);
Console.print("test round: " + testRound1);
@d-healey said in Is there a method to rotate a path?:
@VirtualVirgin Instead of making a function to rotate a path, why not make a function to create a rotated path. You can pass in the data you would have used to create the initial path.
So based on your suggestion I came up with this and it seems to work:
inline function createRotatedPath(pathArray, angle, area)
{
local rad = Math.toRadians(angle);
local cosA = Math.cos(rad);
local sinA = Math.sin(rad);
local path = Content.createPath();
local rotationCenterX = area[0] + (area[2] * 0.5);
local rotationCenterY = area[1] + (area[3] * 0.5);
for (i = 0; i < pathArray.length; i++)
{
local x = pathArray[i][0];
local y = pathArray[i][1];
local newX = (x - rotationCenterX) * cosA - (y - rotationCenterY) * sinA + rotationCenterX;
local newY = (x - rotationCenterX) * sinA + (y - rotationCenterY) * cosA + rotationCenterY;
if (i == 0)
path.startNewSubPath(newX, newY);
else
path.lineTo(newX, newY);
}
path.closeSubPath();
return path;
}
The pathArray is a 2D array of x,y points
i.e.
[[x,y],[x,y] etc..]
@d-healey I'm imagining that you answered that question before I even submitted it! Lightning fast response.
@d-healey said in I seem to have forgotten how to implement LAF on a label:
@VirtualVirgin Labels don't have laf. You need to draw it on the panel behind the label - or just use a panel.
@VirtualVirgin said in I seem to have forgotten how to implement LAF on a label:
but I do not see a reference to find what names to use.
The autocomplete popup contains a full list.
These should probably be removed from the Docs then:
Also, maybe I don't know how to use the autocomplete in the way you are referring to it, but it don't get anything when typing in the name argument in the script:
This isn't drawing the look and feel:
// create the search bar
const var searchBar = Content.addLabel("searchBar", 10, 10);
searchBar.set("width", 250);
searchBar.set("height", 30);
searchBar.set("text", "Search...");
searchBar.set("editable", true);
// laf
const laf = Content.createLocalLookAndFeel();
searchBar.setLocalLookAndFeel(laf);
laf.registerFunction("drawLabel", function(g, obj)
{
var w = obj.area[2];
var h = obj.area[3];
g.setColour(Colours.white);
g.fillRect([0, 0, w, h]);
g.setColour(Colours.grey);
g.drawRoundedRectangle([0, 0, w, h], 5, 1);
var iconSize = 12;
var cx = 10;
var cy = h / 2;
g.setColour(Colours.grey);
g.drawEllipse([cx, cy - iconSize / 2, iconSize, iconSize], 1.5);
var angle = 45 * Math.PI / 180;
var lineLength = 7;
var startX = cx + iconSize / 2 * Math.cos(angle);
var startY = cy + iconSize / 2 * Math.sin(angle);
var endX = startX + lineLength * Math.cos(angle);
var endY = startY + lineLength * Math.sin(angle);
g.drawLine(startX, endX, startY, endY, 1.5);
g.setColour(Colours.black);
g.setFont("Arial", 14);
var textOffset = 25;
g.drawAlignedText(obj.text || "", [textOffset, 0, w - textOffset - 5, h], "left");
});
I'm suspecting the name of the laf function, but I do not see a reference to find what names to use.
@d-healey
In this case I am already using Math.ceil(), Math.floor() and Math.round()
then I am only multiplying and diving by powers of 10 to get a rounded decimal:
// gives a correct return for proper round (JUCE has somehow broken the rounding math)
inline function roundFix(value)
{
local remainder = Math.fmod(value, 1.0);
local roundedValue;
remainder >= 0.5 ? roundedValue = Math.ceil(value) : roundedValue = Math.floor(value);
return Math.round(roundedValue);
};
// round to a decimal place
inline function roundToDecimal(value, decimalPlace)
{
if (decimalPlace == 0)
return roundFix(value);
local multiplicationFactor = Math.pow(10, decimalPlace);
local multipliedValue = value * multiplicationFactor;
local roundedMultipliedValue = roundFix(multipliedValue);
local result = roundedMultipliedValue / multiplicationFactor;
return result;
};
// test decimal rounding
const decimalRoundTest = roundToDecimal(78.678, 2);
Console.print("decimalRoundTest: " + decimalRoundTest);
I can't use Math.ceil(), Math.floor() and Math.round() on the end return value because I need it to keep the decimal places.
If I use Engine.doubleToString() then I don't see a way to get the value back. If I use .getIntValue() I lose the decimal places.
Occasionally I am getting values like this when doing math:
How can I limit this to a decimal place?
@Christoph-Hart said in Loading functions stored in an array from a JSON file is coming up "undefined":
define your functions in a Javascript object in your script and then just store the function name in the JSON that you export.
Thanks! I got it working now :)
@Christoph-Hart said in Loading functions stored in an array from a JSON file is coming up "undefined":
@VirtualVirgin you can‘t serialize a function, JSON is a data only format.
Thanks, although I don't quite understand the premise.
If the functions as code appear in the JSON file that was dumped, how does that same code not appear when the JSON is loaded?
Is it changing format somehow?
Conceptually I'm just behind.
If I store the functions as const variables in an external .js file, then put those const variable references inside my array in the JSON file, would that then load correctly?
@clevername27 said in Best Way to Implement This?:
@VirtualVirgin I appreciate the enthusiasm. When I do take the wraps off, I'm following @d-healey's lead, and releasing the rest of my code to the community. Let me know if there's something specific you'd like.
Thank you! When I have enough experience, I would like to contribute as well.
I made a JSON file with info that I need to use in a data table.
I am storing sort functions in an array inside the JSON.
The sort functions can be seen in the JSON itself:
When I load the JSON, all of my other data that was stored in the file will load properly,
but the sort functions just come up as "undefined":
I don't quite understand what is going on.
Ideas?
So I was able to find a way to switch out the sort functions:
// use custom sort functions for different columns
inline function sortArrayByColumn(rowData, columnIndex, comparisonFunction, sortDirection)
{
rowData.sort(function[columnIndex, comparisonFunction](a, b)
{
var colA = a["col" + columnIndex];
var colB = b["col" + columnIndex];
return comparisonFunction(colA, colB);
});
if (sortDirection)
{
return rowData;
}
else
{
rowData.reverse();
return rowData;
}
};
I store the sort functions in an array and pass them here as "comparisonFunction".
I am trying to make columns in the Viewport and Table Mode respond to visibility filtering, but I can see no way to do this as the only available methods to change the columns exist in the
dataTable.setTableColumns(columnData);
and the Docs say: "Define the columns of the table. This can only be done in the onInit callback."
If I could update this with another callback I could either add/remove columns, toggle the column width between 0 and full, or use the "Visible" bool in the definition.
But otherwise I see no way toggle visibility at runtime.
If anyone knows a way around this, please advise!