About Tony-b Machine

With which technology the Tony-b Machine was built
With Javascript and Web Audio API.

Are the older Tony-b Machine still available
You can access to the Tony-b Machine 1, 3 and 4 by clicking the links below.
You need to have Flash Player installed and enabled on your browser.
If you use a Android device, consider using Puffin Web Browser


Who is the author
Anthony Bouchereau is Web Developer and Musician. He developped 5 "Tony-b Machine" since 2006.
LinkedIn | Mail

Is there a forum
No. Nethertheless, you can read news, write comments and share your work in the facebook page www.facebook.com/TonyBmachine or the Twitter page twitter.com/TonybMachine

Sound

What is SID
SID (Sound Interface Device) is the sound generator chip of the Commodore 64, a popular home computer in the 80's. Its technical characteristics are very limited : only 3 monophonic voices, 4 kind of waveforms. However, composers of these days, such as Rob Hubbard, Jeroen Tel or Martin Galway, got the most out of the machine. They managed to make it sound like a real analog synthetizer and wrote a very rich corpus of "SID tunes".
The Tony-b Machine 5 emulates the sound of the SID chip (without any addition) in your browser and makes the composition much more accessible than with the available programs of the 80's.

Why don't I hear any sound
Please check those following points :
  • Your speakers are on
  • The volume is high enough
  • Your browser supports HTML5 (no IE !)
  • ...


Can I tune Tony-b Machine
Click on the Settings Menu. You can adjust the diapason from 415 Hz to 466 Hz (default : 440 Hz).

Can I transpose Tony-b Machine
Click on the Settings Menu. You can transpose from -12 semitones to +12 semitones.

Why is there any volume button
I don't want to overload the interface and there is already a volume control on all devices.

Why is there is too much latency
Please try an other browser. Chrome and Firefox now support Javascript Workers which allow a detached thread of the sound and usually have a lower latency time.
The latency also depends on the OS (Linux, Windows, iOS) and some hardware/software parameters that I don't all know.

Why can't I adjust the tempo to 1 bpm
There is an internal framerate based at 50 Hz which does not allow to have any tempos.

Live / Loop

What is it
Above the Melody keyboard and the Acc. keyboard, you can see 2 buttons : Live / Loop. In the "Live" Mode you can play any melody just like on a piano. In the "Loop" Mode, there is a repeated pattern based on the last note you have play on the keyboard.

Live Mode and Polyphony
You can only play one note at a time in each voice, but if you play 3 notes or more together, a rapid arpeggio is produced.

What is Tapping
Keep a note pressed and play other detached notes to have a "Tapping" performance (the pressed note is played again when an other note is released).

What are the "Part" buttons
This is used to switch a part of the loop pattern. This has effect on Drum patterns as well as Bass or Melody Patterns.

How to play drums in Live
Choose the Instrument 0 on the Acc. voice or on the Melody Voice.

Expression / Special / Modulation

How to trigger a Expression/Special
Click on the arrow keys at the bottom right of the Machine, or use the arrow keys of your keyboard, or use the directional keys of your gamepad. Try to make one of the sequences described below.

What is Expression
An Expression is a musical effect added to the notes when playing live. It is triggered by pressing a directional key along with playing a note.

What is the list of available Expressions
arrow_upwardRing Effect
arrow_backPortamento
arrow_forwardWide Vibrato
arrow_downwardFall Effect


What is Special
A Special is a particular sound that can be triggered with a key combination.

What is the list of available Specials
arrow_upwardarrow_upwardarrow_upwardRocket Night                                                            
arrow_forwardarrow_forwardarrow_forwardPole Position                                                            
arrow_forwardarrow_upwardarrow_backarrow_downwardBlack Hole                                                            
arrow_forwardarrow_forwardarrow_backarrow_backTrick Shot                                                            
arrow_backarrow_backarrow_forwardarrow_forwardMotor Psycho                                                            
arrow_backarrow_forwardarrow_upwardarrow_downwardRainbow Bell                                                            
arrow_backarrow_forwardarrow_backarrow_forwardSmash Glass                                                            
arrow_upwardarrow_forwardarrow_downwardarrow_backShrimp Nado                                                            
arrow_downwardarrow_downwardarrow_downwardBoom Waker                                                            
arrow_downwardarrow_downwardarrow_upwardarrow_upwardOne Up                                                            
arrow_backarrow_downwardarrow_forwardarrow_upwardLightened Sky                                                            


What is Modulation
The modulation is produced by turning the Tony-b Disc on the right panel of the Machine. The effect depends on what Instrument is choosen on the first Live voice. Some Instruments may not have a determinate effect.

PC Keyboard

What can I do with my PC Keyboard
You can play several notes at the same time but it seems to have a limit number that the browser can detect (3 or 4). You can play memories, turn on/off pattern part. Please check the keyboard shortcuts below.

Is it compatible for a keyboard other than QWERTY
The Machine is compatible with AZERTY, QWERTY and QWERTZ keyboards. Its preset depends on the browser language, but you can change it via the Settings Menu.

What are the keyboard shortcuts
Q (or A)C key, voice 1
2C# key, voice 1
W (or Z)D key, voice 1
3D# key, voice 1
......
Z (or W)C key, voice 2
SC# key, voice 2
.......
1Switch Live/Loop Voice 1
A (AZERTY => Q)Switch Live/Loop Voice 2
TabFocus on next 7-Segment
++1 on focused 7-segment
--1 on focused 7-segment
*Switch Num Pad fonction (part or memory)
0Stop Memory
1-9Switch Part 1-9 or Start Memory 1-9 according to NumPad Switch position
Page UpTurn Modulation right
Page DownTurn Modulation left
arrow_upwardarrow_downwardarrow_backarrow_forwardExpression / Special


Mouse

What can I do with my PC Mouse
The game can be played with a PC mouse although it's certainly not the most efficient way. Please consider playing with the keyboard or a MIDI device to improve your playing.

What can I do with the Mouse Wheel
You can rotate the Modulation Wheel (Tony-b Disc). You can also change the values of each 7-Segment Display. You have to point the mouse over the item and turn the Mouse Wheel.

Mobile / Tablet

Is it compatible with Android / iPhone
You can play with a smartphone or tablet using a web browser (Chrome recommended). There is no app in Play Store / Apple Store. But you can install still install it as a "Progressive Web App". On Android, you should see a prompt that asks you if you want to install the Application.

Is it compatible with multi-touch screen
Yes. The Tony-b Machine supports multitouch. If you want to know the number max of touch points your device can support, try this link : https://codepen.io/tony-b/full/mddMPrK

Is it playable Offline
Yes. On any browser, you should be able to see the Tony-b Machine offline on the standard URL (www.tony-b.org) if you've access at least once on the website.

MIDI Input

What is it
You can connect synthesizers, keyboard, drum machines and other controllers to your computer or device. Events such as Note On, Note Off, Program Change or Control Change are able communicate to the Tony-b Machine.

What are the compatible browsers
Chrome and Chromium based browser (Opera, Vivaldi, Edge) are natively compatible with the Web MIDI API.
Firefox is not natively compatible, you must install the Web Midi API add-on : https://addons.mozilla.org/fr/firefox/addon/web-midi-api/, https://addons.mozilla.org/fr/firefox/addon/jazz-midi/

How to test if my MIDI device works correctly
Plug your MIDI device and go to this URL https://codepen.io/tony-b/full/KKKvzyw . The page should log all MIDI events from your device

How the MIDI events are mapped to the Tony-b Machine
Midi EventChannelValuesAction
Note On/Off10-53Voice 2 - Note On/Off
154-127Voice 1 - Note On/Off
20-127Voice 1 - Note On/Off
30-127Voice 2 - Note On/Off
40-127Voice 3 - Note On/Off
100-127Drums - Note On/Off
Note On51-9Start Memory 1-9
50Stop Memory
61-9Switch Pattern part 1-9
Program Change1,20-35Voice 1 - Instrument Change
30-35Voice 2 - Instrument Change
40-35Voice 3 - Instrument Change
Pitch Bend1,20-127Voice 1 - Pitch Bend
30-127Voice 2 - Pitch Bend
40-127Voice 3 - Pitch Bend
CC Modulation (1)1,20-127Voice 1 - Modulation Wheel
30-127Voice 2 - Modulation Wheel
40-127Voice 3 - Modulation Wheel
CC Expression (11)
CC Vibrato Depth (77)
1,20-127Voice 1 - Vibrato Amplification
30-127Voice 2 - Vibrato Amplification
40-127Voice 3 - Vibrato Amplification
CC Sustain Pedal (64)1,20-127Voice 1 - Cut Release
30-127Voice 2 - Cut Release
40-127Voice 3 - Cut Release
CC Portamento On/Off Switch (65)
CC Portamento CC Control (84)
1,20-127Voice 1 - Portamento Switch
30-127Voice 2 - Portamento Switch
40-127Voice 3 - Portamento Switch
CC General Purpose (80)1,20-127Voice 1 - Switch Live/Loop
30-127Voice 2 - Switch Live/Loop
40-127Voice 3 - Switch Live/Loop
CC General Purpose (81)1,21-8Voice 1 - Set Pattern Number
31-12Voice 2 - Set Pattern Number
4,101-16Voice 3 - Set Pattern Number
Note : on some softwares / devices, MIDI channels are counted from 0 to 15 and not from 1 to 16.
Channel 4 and Channel 10 both point to the Voice 3 of the Tony-b Machine : simultaneous events are not taken into account.


How to play drums
Use MIDI Channel 10 (usually used for drums).

How do I change the voice to which my MIDI device is mapped
You can do it by changing the MIDI channel of your device (if your device allows it). The MIDI channel 1 and 2 are mapped to Treble voice, the MIDI channel 3 is mapped to Bass voice, the MIDI channel 10 is mapped to Drum voice (see the table above).
In the Settings menu, you can also force each MIDI device to be mapped to a specific voice.

Is it possible to change MIDI mapping
This is not currently possible.

Gamepad

What are the compatible browsers
All modern browsers are compatible with the gamepad API.

How to test if my Gamepad is recognized
All PC gamepad are theorically compatible. Plug your Gamepad and go to this URL https://codepen.io/tony-b/full/KKKvzyw . The page should log the main press/release events from your device. Note : sometimes you need to press at least one button for the gamepad to be detected

How the Gamepad is mapped
EventAction
Directional pad / joystickExpr/Special buttons
Button 0Switch to Parts or Memories functionalities
Button 1Stop memory
Button 2 to 10Start memory 1 to 9 / Switch Pattern Parts 1 to 9
Analog StickModulation Wheel


Is it possible to change Gamepad mapping
This is not currently possible.

Memories

How to play/stop memories
Press on one of the 9 Memory button on the right panel to start Memory. Press the 0 button to stop a Memory.

How to edit memories
Click on the second button on the bottom right to open the screen for editing memories. Each buttons from 1 to 9 matches to each of the 9 memories. The monochrome screen enumerate the events related to the memories. There are 4 columns separated by a tabulation.
Excel to Memory

It can be convenient to paste values from your favorite spreadsheet.

  • Time : the timing of the event. (See Timing events)
  • Voice : 1, 2 or 3 depending on whether the event is on the Treble voice, on the Bass voice or on the Drum voice.
  • Action : the type of event from the list below :
    • On : Note On
    • Off : Note Off
    • Ins : Instrument
    • Pit : Pitch Bend
    • Por : Portamento
    • Vib : Vibrato
    • Mod : Modulation
    • Cut : No Release
    • Pla : Playing Mode
    • Pat : Pattern
    • Par : Part
  • Value : the available values depends on the type of event.
ActionAvailable valuesDescription
On (Note On) from 0 to 127Beginning of a note
Off (Note Off) from 0 to 127Ending of a note that began with same value
Ins (Instrument) from 0 to 35Changes instrument among the 36 available
Pit (Pitch Bend) from -2400 to 2400Pitch note up or down. The value is in cent (hundredth of a semitone)
Por (Portamento) 0, 1 or 20 disables portamento, 1 enables it once for next note, 2 enables it permanently
Vib (Vibrato) 0, 1, 2, 3 ,or 40 disables vibrato, 1 is for the standard vibrato, 2, 3 and 4 makes a more or less wide vibrato
Mod (Modulation) from 0 to 127Turn the Modulation Wheel
Cut (Cut Release) 0 or 1 1 cut notes immediately at Note Off event (= no release). Default : 0.
Pla (Playing Mode) 1 or 2 1 = Live, 2 = Loop
Pat (Pattern) from 1 to 8, 12 or 16 depending on the voiceChanges the Pattern (Loop Mode only)
Par (Part) 10, 11, 20, 21, 30 or 31Change pattern part. The first number is the part (1,2 or 3), the second number activates it (1) or deactivates it (0).


Timing events
The time row can be of two forms :

Whole Number : it represents the frame number (a frame lasts 20ms = 50 frames per second). Use it especially to play a melody with very fast notes. It is not linked to the Tempo of the Machine.
Example :
Time	Voice	Action	Value
0	1	On	60
1	1	Off	60
1	1	On	64
2	1	Off	64
2	1	On	67
3	1	Off	67
3	1	On	72
4	1	Off	72
4	1	On	76
5	1	Off	76
5	1	On	79
6	1	Off	79
6	1	On	84
7	1	Off	84

Time / Ticks : two numbers separated by a dot. The first number represents the number of times, the second number is the 12th fragment of the time in the duodecimal notation (0,1,2,3,4,5,6,7,8,9,A,B).
Example :
Memory Example
corresponds to :
Time	Voice	Action	Value
0.0	1	On	60
0.6	1	Off	60
0.6	1	On	62
1.0	1	Off	62
1.0	1	On	64
1.4	1	Off	64
1.4	1	On	65
1.8	1	Off	65
1.8	1	On	67
2.0	1	Off	67
2.0	1	On	69
2.9	1	Off	69
2.9	1	On	71
3.0	1	Off	71
3.0	1	On	72
4.0	1	Off	72


What are note numbers
Note numbers are the same as in MIDI specifications.
NoteOctave
-10123456789
C01224364860728496108120
C#11325374961738597109121
D21426385062748698110122
D#31527395163758799111123
E416284052647688100112124
F517294153657789101113125
F#618304254667890102114126
G719314355677991103115127
G#820324456688092104116
A921334557698193105117
A#1022344658708294106118
B1123354759718395107119
Very low and very high notes may not be played by the Tony-b Machine.


Couldn't there be an easier way to edit Memories
A visual editor in a piano roll style should be added in a future version.

How does MIDI import work
In the Edition screen, choose one of the 9 memories, click on the "Import Midi File" button and select a MIDI file stored on your hard drive. All the MIDI events recognized by the Tony-b Machine are then displayed in the memory Screen. Click on the Save button and close the Memory Screen. Click on the button corresponding to the choosen Memory : you can now listen to the imported MIDI tune.
MIDI Event Mapping is the same as for MIDI Input : see MIDI Event Mapping for more details.

Can I play multiple Memories simultaneoulsy
Yes it is possible but it can generate conflicts especially because there can be only one note at a time for each voice.

Is it possible to loop a Memory automatically
This is not currently possible.

From which works do the melodies come
  • Memory 7 Toccata and Fugue BWV 565, Johann-Sebastian Bach
  • Memory 8 Hallelujah from Messiah HWV 56, George Frideric Handel
  • Memory 9 Autumn from The Four Seasons RV 293, Antonio Vivaldi


Export

How to record my work
Press Record button once to begin recording and press it again to stop the record. Then you'll have to choose a title, an author name and the format for the export.

How to share my work
You could upload your work (in MP4 for instance) to your favorite social networks and share it with the hashtag #tonybmachine. You can share it on the Tony-b Machine Facebook page : facebook.com/TonyBmachine.
If you post a video on YouTube, let me know and I'll add it to the Tony-b Machine 5 YouTube Playlist

What export formats are available
  • WAV (16-bit/44100Hz/mono - uncompressed audio)
  • MP3 (160kbps - compressed audio)
  • MP4 (video)
  • TXT (SID raw dump)


How to make a video of the Tony-b Machine while I'm playing
You can use a video capture software like OBS Studio.

Is there a SID export
Not yet but I hope this will happen someday.

API

What is the API for
The API allows developers to extend the functionalities of the Tony-b Machine. It can be useful to add any automation script. It can also help to connect the Tony-b Machine to any other device (input or output) that communicates through Serial, Midi or DMX for example.

How does it work
The API works through the WebSocket protocol. To initiate a WebSocket communication you have to inform the port in a URL parameter named "ws_ports". Exemple : to inititiate a WebSocket communication through the port 1337, type the URL https://www.tony-b.org/?ws_ports=1337. You can initiate multiple WebSocket instances by specifying two or more ports separated by a comma, for instance https://www.tony-b.org/?ws_ports=1337,1338,1339. It can be used to separate some tasks or to solve performance issues.
You can now send and receive messages through the WebSocket API. You will need to develop a script on your own computer that will run together with a Web Browser opened on the Tony-b Machine page.
Important : the WebSocket is first launch your program and then refresh Tony-b Machine page in your browser to make it work.
The following examples are coded in Node JS which is probably the simplest way, but you can consider make a script with any language likely to communicate with WebSocket : Java, Python, PHP, C(++)...

What are the different features
4 differents modules can be activated :
ModuleWayDescription
midi-inINPUTEmulates a MIDI Input Device
control-inINPUTNot available yet.
Emulates all kinds of input actions.
beat-outOUTPUTSends the metronome ticking.
db-outOUTPUTSends the audio output level.

You will need to enable each module you want to use by sending to the Tony-b Machine an JSON object with key named "enable" and the name of the module as the value.

Example (Node JS) :
var server = require('websocket').server;
var http = require('http');
var port = 1337;//use URL https://www.tony-b.org/?ws_ports=1337
var socket = new server({httpServer: http.createServer().listen(port)});

socket.on('request', (request) => {
    var connection = request.accept(null, request.origin);
    connection.send(JSON.stringify({"enable":"midi-in"}));
    connection.send(JSON.stringify({"enable":"beat-out"}));
});


What are available commands
Each module features a few commands that can be sent to the Tony-b Machine or that can be received from the Tony-b Machine through a JSON object.
Here are all the available commands :
ModuleCommandParameter TypeDescriptionExample
midi-innStringSets the MIDI Device name
{"n":"Custom Virtual MIDI"}
mArray of 3 bytes ( see doc)Sends MIDI Message
{"m":[128,60,127]}
beat-outbintegerThe metronome ticking from 0 (measure 1, beat 1) to 15 (measure 4, beat4)
{"b":12}
db-outdintegerThe audio output level from 0 to 100
{"d":99}


Can I have some examples, please
Yes, here are a few examples.

Sending octave notes regularly in MIDI
var server = require('websocket').server;
var http = require('http');
var port = 1337;
var socket = new server({httpServer: http.createServer().listen(port)});

socket.on('request', (request) => {
    var connection = request.accept(null, request.origin);

    //enable MIDI module
    connection.send(JSON.stringify({"enable":"midi-in"}));

    //name of device
    connection.send(JSON.stringify({"n":"Node Program"}));
    
    var i = 0;
    setInterval(()=> {
        i++;
        var channel = 0;
        var cmd = 7 + i%2;//note on / note off
        var param1 = (i%4) < 2 ? 60 : 72;//midi notes : C5, C6
        var param2 = 100;//velocity
        
        //send MIDI message
        connection.send(JSON.stringify({"m":[(16*cmd+channel),param1,param2]}));
        
    },200);
});


Displaying metronome ticking
var server = require('websocket').server;
var http = require('http');
var port = 1337;
var socket = new server({httpServer: http.createServer().listen(port)});

socket.on('request', (request) => {
    var connection = request.accept(null, request.origin);
    connection.on('message', (message)=>{
        let data = JSON.parse(message.utf8Data);
        if (data["b"] != null) {
            console.log(data["b"]);//display beat from 0 to 15
        }
    });
    connection.send(JSON.stringify({"enable":"beat-out"}));
});


Displaying Audio output level
var server = require('websocket').server;
var http = require('http');
var port = 1337;
var socket = new server({httpServer: http.createServer().listen(port)});

socket.on('request', (request) => {
    var connection = request.accept(null, request.origin);
    connection.on('message', (message)=>{
        let data = JSON.parse(message.utf8Data);
        if (data["d"] != null) {
            console.log(data["d"]);//display output audio level from 0 to 100
        }
    });
    connection.send(JSON.stringify({"enable":"db-out"}));
});


erea