Home › Forums › General › Programming › Simple Akai S2000 Frontend
- This topic has 34 replies, 4 voices, and was last updated 8 years, 2 months ago by pascalc.
-
AuthorPosts
-
January 8, 2015 at 3:02 am #35139
Hello all…
Im trying to make a simple edior for my s2000.
i would like to be able to get the program names to populate a field and then be able to switch between programs by clicking once on the names.
ive gotten the sysex to recive the program names
F0 47 00 02 48 F7 and the “Request program” demo panel is basically half of the way to where i would want to be.
using the demo i can get the s2000s response but only in sysex.
How can i get the output to be the actual program names?thanks for any feedback..
Ciao
SolockyJanuary 8, 2015 at 3:42 pm #35157You need to decode it, find how the program name i encoded in the hex response, are those ascii characters or whatever other method they are using. Then you need to apply it in Lua to get the actual characters that make the name, same thing with any other parameter value etc.
January 8, 2015 at 9:08 pm #35171Hello Atom.
A google search on the subject showed me that youve been down this S2000 road before,did you guys ever get something working??
As for the decoding and lua,,im going to have to trial and error that part.
I honestly have no clue where to begin.This is what ive found out just using sounddiver and common sense.
SLAP BASS = [f0 47 00 03 48 01 00 1d 16 0b 1a 0a 0c 0b 1d 1d 0a 0a 0a f7]
PERC LOOP = [f0 47 00 03 48 01 00 1a 0f 1c 0d 0a 16 19 19 1a 0a 0a 0a f7]
D.DRUM SET = [f0 47 00 03 48 01 00 0e 28 0e 1c 1f 17 0a 1d 0f 1e 0a 0a f7]
How to proceed??(Yep i still se Sounddiver..Im OOOldddd School) 😉
January 9, 2015 at 12:13 am #35187I don’t know how it’s encoded, you need to have a look at:
http://www.asciitable.com/ and http://lakai.sourceforge.net/docs/s2800_sysex.htmlwhat i can see is that “1d 16 0b 1a 0a 0c 0b 1d 1d 0a 0a 0a” says “slap bass”, program name is always 12bytes and i imagine it’s padded with “0a 0a 0a” to always be 12 bytes even if it’s shorter.
But how it’s nibbled is something you need to figure out, there is a MIDI calculator in Ctrlr you can use that to figure it out, or the windows calc program helps too, midi-ox has some tools to deal with sysex data.
January 9, 2015 at 3:06 am #35195Can’t help you with the Lua (i’m just getting started with this thing called CTRLR)
But am planning in the future to do a pannel for my CD3000xl, so thought let’s see.A bit of logical sense and a little pinch of Googling got me the answer underneath.
I’m sure there should be more characters… Can’t remember for sure but I can be wrong it’s been a while…SLAP BASS = [f0 47 00 03 48 01 00____1d 16 0b 1a__0a__ 0c 0b 1d 1d 0a 0a 0a____f7]
PERC LOOP = [f0 47 00 03 48 01 00____1a 0f 1c 0d__0a__16 19 19 1a 0a 0a 0a____f7]
D.DRUM SET = [f0 47 00 03 48 01 00____0e 28 0e 1c 1f 17__0a__1d 0f 1e 0a 0a____f7]0 = 00
1 = 01
2 = 02
3 = 03
4 = 04
5 = 05
6 = 06
7 = 07
8 = 08
9 = 09
SPACE = 0A
A = 0B
B = 0C
C = 0D
D = 0E
E = 0F
F = 10
G = 11
H = 12
I = 13
J = 14
K = 15
L = 16
M = 17
N = 18
O = 19
P = 1A
Q = 1B
R = 1C
S = 1D
T = 1E
U = 1F
V = 20
W = 21
X = 22
Y = 23
Z = 24
# = 25
+ = 26
– = 27
. = 28Used this link to decode the characters:
https://github.com/Captain-Sandwich/akai.pyI know even less about Python scripts then about Lua… But there’s loads of usefull sysex commands in that scripts.
Good luck… Might join you later on when I know what I’m doing. I’m still trying to make her older sister (Akai s612) do what she’s told 😉
Bart
January 9, 2015 at 3:32 am #35197Thank you both for the info.
along with your tips im going to just save a few programs named accordingly to represent 0-9 and A-Z then compare them agaist the outcome for “Slap Bass” and the table listed above….this is atually fun…..
Hey BartBral…..
I thought i was the last dinosaur still using an outboard sampler…
Not including all the Mpc folk..:-)January 9, 2015 at 6:46 am #35209Well you might be the last one still using them 😉
I’m trying to get them up and running again.
I’m one of those MPC-people as well the last few years. But still have a whole rack of hardware samplers: Akai s612, Akai CD3000xl (fully loaded with filter, fx and ram), 2x Emu ESI 32 (without any @#$%?!-ing sysex), Roland VP9000 and a Yamaha A4000.
That CD3000xl was the love of my life… So I am going to dust that of in the near future…
====
Good luck with the research… Let us know when you find something!
- This reply was modified 9 years, 3 months ago by BartBral.
January 9, 2015 at 11:38 am #35221The python script has a function that decodes strings (https://github.com/Captain-Sandwich/akai.py) it’s called akai_to_str() it looks like akai uses it’s own alphabet and not the normal ASCII table so the numbers you get from the sysex (those 12 bytes) represent a position in their own alphabet:
alph = ‘0123456789 ABCDEFGHIJKLMNOPQRSTUVWXYZ#+-.’January 9, 2015 at 2:11 pm #35227Checking out the
string.char methodJanuary 9, 2015 at 5:00 pm #35235BartBral.
You were correct about the table you posted.
I saved the progrms as i said i would and it matched 100%.1 2 3 4 5 6 7 8 9 0
01 02 03 04 05 06 07 08 09 00a b c d e f g h i j k l m n o p q r s t u v w x y z
0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24mnopqrstuvwxmnopqrstuvwx
17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24# + – .
25 26 27 28Space
0aJanuary 10, 2015 at 2:59 pm #35288Got the decodeing part done.
Straight out of the manual.
the easiest version of course…
its not pretty but it works…….now to get this inside my panel…..
;.)s = “F0 47 00 03 48 08 00 0E 28 0E 1C 1F 17 0A 1D 0F 1E 0A 0A 1A 0F 1C 0D 0A 16 19 19 1A 0A 0A 0A 0A 0A 0A 19 1C 11 0B 18 0A 0A 0A 0A 1D 21 0F 0F 1A 0A 13 1E 0A 1F 1A 0A 1D 16 0B 1A 0A 0C 0B 1D 1D 0A 0A 0A 19 0E 0A 11 1F 13 1E 0B 1C 0A 0A 0A 0B 18 0B 16 19 11 0A 0A 0C 0F 16 16 20 0F 16 0A 0E 0B 17 1A 0A 10 0C 0A F7 ”
s = s:gsub(“F0 47 00 03 48 01 00”, “”)
s = s:gsub(“F0 47 00 03 48 02 00”, “”)
s = s:gsub(“F0 47 00 03 48 08 00”, “”)
s = s:gsub(“00”, “0”)s = s:gsub(“01”, “1”)
s = s:gsub(“02”, “2”)
s = s:gsub(“03”, “3”)
s = s:gsub(“04”, “4”)
s = s:gsub(“05”, “5”)
s = s:gsub(“06”, “6”)
s = s:gsub(“07”, “7”)
s = s:gsub(“08”, “8”)
s = s:gsub(“09”, “9”)
s = s:gsub(“0B”, “A”)
s = s:gsub(“0C”, “B”)
s = s:gsub(“0D”, “C”)
s = s:gsub(“0E”, “D”)
s = s:gsub(“0F”, “E”)
s = s:gsub(“10”, “F”)
s = s:gsub(“11”, “G”)
s = s:gsub(“12”, “H”)
s = s:gsub(“13”, “I”)
s = s:gsub(“14”, “J”)
s = s:gsub(“15”, “K”)
s = s:gsub(“16”, “L”)
s = s:gsub(“17”, “M”)
s = s:gsub(“18”, “N”)
s = s:gsub(“19”, “O”)
s = s:gsub(“1A”, “P”)
s = s:gsub(“1B”, “Q”)
s = s:gsub(“1C”, “R”)
s = s:gsub(“1D”, “S”)
s = s:gsub(“1E”, “T”)
s = s:gsub(“1F”, “U”)
s = s:gsub(“20”, “V”)
s = s:gsub(“21”, “W”)
s = s:gsub(“22”, “X”)
s = s:gsub(“23”, “Y”)
s = s:gsub(“24”, “Z”)
s = s:gsub(“25”, “#”)
s = s:gsub(“26”, “+”)
s = s:gsub(“27”, “-“)
s = s:gsub(“28”, “.”)
s = s:gsub(“F7”, “”)
s = s:gsub(“0A”, ” “)
s = s:gsub(“F7”, “”)
print(s)
January 10, 2015 at 6:54 pm #35317Nice!
But isn’t it a bit prone to error?
Say you have a name: WT1F = 211E0110… What will it do then?And the code to remove the sysex container bytes (F0, F7) and the header bytes, I think you should use something like:
nameString = midiMessage:getData():getRange(08, 12)
(where midiMessage would be s in your case). That would take a string of just the name data if I’m not mistaken.
ps… is there a specific reason why yo remove “F7” twice?
January 10, 2015 at 7:25 pm #35319hey Bart,
I am more than sure this is headed for an error or two, but i must say,it works perfect for my personal prg and sample naming scheme which is very basic and hasnt changed in years. If you have any improvements please share :-).
as for “nameString = midiMessage:getData():getRange(08, 12)” i agree and have read that format also in the manual but my problem is all of the lua i am doing in the “ZeroBrane” Lua editor.
I have no clue how to get this inside of Ctrl.
Ive been searching the forum for hours and have looked at the demo panels but i just dont get it (Yes…thats a plea for help 🙂 )
the f7 twice is just a typo thanks for pointing it outJanuary 10, 2015 at 10:31 pm #35328Can only help you a bit… because I don’t know $#IT about everything… But:
01. File>New Panel
02. Choose Panel>Panel Mode
03. Right click somewhere on the empty screen…
Choose Add Component> The component of your liking.
(I find a Toggle button best for my simple debugging tests)
04. Choose Panel>Lua Editor
05. Select LUA on the left… Right click > Add Method
06. Type in name for your Method…
07. Copy your code, Where it says “Your code here”
08. Change your print(s) to console(s)
09. File>save and compile.
10. Go back to your Panel an select the button (or whatever)
11. Choose the name of your Method > Called when component value changes.
12. click your button and see what happens in console window in Lua editor.===
But I have tried your code and couldn’t get it to work without errors… And am not sure what the problem is exactly. But it has something to do with the gsub() call…
Good luck hope this helped a bit… Hope some smarter people can help you with your gsub / naming conversion.
- This reply was modified 9 years, 3 months ago by BartBral.
Attachments:
You must be logged in to view attached files.January 10, 2015 at 10:44 pm #35334hope your a drinking man cause i owe you a beer or two!!!
works perfect.
ive clicked at least 100 times and no error till now.
now off to the next problem…
😉
Thanks againJanuary 10, 2015 at 11:24 pm #35335ahhhhh….
now the errors start…
😉January 12, 2015 at 1:31 am #35390It’s a shame you’re getting errors now 🙁
I’ve been trying and can’t get it to work either.
See my idea below.Maybe somebody can tell us what’s wrong.
I can’t really debug it with the sampler attached, because i’m at home. And Sampler is in the studio.
It might be the string i’m feeding it, I have tried:
{ 01, 0a, 0e } and { 0x01, 0x01, 0x0a, 0x0e } and…
{ ‘0x01, 0x01, 0x0a, 0x0e’ } and etc. etc.What is the exact format of a recieved Sysex string?
------------------ -- This function requests a list of programs from the Akai Sampler ------------------ function requestProgramList() m = CtrlrMidiMessage( {0xF0, 0x47, 0x00, 0x02, 0x48, 0xF7} ) -- Req: List Programs in Memory panel:sendMidiMessageNow( m ) -- Send the request end ------------------ -- recieveAndCovertName() recieves midimessage and extracts namehexstring -- then converts this byte by byte to Akai Name string ------------------ function recieveAndCovertName( midiMessage ) programName = {} size = midiMessage:getSize() -- Size received midi bytes if size == 20 then -- Sysex string is 20 bytes long nameStringHex = midiMessage:getData():getRange( 08, 12 ) -- memoryblock with 12 char bytes for i = 1, 12, 1 do c = byte2AkaiChar( nameStringHex:getByte( i ) ) programName:append( c ) end end return programName end ------------------ -- byte2AkaiChar() gets called by above script. -- it takes bytes and coverts them to Akai-Characters ------------------ function byte2AkaiChar(byte) if byte == 0x00 then c = '0' elseif byte == 0x01 then c = '1' elseif byte == 0x02 then c = '2' elseif byte == 0x03 then c = '3' elseif byte == 0x04 then c = '4' elseif byte == 0x05 then c = '5' elseif byte == 0x06 then c = '6' elseif byte == 0x07 then c = '7' elseif byte == 0x08 then c = '8' elseif byte == 0x09 then c = '9' elseif byte == 0x0A then c = '%s' elseif byte == 0x0B then c = 'A' elseif byte == 0x0C then c = 'B' elseif byte == 0x0D then c = 'C' elseif byte == 0x0E then c = 'D' elseif byte == 0x0F then c = 'E' elseif byte == 0x10 then c = 'F' elseif byte == 0x11 then c = 'G' elseif byte == 0x12 then c = 'H' elseif byte == 0x13 then c = 'I' elseif byte == 0x14 then c = 'J' elseif byte == 0x15 then c = 'K' elseif byte == 0x16 then c = 'L' elseif byte == 0x17 then c = 'M' elseif byte == 0x18 then c = 'N' elseif byte == 0x19 then c = 'O' elseif byte == 0x1A then c = 'P' elseif byte == 0x1B then c = 'Q' elseif byte == 0x1C then c = 'R' elseif byte == 0x1D then c = 'S' elseif byte == 0x1E then c = 'T' elseif byte == 0x1F then c = 'U' elseif byte == 0x20 then c = 'V' elseif byte == 0x21 then c = 'W' elseif byte == 0x22 then c = 'X' elseif byte == 0x23 then c = 'Y' elseif byte == 0x24 then c = 'Z' elseif byte == 0x25 then c = '%#' elseif byte == 0x26 then c = '%+' elseif byte == 0x27 then c = '%-' elseif byte == 0x28 then c = '%.' else error("This byte is NOT an Akai Character") end return c end
Well anyway hope you get the idea… And that someone can help.
- This reply was modified 9 years, 3 months ago by BartBral.
January 12, 2015 at 5:42 am #35400The problem with my solution seems to be that lua can only manipulate strings and not info in a variable.
so get the info as raw data and it should work…..
just dont know how to do thatJanuary 12, 2015 at 6:25 am #35401Correction….
Lua can do variables bit “gsub” is only for strings and not variables.The exact info i get back is as such
RAW:[f0 47 00 03 48 01 00 1d 16 0b 1a 0a 0c 0b 1d 1d 0a 0a 0a f7]
January 12, 2015 at 8:40 am #35403If you could get your decoded result to go into my decoder as a string
s=”blahblahblah”
Then i think it would work..
🙂 -
AuthorPosts
- The forum ‘Programming’ is closed to new topics and replies.