Skip to content

Commit

Permalink
prototype MidiIn component
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinawalsh committed Jul 19, 2023
1 parent 5330672 commit 6bab664
Show file tree
Hide file tree
Showing 6 changed files with 446 additions and 3 deletions.
37 changes: 36 additions & 1 deletion demo/audio.circ
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<lib desc="#BFH-Praktika" name="7"/>
<lib desc="#Analog" name="8"/>
<lib desc="#Audio" name="9"/>
<main name="main"/>
<main name="midi-in"/>
<options>
<a name="gateUndefined" val="ignore"/>
<a name="simlimit" val="1000"/>
Expand Down Expand Up @@ -814,4 +814,39 @@ BesWrFvrd9f7un/KV8uw</a>
<wire from="(430,260)" to="(430,320)"/>
<wire from="(440,260)" to="(440,330)"/>
</circuit>
<circuit name="midi-in">
<comp lib="1" loc="(140,110)" name="Probe">
<a name="facing" val="south"/>
<a name="label" val="MIDI Data Available"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(210,170)" name="Probe">
<a name="facing" val="south"/>
<a name="label" val="MIDI Data"/>
<a name="labelloc" val="north"/>
</comp>
<comp lib="1" loc="(60,290)" name="Clock"/>
<comp lib="9" loc="(120,180)" name="MidiIn"/>
<comp lib="9" loc="(420,180)" name="MidiSink">
<a name="interface" val="serial"/>
</comp>
<wire from="(100,210)" to="(100,250)"/>
<wire from="(110,130)" to="(110,150)"/>
<wire from="(110,130)" to="(140,130)"/>
<wire from="(110,210)" to="(110,290)"/>
<wire from="(110,290)" to="(410,290)"/>
<wire from="(120,180)" to="(210,180)"/>
<wire from="(140,110)" to="(140,130)"/>
<wire from="(140,130)" to="(320,130)"/>
<wire from="(210,170)" to="(210,180)"/>
<wire from="(210,180)" to="(390,180)"/>
<wire from="(320,130)" to="(320,230)"/>
<wire from="(320,230)" to="(400,230)"/>
<wire from="(400,210)" to="(400,230)"/>
<wire from="(410,210)" to="(410,290)"/>
<wire from="(50,130)" to="(110,130)"/>
<wire from="(50,130)" to="(50,250)"/>
<wire from="(50,250)" to="(100,250)"/>
<wire from="(60,290)" to="(110,290)"/>
</circuit>
</project>
13 changes: 12 additions & 1 deletion resources/logisim/en/std.properties
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,8 @@ ioSlideshowCropOption = crop to fit
# audio
audioLibrary = Audio
audioMidiSinkComponent = Midi Sink
audioMidiInComponent = Midi Input

midiNote = Note (1 to 127 for On, -1 to -127 for Off)
midiVelocity = Velocity (1 to 127)
midiDamping = Damping (1 to stop all other notes)
Expand All @@ -658,10 +660,19 @@ midiInputParallel3 = MIDI Commmand (1, 2, or 3 bytes, little or big endian)
midiInputParallel4 = MIDI Commmand (1, 2, or 3 bytes, little or big endian)
midiInputLogisim = Damper|Instrument|Velcotiy|Note (xxxD CCCC IIII IIII xVVV VVVV NNNN NNNN)
midiClock = Clock
midiEnable = Write Enable
midiWriteEnable = Write Enable
midiInterfaceOption = Interface
midiInterfaceSerial = Serial (byte)
midiInterfaceParallel3 = Parallel (24 bits)
midiInterfaceParallel4 = Parallel (32 bits)
midiInterfaceLogisim1 = Logisim (32 bits)
midiInterfaceLogisim5 = Logisim (8+7+1+4+8 bits)

midiQueueSize = Queue Size
midiReadEnable = Write Enable
midiOutputReady = Data Available
midiOutputSerial = Serial MIDI Data
midiOutputParallel3 = MIDI Commmand (1, 2, or 3 bytes, little endian)
midiOutputParallel4 = MIDI Commmand (1, 2, or 3 bytes, little endian)
midiOutputLogisim = Damper|Instrument|Velcotiy|Note (xxx0 CCCC IIII IIII xVVV VVVV NNNN NNNN)

Binary file added resources/logisim/icons/midiin.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/com/cburch/logisim/std/audio/Audio.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class Audio extends Library {

private static FactoryDescription[] DESCRIPTIONS = {
new FactoryDescription("MidiSink", S.getter("audioMidiSinkComponent"), "midisink.gif", "MidiSink"),
new FactoryDescription("MidiIn", S.getter("audioMidiInComponent"), "midiin.gif", "MidiIn"),
};

private List<Tool> tools = null;
Expand Down
Loading

0 comments on commit 6bab664

Please sign in to comment.