The idea of this originally to convert NRPN+/- message to CC (with MIDIPipe)
MidiPipe converts the NRPN messages to CC97 1 and CC96 1
Set the new Channel + CC + Value
on runme(message)
if (item 2 of message = 96) then
set message to {178, 22, 1}
else
set message to {178, 22, 127}
end if
return message
end runme
Makes this output twice as many messages because it is not sensitive enough?
Stop the leak of the original messages? This only seems to add messages not replace
I hope you can help me out how to achieve those last 2 points with AppleScript
Related
i use readfile to read data from serial port by api instead of WinComm. it works okay but hang on data receive when other side does not sent data, here are some codes:
'----------on port connect section---------------
With cTimeOuts
.ReadIntervalTimeout = 20
.ReadTotalTimeoutMultiplier = 20
.ReadTotalTimeoutConstant = 20
.WriteTotalTimeoutMultiplier = 20
.WriteTotalTimeoutConstant = 20
End With
rtLng = SetCommTimeouts(hPort, cTimeOuts)
'----------on data receive section---------------
With dOverlapped
.Internal = 0
.InternalHigh = 0
.offset = 0
.OffsetHigh = 0
.hEvent = 0
End With
call ReadFile(hPort, BytesBuffer(0), UBound(BytesBuffer) + 1, dwBytesRead, dOverlapped)
i tried:
a. set ReadIntervalTimeout to MAXDWORD and ReadTotalTimeoutMultiplier & ReadTotalTimeoutConstant both to 0, it can avoid hang on receive data, but the receive data will incomplete for random occurred, so this is not my option.
b. some example code on internet using
Call ReadFile(hPort, BytesBuffer(0), UBound(BytesBuffer) + 1, dwBytesRead, 0) using 0 instead of Overlapped setting, but the program crashed.
so i don't know using what to fix this, another thread? or Overlapped? some actual vb6 code is better cause i'm not familiar with this section, thank you!
My girlfriend is trying to use tiktok less, so she has enabled a feature where every time she opens the app it texts me "(her name) is on Tiktok." to hold herself accountable
I'm trying to use applescript on my mac to do the following:
see if I'm receiving an iMessage from her that tells me she's on Tiktok
then send the message "you've logged into tiktok x times today" where x starts at 1, increments each time I receive the message that she's on tiktok, and resets every day
my current script returns the following syntax error:
Expected “given”, “into”, “with”, “without” or other parameter name but found identifier.
here is my current code which I've tried to piece together from a number of resources:
using terms from application "Messages"
property today : missing value
property current_count : 1
on message received theMessage from theBuddy for theChat with eventDescription
"girlfriend is on Tiktok."
if name of theBuddy = "my girlfriend's name" then
tell application "Messages"
send "you have logged into tiktok" & current_count & " times today" to theBuddy
increment()
on increment()
set currentDate to short date string of (current date)
if currentDate is not today then
set today to currentDate
set current_count to 1
end if
set current_count to current_count + 1
end increment
end tell
end message received
... (a bunch of irrelevant code to avoid error -1078)
the code error occurs at the line beginning with "on message received ..." at the word "received"
Hello I am currently using IBM Spss, and I was wondering if there is a way when the code throws an exception to be able to obtain the line of code where the exception occurred? I am able to obtain the line number is there a way to access the stack of the lines that were executed and pull this information from there? Any ideas would be great Thank you in advance!
For Example:
Dim x, y, z
On Error Goto ErrorHandler
x = 30
y = 0
z = x / y 'would like to grab this code since this is where the error occurred
Exit
ErrorHandler:
debug.Log(Err.Description + _
" error occurred on line number " + _
CText(Err.LineNumber))
No, there is no way to map the line number to the actual code unless you keep your own index, allowing for macro expansion etc.
What you can do, though, is to submit the code in blocks and catch the exception for that block, which narrows down the location. In the limit, if each line is its own block, you will know exactly where the error occurred.
I am trying to process information with a dead mans program. Every time I try to run it I get Compile error Invalid outside procedure. I've never messed with VB6 before. I've been searching for a solution but I only get help saying it needs to be in sub or something but the threads are closed and I haven't been able to get their solutions to work for me. http://pastebin.com/vR7A7iN5
I think the problem is in this specific section of the code but I am unsure how to place it into a sub or get it to work otherwise.
End Type
Dim recout As statrec
Open "\STAT\PP\QM1409\MGA013A\" For Random As #1 Len = 150
num.recs = LOF(1) / 150
Print num.recs
For Count = 1 To num.recs
Get #1, Count, recout
If recout.mga = "013" Then
It is a big reach to assume this is the only incompatibility, but start by wrapping the code you're talking about now inside a method as Plutonix mentioned. That IS definitely an error. However I would not be surprised if there are more problems.
Example:
Public Sub GetStatRecs()
Dim recout As statrec
Open "\STAT\PP\QM1409\MGA013A\" For Random As #1 Len = 150
num.recs = LOF(1) / 150
Print num.recs
For Count = 1 To num.recs
Get #1, Count, recout
....
Next Count
....
End Sub
I'm trying to send something via socket so I made a simple protocol which is :
[Message length (uint32)][Packet id(uint32)][Message]
So, how can I send a message with this protocol ? I tried this :
message = 'hi'
parent_socket.send([message.length, 2].pack('LL') + message, 0)
and it doesn't seems to work. What I get is just the length and the packet id.
How can I figure this out?
(Updated)
The code I'm using to receive the message is :
if child_socket.ready?
header = child_socket.read(8).unpack('LL')
length = header[0]
packet = header[1]
case packet
when 1
stdin.write(child_socket.read(length))
when 2
puts child_socket.read(length)
#send console
else
Console.show "Unknown packet : #{packet}"
end
The output is 10. Seems normal (4 + 4 + 2)
in that case, length is 2 and packet is 2. So it switch to 'when 2' but it output nothing.
The problem is you are only reading the first 8 byes.
header = child_socket.read(8).unpack('LL')
According to the docs for IO#read, if you don't pass a length, it will read to EOF, which should get everything. So just remove that length parameter:
header = child_socket.read.unpack('LL')