Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
Scales and tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
nfxbeats committed Apr 15, 2022
1 parent 766f05a commit 8d385bd
Show file tree
Hide file tree
Showing 9 changed files with 954 additions and 163 deletions.
585 changes: 445 additions & 140 deletions device_nfxTest.py → device_FIRE_NFX.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions fireNFX_Classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,16 @@ def __init__(self):
self.MIDINote = -1 # the midi Note for this pad
self.ChordNum = -1 # the chord . ie 1 = I, 2 = ii, etc
self.IsRootNote = False #
self.IsKeyNote = False #
self.Highlight = False #

class TnfxPadMap:
def __init__(self, padIndex, flPat, color, tag):
self.PadIndex = padIndex # the pad num 0..63
self.FLPattern = flPat
self.Color = color # the color
self.Pressed = -1
self.MIDINote = -1
# self.MIDINote = -1
self.Tag = tag
self.ItemIndex = -1
self.NoteInfo = TnfxNoteInfo()

24 changes: 12 additions & 12 deletions fireNFX_Colors.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
# name=
#

from fireNFX_Utils import PadColorFromFLColor

cOff = 0x000000
cWhite = 0xFFFFFF
cSilver = 0X606060
cDimWhite = 0x101010

cMagenta = 0x7F0040
cMagentaLight = cMagenta | 0x040040

cRed = 0xFF0000
cFLRed = 0xA00000
cRedLight = 0x800000

cOrange = 0xFf2000
cFLOrange = 0xFF8000
cOrange = 0xFFA500

cYellow = 0xFFFF00

cPurple = 0x1000FF
cFLPurple = 0x6238A9

cPurpleLight = 0x20207F
cPurpleLight = PadColorFromFLColor(0xA020F0)

cBlue = 0x0000FF
cFLBlue = 0x204080
cBlueDark = cBlue & 0x001010
cBlueMed = 0x0020FF
cBlueLight = cBlue | 0x004040

cCyan = 0x00FFFF
cFLCyan = 0x008080

cGreen = 0x00FF00
cFLGreen = 0x008000
cGreenDark = 0x084000
cGreenMed = 0x12B900
cGreenLight = PadColorFromFLColor(0x43D633)

cBlueDark = cBlue & 0x001010
cBlueMed = 0x0020FF
cBlueLight = cBlue | 0x004040

cX1 = cPurple & 0x100010
cX2 = cPurple | 0x100010
Expand Down
32 changes: 32 additions & 0 deletions fireNFX_Defs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#
# most of this is copied from the Image-Line device_Fire code

from harmonicScales import *

MODE_PATTERNS = 0 # was MODE_STEP
MODE_NOTE = 1
MODE_DRUM = 2
Expand Down Expand Up @@ -98,6 +100,8 @@
TransportCtrls = [IDPatternSong, IDPlay, IDStop, IDRec]
ShiftAltCtrls = [IDShift, IDAlt]
PadModeCtrls = [IDStepSeq, IDNote, IDDrum, IDPerform]
PadModeNames = ['Pattern', 'Note', 'Drum', 'Perform']
PadModeShortNames = ['Pat', 'Note', 'Drum', 'Perf']
NavCtrls = [IDUp, IDDown, IDLeft, IDRight]
KnobCtrls = [IDKnob1, IDKnob2, IDKnob3, IDKnob4]
SelectCtrls = [IDSelect, IDSelectDown]
Expand All @@ -108,6 +112,7 @@

# the operating knobs mode NOT Pad mode
KnobModeNames = ["Channel", "Mixer", "User1", "User2"]
KnobModeShortNames = ["Ch", "Mi", "U1", "U2"]
KnobModeCtrlID = IDKnobMode
IDKnobModeLEDVals = [1,2,4,8]

Expand Down Expand Up @@ -163,3 +168,30 @@
IDColCount = DualColorFull2
IDColLoop = DualColorFull2

#

#for the scale notes
NotesListFlats = ['C','Db','D','Eb','E','F','Gb','G','Ab','A','Bb','B']
NotesListSharps = ['C','C#','D','D#','E','F','F#','G','G#','A','A#','B']
NotesList = NotesListSharps
#list of notes values
NoteValueList = [0,1,2,3,4,5,6,7,8,9,10,11]
NoteIdxDef = 0 # off set from above

OctavesList = [1,2,3,4,5]
OctaveIdxDef = 2 #index of above.

ScalesList = [ # descriptions/key notes from jake @ signals music studio - https://www.youtube.com/channel/UCRDDHLvQb8HjE2r7_ZuNtWA
# Tonality KeyNote Description
[HARMONICSCALE_MAJOR, 1], # Major 7th Bright, Happy, Melodic, Joyous
[HARMONICSCALE_DORIAN, 2] , # Minor 6th Mellow, Smooth, Semi-dark, Spicy
[HARMONICSCALE_PHRYGIAN, 3] , # Minor 2nd Dark, Tense, Creepy, Exotic
[HARMONICSCALE_LYDIAN, 4] , # Major 4th Floaty, Quirky, Sci-Fi, Spacy *Jakes fave.
[HARMONICSCALE_MIXOLYDIAN, 5] , # Major 7th Bright, Upbeat, Rockish, Irish
[HARMONICSCALE_AEOLIAN, 6,] , # Minor 6th Dark, Rock, Sad-ish,
[HARMONICSCALE_LOCRIAN, 7,] , # Diminished ??? ??? (No natural fifth, hard to use)
[HARMONICSCALE_MAJORPENTATONIC, 8], # Major
[HARMONICSCALE_MINORPENTATONIC, 9], # Minor
[HARMONICSCALE_CHROMATIC, 10] ]
ScaleIdxDef = 9

9 changes: 9 additions & 0 deletions fireNFX_Display.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def ClearDisplay():
def DisplayText(Font, Justification, PageTop, Text, CheckIfSame, DisplayTime = 0):
try:
screen.displayText(Font, Justification, PageTop, Text, CheckIfSame, DisplayTime)
screen.update()
except:
return

Expand All @@ -52,6 +53,7 @@ def DisplayBar(Text, Value, Bipolar):

def DisplayTimedText(Text):
screen.displayTimedText(Text, TimedTextRow)
screen.update()

def InitDisplay():
screen.init(DisplayWidth, DisplayHeight, TextRowHeight, FireFontSize, 0xFFFFFF, 0)
Expand All @@ -67,6 +69,13 @@ def DeInitDisplay():
def DisplayTextTop(text):
DisplayText(Font6x16 , JustifyLeft, 0, text, True)

def DisplayTextBottom(text):
DisplayText(Font6x16 , JustifyLeft, 2, text, True)

def DisplayTextMiddle(text):
DisplayText(Font6x16 , JustifyLeft, 1, text, True)





Expand Down
36 changes: 28 additions & 8 deletions fireNFX_PadDefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,41 @@
24, 25, 26, 27,
40, 41, 42, 43,
56, 57, 58, 59 ]

pdWorkArea = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59 ]

pdMacros = [ 12, 13, 14, 15, 28, 29, 30, 31]
colMacros = [ cGreen, cCyan, cBlue, cPurple, cRed, cOrange, cYellow, cWhite ]

dimDefault = 2
dimBright = 0
dimFull = 0

#navigation
pdNav = [ 44, 45, 46, 47,
60, 61, 62, 63]

#[ 12, 13, 14, 15, 28, 29, 30, 31]
pdMacroStrip = [ 12, 13, 14, 15, 28, 29, 30, 31]
#[30, 31, 14, 15, 46, 47, 62, 63]
colMacroStrip = [ cGreen, cCyan, cBlue, cPurple, cRed, cOrange, cYellow, cWhite ]

#nav for PATTERNS and DRUMS
pdPresetPrev = 44
pdPresetNext = 60
pdPresetNav = [pdPresetPrev, pdPresetNext]
colPresetNav = [cDimWhite, cWhite]

dimDefault = 2
dimBright = 0
dimFull = 0
#nav for NOTES
pdScalePrev = 44
pdScaleNext = 60
pdRootNotePrev = 45
pdRootNoteNext = 61
pdOctavePrev = 46
pdOctaveNext = 62
pdNoteUnused = 47
pdNoteRepeat = 63
colNoteRepeat = cOrange
pdNoteFuncs = [pdScalePrev, pdScaleNext, pdRootNotePrev, pdRootNoteNext, pdOctavePrev, pdOctaveNext, pdNoteUnused, pdNoteUnused]
colNoteFuncs = [cGreenLight, cGreen, cPurpleLight, cPurple, cBlueMed, cBlue, cOff, cOff ]



5 changes: 4 additions & 1 deletion fireNFX_PluginDefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,7 @@
from fireNFX_Classes import *

ppFPC_Volume = TnfxParameter('PAD Volume', 0, 0, False)
ppFPC_Pan = TnfxParameter('PAD Pan', 16, 0, True)
ppFPC_Pan = TnfxParameter('PAD Pan', 16, 0, True)
ppFPC_Mute = TnfxParameter('PAD Mute', 32, 0, True)
ppFPC_Solo = TnfxParameter('PAD Solo', 48, 0, True)
ppFPC_Tune = TnfxParameter('PAD Tune', 256, 0, False)
14 changes: 14 additions & 0 deletions fireNFX_Utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import device
import utils
import plugins
from midi import *
from fireNFX_Defs import *

Expand Down Expand Up @@ -71,5 +72,18 @@ def PadColorFromFLColor(FLColor):
g = ((FLColor >> 8) & 0xFF) // 2
return utils.RGBToColor(r, g, b)

def ShowPluginInfo(chanIdx):
print(' PluginName: ', plugins.getPluginName(chanIdx, -1, 0))
pCnt = plugins.getParamCount(chanIdx, -1)
print(' ParamCount: ', pCnt)
for param in range(0, pCnt):
print(' Param', param, plugins.getParamName(param, chanIdx, -1) )
print(' Value', param, plugins.getParamValue(param, chanIdx, -1) )
print(' ValStr', param, plugins.getParamValueString(param, chanIdx, -1) )
print(' Color0', param, plugins.getColor(chanIdx, -1, 0, param) )
print(' Color1', param, plugins.getColor(chanIdx, -1, 1, param) )
print('----------------------')




Loading

0 comments on commit 8d385bd

Please sign in to comment.