Closed sanhuaaan closed 4 years ago
Hi,
Had the same issue with a Behringer, this didn't work in version 3.2:
sync "/midi:x-touch_mini:0:11/note_on"
Then I try tried using the wildcard described here and manage to receive midi using this
sync "/mid*/note_on"
So I continued until reaching this:
sync "/midi:x-touch_mini:0:*11/note_on"
So I guess there are some characters missing but couldn't find which one
Hope this helps
In both cases, what do you see in the cue log?
In clue log I see this: "/midi:x-touch_mini:0:11/note_on"
I am having a similar issue with events like this:
/midi:ddj-1000:0:10/note_on
Adding a *
to my pattern fixes it, but I don't understand why. For example:
sync "/midi:ddj-1000:*:10/note_on" # works
sync "/midi:ddj-1000:0:10/note_on" # does not work
I think it’s likely to be the hyphen which is interpreted as a regex like range symbol. It probably should be converted to an underscore along with other special chars.
I’ll look into it later tonight :-)
I'm pretty sure the issue is that osmid
, the c++ process which converts MIDI to OSC isn't replacing the -
with _
when it converts messages to "safe OSC strings". Here's the specific part of the code where this happens:
https://github.com/llloret/osmid/blob/master/src/utils.cpp#L57
If you're feeling brave, you can add another line here to do the replace and then rebuild osmid (a simple cmake build process), drop the new m2o
binary into app/server/native/osmid
and run again.
I'll also do some more tests later to see if I can replicate the error and determine whether this fixes things.
I'll have a look later today and fix it.
On Sat, 6 Jun 2020, 19:36 Sam Aaron, notifications@github.com wrote:
I'm pretty sure the issue is that osmid, the c++ process which converts MIDI to OSC isn't replacing the - with _ when it converts messages to "safe OSC strings". Here's the specific part of the code where this happens:
https://github.com/llloret/osmid/blob/master/src/utils.cpp#L57
If you're feeling brave, you can add another line here to do the replace and then rebuild osmid (a simple cmake build process), drop the new m2o binary into app/server/native/osmid and run again.
I'll also do some more tests later to see if I can replicate the error and determine whether this fixes things.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/samaaron/sonic-pi/issues/2385#issuecomment-640101127, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJOL45R5N6U4NW7KLKUWILRVKEC5ANCNFSM4M5F7T5A .
@llloret thanks! I'm super happy to send a PR if this is indeed the issue.
To be specific, this isn't really a problem with osmid per se, it's more that it's likely an issue with how the generated MIDI names interact with Sonic Pi's time-state OSC-like pattern matching system.
I would happily accept a pr :), of course
On Sat, 6 Jun 2020, 19:41 Sam Aaron, notifications@github.com wrote:
@llloret https://github.com/llloret thanks! I'm super happy to send a PR if this is indeed the issue.
To be specific, this isn't really a problem with osmid per se, it's more that it's likely an issue with how the generated MIDI names interact with Sonic Pi's time-state OSC-like pattern matching system.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/samaaron/sonic-pi/issues/2385#issuecomment-640101691, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJOL42OKQHTJWRAAU5P6YTRVKET7ANCNFSM4M5F7T5A .
OK, I think I have found the issue.
I believe that osmid not converting -
to _
is actually ok, as the -
is only activated within [
]
pairs which are already sanitised. So a stand-alone -
outside of [
]
should be harmless.
However, I did have some very old code lying around which was me playing with an attempt to emulate Clojure-like namespace symbols. It was super hacky at the time and I have no idea how it managed to stay in the codebase unused for so long.
It essentially modified the raw code as a text string with no regard for syntax and converted :foo:
to a special namespaces symbol - even if it was embedded within a Ruby string.
I've now removed this code, so won't be part of any future release.
To test that this fixes things for you in the meantime, you can manually edit your code. Head to this file:
app/server/ruby/lib/sonicpi/preparser.rb
and remove this line (should be on line 27):
rb.gsub!(/:([a-zA-Z0-9\!\?=_]+(:[a-zA-Z0-9\!\?=_]+[a-zA-Z0-9\!\?=_])+)/){|s| "::SonicPi::SPSym.new('#{$1.split(':').join(' : ')}')"}
Then restart Sonic Pi and let me know if that fixes things for you :-)
Removing that line works for me
Thanks
Closing this - Fixed in 8cfc2f6545da2547d7358210f81e83ea354dfe2d
When using a midi controller, the midi events can be seen on the cue log, but they're not syncing with live_loops. ("play 60" line is never happening)
Sonic Pi version: 3.2.2 OS: Windows 8.1
server-output.log: