-
Notifications
You must be signed in to change notification settings - Fork 26
Add MIDI control 14 bit support #295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
ea41903
MIDI: add support for 14 bit control messages
204fc3a
Tools: IntegerSpec to restrict values to integers within a certain range
a05426a
mktldescs: desc for Tascam US-2400
1620156
Merge branch 'master' into cc14bit
c30c938
fix comment in IntegerClip
a9b47ba
MIDI: add support for 14 bit control messages
91f55d2
Tools: IntegerSpec to restrict values to integers within a certain range
d8ab6e2
mktldescs: desc for Tascam US-2400
2d59f6b
fix comment in IntegerClip
cdde5ce
Merge branch 'cc14bit' of github.com:ModalityTeam/Modality-toolkit in…
e6df2d6
mktldescs: update tascam us-2400
55b9a52
Merge branch 'master' into cc14bit
21c006e
Tools: remove IntegerSpec as it has been renamed
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| MIDIControl14BitHelperLobyte{ | ||
| var <cc14helper; | ||
|
|
||
| *new{ |cc14| | ||
| ^super.new.init( cc14 ); | ||
| } | ||
|
|
||
| init{ |cc14| | ||
| cc14helper = cc14; | ||
| } | ||
|
|
||
| value{ |val| | ||
| ^cc14helper.value( val, \lobyte ); | ||
| } | ||
|
|
||
| } | ||
|
|
||
| MIDIControl14BitHelper { | ||
| var loCCnum, hiCCnum; | ||
| var loByte, hiByte; | ||
| var waitingForLoByte = false; | ||
|
|
||
| *new{arg hiCCnum; | ||
| ^super.new.init(hiCCnum); | ||
| } | ||
|
|
||
| init{ |hiCC| | ||
| hiCCnum = hiCC; | ||
| loCCnum = hiCC + 32; | ||
| } | ||
|
|
||
| calculate{ arg lo, hi; | ||
| var result; | ||
| result = lo + (hi << 7); | ||
| ^result; | ||
| } | ||
|
|
||
| value{ arg val, byte=\hibyte; | ||
| var outval; | ||
| if ( byte == \hibyte ){ | ||
| hiByte = val; | ||
| waitingForLoByte = true; | ||
| }; | ||
| if ( byte == \lobyte ){ | ||
| loByte = val; | ||
| if( waitingForLoByte, { | ||
| outval = this.calculate( loByte, hiByte ); | ||
| waitingForLoByte = false; | ||
| }); | ||
| }; | ||
| ^outval; | ||
| } | ||
|
|
||
| } | ||
|
|
||
| // sending out 14 bit midi control | ||
| + MIDIOut{ | ||
| control14 { arg chan, ctlNum=7, val=64; | ||
| this.control( chan, ctlNum, val >> 7 ); | ||
| this.control( chan, ctlNum+32, val % 128 ); | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need two separate classes for this? it seems to me an unnecessary clutter of the ClassTable...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm... I guess it could be combined, if we make lobyte or hibyte an instance variable that is set on creation.
(of course, then I will need to figure out a testing scenario again as I am no longer close to the device).