Midi transpose, cents?
-
Hello guys and happy new year!!!
I'm trying to do a midi transposer including cents, but cents just jump by st instead of cents. Midi allows managing cents?
Snippet below
HiseSnippet 1361.3oc6Y0saaaCEVJ1ro1sNMcqCXWJTrA3rlFXmk00ggg3DamlfleLrRy1tpiQh1lnRjZRTd0sn2uGi8Nrc+xqxdCxavFIkrkTsbpbZSZ7PDRBDOmC4467KIUZ4RMPddTWE0BGNvAondaf9.BqW8dPLQYmFJpyCXtCzVUYyANPOOjohpZtmHXpVHuh74z02DZAIFnHRJJGQwFncw1XVD0V0dJ1xZKnI5PrcLoWq1NFTRcpE0mCjbfJJNPiW.6h1GJDaNfh5MZZhYTWcFjg7TTyuI0bfdO5uQBj+HrG9XKjXPUEc9BEPdKpko.wBpJ06gsLaMzf8TTTAshL+bAl+8.6gMwinG4FVTxPKZFw8GpycVvqZb3UIyvSIF5xGfNNHnl9VPVRjIBGgLvTRBjsCggHdX1f3gqOpv8tfVXlQuzw6bofWdf5hFugA+Rflc5fLXQfMOXqe5xMReyITFdKPcJgwGgb+PTJ5j4RQ0bumkdUttz65RuYgRuEBfxs.57pLY4mDHhIdoVwcfAC1GcnKj34P8Rrv5Ha7gThv7iH9LOzVtnessHjFmdcJzcBr1hagov3z00gLeWYtwF1TeBKQtPtLG.lhNA4un5DjKavKEHoNd8zcA5FtXGVDGAd9zPpQHJYpR.Wk49p4.7XrGSqOzUiMLv9TB83fXj1OnI5tiHrUfllB5ku+n3+8WVqB+mk99REKULkIuhGh0FR5hJ+v0d7xZheqFH7jzIWOdmoJkRv0a0GMIMKDHlhqxkkK4JUjZtiOwPjBoQI6SYnCHkWpTwWWpXg839H9w5DSTvXee6iQtkGRsaBpKo8fzbUBoNBZ4iJujPUumKozLRthkJ9lwsfNcJuTwWWrPw2DmkvA5RsrDK83bEk4tmwzJSjnZYd.hq7gxwy3RlFWLaowFAAyXBRI6PvrCbPiFGDLFRohxHiKNoHiJNUowjhXQjRo2ZXBlXWjPw4hxj0SKDV4nagM4mnAaJ56F0xS5Rh58TtlRFVfEAISfSrJ09mW8Wqq7rcZ.YPQIdH1330A4xvBOsZCTede6fB9BfFHuWvnNRva6va5J5FNelf+K4GvQU.7ACewN9dFaehM7kwFVyigbzwuBEuSrRLsBxtMKU8eLQUe5ee4c1lbYaC5TZ.mKFFuS.FmGrw1MzaGdNF46ZMI8QV73Wxlt6QITmdTB1H9lWsQLWb2tH23HNUyXCFie6y59t8Sr0aCjAbvXTCDNhxh0BnrKhCs3BtMeWvwVtQD98+rltuGKwIK94SZirPPuDmUnoAkGRPmS296XeOPFSMJABLRM4IYtZel2EFh0fHxUavdafLsXVvudGPXB6LgicAPXszUEWa307KBNh2AyPncAL+rQC0FYDUe2nkeAfCgR3Du0Ve99Zn2tmC9XjUxFH7aqDpS4ZH2eT8KAqt1JIe5e.+Ocdf30uqtbrxGrNOw8LEFFF0w1NVng83k9mOgWezA5awtH67GQ4d0FqC7WTaW9UmftWbMgUyXJ8mGuIr1+O9FD4l09FDm+i3DOLO+nu4mLk+IQcsBHnInLwOBwuz4FabRCjELgS6GwlrdwNLQsT9LEu8E5O+Is4ybzW.7YmrUQCGticVBvx.+rCfWDzBdUHgnM0mgIc2Cx2rPbGp88s0o9tFHNTIDjkm35TyItTav3JCudkNhXJG7u7mPlUEiUCYVcHyq0wTnCangK84FA25Wzh4lRJ73GQ9OEr.XOwXspCukuHFaiMwO2vPz39g7nb5yX0odFe8TOi0l5Y7MS8LdzTOiucpmwiOiYH9Tra3yn1A0sbBsZFb5Q0lDwQIkkvJ+Gfe2NPL
-
@hisefilo You can't transpose by cents (a keyboard doesn't have cents) what you want is to change tune. Use
Message.setFineDetune()
. And for transposing you should useMessage.setTransposeAmount()
I actually made a little tuner script yesterday for a project I'm working on.
const var knbFine = Content.addKnob("knbFine", 0, 0); knbFine.set("text", "Fine Tune"); knbFine.setRange(-100, 100, 1); const var knbCoarse = Content.addKnob("knbCoarse", 150, 0); knbCoarse.set("text", "Coarse Tune"); knbCoarse.setRange(-12, 12, 1); function onNoteOn() { Message.setFineDetune(knbFine.getValue()); Message.setCoarseDetune(knbCoarse.getValue()); } function onNoteOff() { Message.setFineDetune(knbFine.getValue()); Message.setCoarseDetune(knbCoarse.getValue()); } function onController() { } function onTimer() { } function onControl(number, value) { }
-
@d-healey You read my mind!!!!!! Thanks once again David! and have a happy new year!
-
Hi David,
I've tried using your code :
function onNoteOn() { Message.setFineDetune(knbFine.getValue()); }
for a Fine Tuning knob in my project, but I get this kind of error.
Interface:! Call of setFineDetune() outside of midi event callback {SW50ZXJmYWNlfHw0OXwzfDI2} : onNoteOn() - Line 3, column 26 {SW50ZXJmYWNlfG9uTm90ZU9uKCl8NDl8M3wyNg==}
I tried my code on Win and Mac, and it only seems to give me that error on Win. With ou without Deferring callbacks.
Did you have this bug before?
-
Copy the script I posted above, then right click in your script and select Load Script From Clipboard. This will replace your script with mine and will place the code in the correct callbacks.