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!
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.
I see there is a method to check if a variable is an array, but I don't see something similar to check if a variable is a string.
Is there a method for that?
If not, is there a method to check if a variable is an integer?
I would like to make an inline function that can accept either an integer or a string as one of the arguments, but they need separate handling inside the inline function.
@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..]
Now I'm trying to make an inline function to rotate a path:
inline function rotatePath(path, angle)
But the problem I am running into is that I cannot find any way to "unpack" the path coordinates to apply transformations to them.
Javascript has path.getPoints(), but I see no analog in HISE.
@orange Thank you, but that rotates the canvas, not the path itself, and as I mentioned above I need to rotate the path itself in order to get the "hit zone" for mouse events in the mouse callbacks (using path.contains()).
It would make a few things simpler over here if there is a method for path rotation, but I don't see anything in the docs which matches that description (such as "transform").
Is the only way to rotate by doing the trig on my original path? Just wondering if there is something more convenient.
I do know that I can rotate the canvas, but I need the actual path to rotate so I can use path.contains() for mouse callbacks.
@ustk Oh that makes sense! And that method is a lot easier than what I was doing.
I have a path here and I am trying to detect the mouse events inside the bounds of the path with path.contains():
UpArrowPanel.setMouseCallback(function(event)
{
var inBounds = arrowPath.contains([event.x, event.y]);
// Handle hover state
if (event.hover)
inBounds ? isHovered = true : isHovered = false;
etc..
But the detection I am getting is clearly off from the actual path:
Here is a snippet of the arrow path with paint routine and mouse callback:
HiseSnippet 1459.3ocsW0uaaaCDmJMpa1acaEXO.D4ujaxbscSZRVvPa9bMXMoF0oECnnnflhxhnxjBjzw0qnOY6kZuAaGojrk+HNoFXFvIl2we2c7ti2crsRRYZsTg7pd0nTFx6686LRXhONlvEnyOA48C9WPzFlBmQ5nQoDslEh77t2uaI3UYcj6y+7riHIDAkMgDB8VImxdIuO2LgZ6m+G7jjyHgrq38Ks6se94To3XYhb.XO2yuAJkP+HoG6Rhcaq4idAQGi7djOkt89r8hZsaiV6y1Ib6tsZ1fzpw96uKirSCZ28YjVQcoMPd2+zPtQp5XHFlFD5QxvQchkCEYJ3sbMuaBytnIpCn4Lxnii4IgsKbNZDxa81SbU2KyU8y9WvC4ioOwk8SNF3IHJ6z7VaYlTyuBSxqjIsdlI8P+NTEO0Lgi0d9N+yEPDLh.wlxlR1dQq82U7OVB6PXp2m7Q1YJXwXDAMa0XKL7mZGTsJDezF7aROTojCaSDrD7ugKvRBCcjB1n7F1XK71MreA7koWWyLAaLjGZh23FYGy38hM2LeRRhb3wve6BYJZXeabXRBdBgI1LwhrCkjv.Kt4A3G+Xb1J3LBQCbD7Uwz7+hK5gMwrL.kA2lXhKcZoJFD.sDCrZ4ZhBy0uPdMSwBgsEQRzrCxI2FjrtL4pbQBW.JeffZ3RANSZGVnmfZU+bUL7YrlqSSXDkSUV5IRv3wZ6YoE9QkNctS1UJNQzCNbN2aI.FKfcWBfLGdIDCADOcd.ulQMKVEw2fMMAQtNbX.FuJJBhkNednhLz5+6NBGzDR5p4BKTlMWzRmHBwFINUwtFngoI7zTfdIsS+jU86f2DhwkIOpD4BEC2.UPrETcwo2vSmwq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do you prefer to save your projects?
@d-healey said in A bizarre incident::
@VirtualVirgin said in A bizarre incident::
The project opened
.hip or .xml?
.hip
A bizarre incident:
I was working on a project which was compiling fine with no errors.
I had to close the project to work on some others, and later I reopened it.
It would crash trying to load every time.
The other projects do not contain any shared scripts with the one in question here (so there is no editing that would be done there which would effect the project that is crashing).
After trying to swap out a few of the .js external scripts and failing to get the project to open (just in case I left something in one of them which could cause an issue),
I then renamed the "Scripts" folder to "**Scripts" in order to try opening the project without any of the .js scripts attached (thinking HISE would not "see" any scripts). Well guess what? The project opened without any errors and was fully functional!
I checked the the project folder and the "**Scripts" folder was now gone and replaced with a "Scripts" folder.
So I am scratching my head as to what happened. HISE found my "**Scripts" folder and renamed it? And somehow that made it able to load without crashing? Very confused.
If anyone has a hypothesis, I'd love to hear it!