MidiPipe FAQ

Audio, MIDI and other software, not including effects or instruments
Post Reply
Aleatoric
Posts: 122
Joined: 09 Jan 2004, 17:57
Location: NYC

Post by Aleatoric » 16 May 2004, 09:29

G4 Powerbook 1Ghz (15inch), 1GB RAM, OSX 10.3.3.

MIDI PIPE 0.9.1.

Never had a single prob with MIDI PIPE crashing till I started trying to use this script.

Aleatoric
Posts: 122
Joined: 09 Jan 2004, 17:57
Location: NYC

Post by Aleatoric » 16 May 2004, 09:39

I noticed it only crashed with the guitar. The guitar was sending all sorts of timing clock messages it seems. Also I saw poplyphonic aftertouch in there as well. Also some messages that look like ??? where there too. All I know is that any note on messages of 16 and below need to be filtered and all note offs need to stay (ie I still need to be able to pull my finger off the fret button for the note to stop). I know there are apps like MIDI OX on PC that can do this. I hope we can figure it out with MIDI PIPE. thanks again.

Aleatoric
Posts: 122
Joined: 09 Jan 2004, 17:57
Location: NYC

Post by Aleatoric » 16 May 2004, 09:43

Also the MIDI guitar sends each string as a different MIDI channel 1-6 if that is of any use to you.

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

Post by nicowald » 16 May 2004, 09:56

??? in AList means either that there is a bug in MidiPipe, or your guitar sends something not conforming to the MIDI Standard, or your guitar sends messages with "Running Status", which is not supported by CoreMidi (??? should never happen). Try to put the "Message Filter" tool directly after "Midi In" and uncheck everything that shoud not be filtered out.
To find out where the ??? comes from, can you please let me know what the previous message in AList was and what the "Data" column says.

Also, the script I gave to you is limited on one MIDI channel -- if you don't need the channel splitting, put a "Channel Router" tool before the "AppleScript Trigger" tool and route everything to one channel. Otherwise the script needs to be extended.

Nico
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

Post by nicowald » 16 May 2004, 10:18

Please check your console.log file. Does it say something like this?
2004-05-16 19:11:51.835 MidiPipe[3443] unknown message

If so, I'd really like to know what your guitar is sending. Can you try the utility "MIDI Monitor" to find out and then let me know?
This still doesn't explain the crash. Still working on that. :-)

Nico
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

Aleatoric
Posts: 122
Joined: 09 Jan 2004, 17:57
Location: NYC

Post by Aleatoric » 16 May 2004, 10:48

NoteOn D#5 145 63 16
System Exclusive 240 67 127
System Exclusive 240 67 127
Active Sensing 254
NoteOff D#5 145 63 0
System Exclusive 240 67 127
System Exclusive 240 67 127
Active Sensing 254

That is a sample of playing my guitar and watching MIDIPIPE. I have not seen any of the "???" data since the one time I noticed it before it crashed. I appreciate your affort into helping me figure this out.

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

MidiPipe V0.9.2 (beta) released

Post by nicowald » 18 May 2004, 14:38

What's new?
V0.9.2 (beta) 05/18/2004
• finally added multiple pipe support for cleaner "midipiping"
• added "MIDI Loop Protection" to avoid system hangs
• fixed crash bug caused by "AppleScript Trigger" tool (reported by Aleatoric)
• fixed "settings get loaded and work but aren't shown" bug in "Keyboard" tool
• fixed minor bug in "Control Slider" tool
• "MicroTuner" tool now replicates all channel messages (except pitchbend) to channel 1 to 12

Regards, Nico
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

Post by nicowald » 18 May 2004, 14:56

RogueM wrote:and in relation to the previous question how do you modify the note on message based on velocity e.a if the note is C2 and the velocity is above 105 then transpose C2 to C3?
Rogue: I'll create a script for that as soon I find some time.

Regards, Nico
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

Rogue
Site Supporter
Posts: 465
Joined: 28 Dec 2002, 08:34

Post by Rogue » 18 May 2004, 16:05

that'd be great. In the meantime I'll make sure I keep my lunchmoney on the side for a bit as a reward for your hard work! ;-)

take care!
Rogue
Toontrack Crew Member

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

Post by nicowald » 19 May 2004, 10:08

Rouge,

here it is. Let me know if it works for you.
Happy MidiPipeing!

Nico

--begin of script
-- this script transposes every note message on channel 1 up 12 keys if its on velocity is above 105
property channel : 1
property velocity : 105
property transpose : 12
property keydown : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 1 of message = (143 + channel)) then
if (item 3 of message > 0) then
-- note on
if (item 3 of message > velocity) then
-- remember key
set item (item 2 of message) of keydown to 1
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
else
-- safety for avoiding hanging notes
if (item (item 2 of message) of keydown) = 1 then
-- double note on (missing note off) -> transpose too
set item 2 of message to ((item 2 of message) + transpose)
end if
end if
return message
else
-- note off
noteoff(message)
return message
end if
else
if (item 1 of message = (127 + channel)) then
-- note off
noteoff(message)
return message
else
-- message on different channel
return message
end if
end if
end runme
on noteoff(message)
if (item (item 2 of message) of keydown) = 1 then
-- forget key
set item (item 2 of message) of keydown to 0
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
end if
end noteoff
-- end of script
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

Rogue
Site Supporter
Posts: 465
Joined: 28 Dec 2002, 08:34

Post by Rogue » 19 May 2004, 15:52

Nico thanks a bunch. I just tried to paypal a lil' sumthin' but their server is down :(

To give you a bit of a background I'm trying to create a serie of scripts for e-drummers to be able to trigger different samples based of their playing therefore allowing them to use any single trigger pad as a dual trigger.

Anyway the script works great but I'd like to understand it so I don't have to bother you too much with the exact environment I am trying to create:

1) I was trying to set a negative transpose value but didn't succeed. Is the only way to achieve that to substract the (positive) transpose value or is there a syntax such as (-12) to shift an octave down?

2) if I wanted to transpose only a particular note without affecting others would it be with the help of a conditional of the form
if (item 2 of message = 64) then
inserted before the velocity if/then?

3) is it preferable to insert an applescript for each note I want to transpose or is it possible to include all in the same statement?

I think with these 3 answers I should go a fair way into realising a dream for me and my peers and hopefully bring you a lot of small contributions to a well deserved vacation in the sun! Thanks again for creating the best midi utility bar NONE :)
Toontrack Crew Member

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

MidiPipe V0.9.3 (beta) released

Post by nicowald » 20 May 2004, 09:00

unfortunately V0.9.2 introduced a problem when opening tool panels -- here is the fixed version
What's new?
V0.9.3 (beta) 05/20/2004
• fixed crash bug when opening a tool panel of a saved pipe
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

nicowald
Posts: 82
Joined: 21 Apr 2003, 12:35
Twitter: nicowald
Location: Nordstemmen, Germany
Contact:

Post by nicowald » 20 May 2004, 09:36

Rouge:

I was working on your script when I noticed the crash bug in V0.9.2 -- I had to fix that first.

1) simply change the line:
property transpose : 12
to
property transpose : -12
for transposing 12 keys down

2) yes

3) since executing an AppleScript introduces latency, it is preferable to make one that does the whole thing

I fixed a bug in the script I sent before (key C0 didn't work):
-- script start
-- this script transposes every note message on channel 1 up 12 keys if its on velocity is above 105
property channel : 1
property velocity : 105
property transpose : 12
property keydown : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 1 of message = (143 + channel)) then
if (item 3 of message > 0) then
-- note on
if (item 3 of message > velocity) then
-- remember key
set item ((item 2 of message) + 1) of keydown to 1
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
else
-- safety for avoiding hanging notes
if (item ((item 2 of message) + 1) of keydown) = 1 then
-- double note on (missing note off) -> transpose too
set item 2 of message to ((item 2 of message) + transpose)
end if
end if
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
else
-- note off
noteoff(message)
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
end if
else
if (item 1 of message = (127 + channel)) then
-- note off
noteoff(message)
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
else
-- message on different channel
return message
end if
end if
end runme
on noteoff(message)
if (item ((item 2 of message) + 1) of keydown) = 1 then
-- forget key
set item ((item 2 of message) + 1) of keydown to 0
-- transpose
set item 2 of message to ((item 2 of message) + transpose)
end if
end noteoff
-- script end

And here is a script that allows a different transpose value for every key:
-- script starts here
-- this script transposes every note message on channel 1 as defined in the transpose list if its on velocity is above 105
property channel : 1
property velocity : 105
property transpose : {12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
property keydown : {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
on runme(message)
if (item 1 of message = (143 + channel)) then
if (item 3 of message > 0) then
-- note on
if (item 3 of message > velocity) then
-- remember key
set item ((item 2 of message) + 1) of keydown to 1
-- transpose
set item 2 of message to ((item 2 of message) + (item ((item 2 of message) + 1) of transpose))
else
-- safety for avoiding hanging notes
if (item ((item 2 of message) + 1) of keydown) = 1 then
-- double note on (missing note off) -> transpose too
set item 2 of message to ((item 2 of message) + (item ((item 2 of message) + 1) of transpose))
end if
end if
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
else
-- note off
noteoff(message)
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
end if
else
if (item 1 of message = (127 + channel)) then
-- note off
noteoff(message)
if (item 2 of message >= 0) and (item 2 of message < 128) then
return message
end if
else
-- message on different channel
return message
end if
end if
end runme
on noteoff(message)
if (item ((item 2 of message) + 1) of keydown) = 1 then
-- forget key
set item ((item 2 of message) + 1) of keydown to 0
-- transpose
set item 2 of message to ((item 2 of message) + (item ((item 2 of message) + 1) of transpose))
end if
end noteoff
-- script end

Simply edit the transpose list to define how notes should be transposed. In the example only C0 will be transposed up 12 keys.

Regards, Nico
Last edited by nicowald on 23 Jun 2004, 09:39, edited 1 time in total.
MidiPipe - route, map, filter, convert, display, and input MIDI messages in real-time
http://www.subtlesoft.square7.net

crscheid
Site Supporter
Posts: 270
Joined: 29 Jul 2002, 11:24
Location: Northeast US
Contact:

Post by crscheid » 20 May 2004, 22:35

NICO is a god!!! I was showing my bass player tonight the details of my rig and he was saying, "you can do THAT with Midipipe?!?!".

cweise@jcsu.edu
Posts: 2
Joined: 21 May 2004, 11:37

AppleScript to Control MIDIPipe?

Post by cweise@jcsu.edu » 21 May 2004, 12:16

Very cool list, and maybe just in time for me....

I'm a composer, not a programmer, but I've learned to script reasonably well. I used HyperCard for years and am now using RunRev's Revolution 2.

I'm designing an app in Revolution for which I need to grab MIDI input data and display it as text. Real simple, except I can't do it directly from Rev. I used to use HyperMIDI for HC, but that doesn't work with OSX.

Is it possible to write an AppleScript that will:
--Open MIDIPipe (I know I can do this part)
--Automatically have it start listening for/storing incoming MIDI data
--On mouseClick (or some signal that the user's finished):
----Stop listening
----Parse so just NOTE ON's are kept
----Copy the Note #'s (as text) to the clipboard (or a variable that can be passed back to Rev via AS)
----Quit
--Run in the background, if possible (nothing wrong with seeing the MPipe screen, mind you, just might confuse the user a little...).
:?:

I can do the parsing in Rev if necessary, but I need at least the raw data in text so I can work with it.

Any help, better ideas, or sage advice is greatly appreciated. Thanks! :D
CCW
Composer of Really Strange Stuff
Charlotte, NC

Post Reply